two type of delay is there 1.regular delay 2. intra delay
regular delay we define like below
initial begin
a=0; b=1;
#3 a = 1;
#5 c = a + b;
end
the meaning of this is at simulation time “0” a=0 and b=1
at simulation time “3” a=1
at simulation time “8” c=a+b
this above all you defined that regular delar.
intra delay we define like below
initial begin
a=0; b=1;
#5; // modified your code here by me see this is the blocking right so in the blocking regular delay add with the intra delay so at simulation tim"5" a=0; b=1;
a = #3 1; // here at simulation time "8" at that time the value of the a=1;
#5; // modified your code here by me
c = #5 a + b; // 5+3+5+5=18 so at simulation time"18" c=a+b;
end
this below code add by me
initial begin
a<=0; b<=1;//see this is the non blocking code so in this the intra delay is not add with the regular delay
#5; at "5" a=0 and b=1
a <= #3 1;
#5; at "10" a=1;
c <= #5 a + b;
end