see in the first case inside begin-end non blocking statements are there.
so for the non blocking statements ,simulator first caluclate the right handed side
expression for all the non blocking statements at zero simulation time .after that
i.e in the second stage caluclated expressions are assigned to left hand sided .
in this case -1, for a<=1 ,
a<=0
simulator assign one to temp_1 register
and zero to temp_2 in the first phase at zero simulation time.
second phase ,
simulator will try to assign these temp_1 ,temp_2 to a at the same time.for a single variable at same time how u can assign two values.
so that simulator should hanged.
suppose in the above if u r assigneing to differnt variables i.e suppose
a<=1,b<=0 then no problem at all.
or other wise a<=1,
#1 a <=0;
here also no problem.
or other wise a<=1,
a<=1;
same value to the one variables here also no problem
so,for a single varaible assigning two different values at particular time is not allowed
if i am wrong please correct me
Added after 4 minutes:
for case-2 ,a=1,
a<=0;
here no problem first a =1 executed because this is blocking.
after the first stament over next statement executed .
so finally a value is zero.
if i am wrong please correct me.