Unit-2 DSD Short Notes
Unit-2 DSD Short Notes
Program Structure-:
Modules -: They are building block . A. module defined a portion of
hardware which consists of complex system, full adder , gates
Ports -: Modules Interact with external environment via ports input
and output.
Statements-: The logic or function of module is defined using
various constructs such as assign (for continuous assignments) ,
always (for sequential logic ) and procedural blocks (assign , initial).
module top;
wire a, b, sum;
● Reusable
● Timing Controls
● Multiple Outputs
Verilog Funtions -: Just like tasks but more restrictive like only
return a singnle output and can only execute combinational
logic , not contiain timing delays
Compiler Directives-:
n Verilog, compiler directives are special commands that control
various aspects of the compilation process. They are useful for
setting up conditions, managing parameters, and altering compilation
behaviors to make code more flexible, configurable, and efficient
These directives are typically prefixed with a backtick ( ) and are not
executed as part of the simulation
3. `timescale
The `timescale directive specifies the time unit and time precision
for simulation. It is often used at the beginning of a file and affects all
modules within that file.
4. default_nettype
The `default_nettype directive controls the default data type for
undeclared signals in the module. This is often used to prevent
implicit declarations.
7. `resetall
The `resetall directive resets all previously set compiler directives to
their default states. It’s useful at the end of a file to avoid unintended
propagation of directives.
8. `line
The `line directive is used for debugging. It helps in controlling the
line number and file name that are displayed in compilation
messages, making it easier to trace back errors.
9. `pragma
`pragma is a directive used to add hints to the compiler, often related
to optimization. Pragmas are typically tool-specific, meaning they
might not be supported by all Verilog compilers.