Q:
What are the blocking and non-blocking assignments in Verilog and which is preferred in Sequential Circutis?
Answer
A blocking assignment is one in which the statements are executed sequentially, i.e., first statement is executed and variable is assigned a value then second is executed and so on. A non blocking assignment is one in which statements occurs conturrently, only non blocking assignments should be used in sequential circuit.
e.g.
initial
begin
a=b; //blocking
c<=a; //nonblocking
d=c; // blocking
end
In this example firstly the value of b is assigned to a and this value is assigned to c only after execution of first statement. the second and the third statements are executed simultaneously, i.e. value a ais assigned to c and previous value if c is assigned to d.
View answer
Workspace
Report Error
Discuss