Professional Documents
Culture Documents
Digital VLSI Design
Digital VLSI Design
Wires are used for connecting different elements. They can be treated as physical
wires. They can be read or assigned. No values get stored in them. They need to be
driven by either continuous assign statement or from a port of a module.
Reg:-
Contrary to their name, regs don't necessarily correspond to physical registers. They
represent data storage elements in Verilog. They retain their value till next value is
assigned to them (not through assign statement). They can be synthesized to FF,
latch or combinatorial circuit.
Blocking Vs Non-blocking :
Blocking statements allow you to block this procedural barrier, hence, you can
use the flow of statements like C language in which statements are executed one
after the other.
On the other hand, when we talk about Non- blocking statements, it essentially
enables the power of Verilog. What is does is, it imitates register like behavior.
Hence, all the non blocking statements execute at an instant (parallel execution);
i.e in a single clock cycle the execution of each statement in that particular
non-blocking scope will start its execution. However, depending on the instructions
some statements may take longer to finish whilst other could complete in a jiffy.
1) Write a verilog code to swap contents of two registers with and without a
temporary register?
Initial Block :
● Not synthesizable
If there is no sensitivity list , the always blocks repeats continuously throughout the duration of simulation
Example :
2:1 MUX
➔ Using if statement