Blocking and non-blocking assignments in Verilog

Explain blocking and non-blocking assignments in Verilog and which one is preferred in Sequential circuits?

E

Expert

Verified

A blocking assignment is one wherein the statements are sequentially executed, i.e. first statement is executed & variable is assigned a value then second is executed and so forth. A non blocking assignment is one wherein statements occur concurrently. Only non-blocking assignments must be employed in sequential circuit.

e.g

initial

begin

a=b; //blocking

c<=a; //nonblocking

d=c; //blocking

end

In this instance firstly the value of b is assigned to a & this value is assigned to c simply after execution of first statement. The second & the third statements are executed simultaneously, that means value a is assigned to c and previous value if c is assigned to d.

   Related Questions in Science

©TutorsGlobe All rights reserved 2022-2023.