Blocking and Non Blocking Part3 - muneeb-mbytes/FPGABoard_edgeSpartan6 GitHub Wiki

Comparing blocking and non blocking assignment statement

Blocking Statement

Consider the Example below

begin 
a = #5 b; 
c = #5 a; 
end

lets assume inetially a = 5, b = 10 and c = 0;

since above statement is blocking type

  • After 5 units time 'a' will be assigned with value 10
  • After 10 units time 'c' will be assigned with 10
  • Thus the value of 'c' will be 10 in this case

thus here the each statement are executed one after the other in sequence

Non Blocking statement

Consider the Example below

begin 
a <= #5 b; 
c <= #5 a; 
end

lets assume inetially a = 5, b = 10 and c = 0;

since above statement is non blocking type

  • inetially at 0 time units all the statements are executed
  • The value of 'a' is scheduled to assign with value of 10 after 5 time units
  • The value of 'c' is scheduled to assign with value of 5 after 5 time units
  • Thus both 'a' and 'c' is assigned with their respective values in 5 time units itself

thus here the each statement are executed concurrently