always@(posedge clk)begin
x<=1'b1;// First Assignmentif(y)begin//some condition met
x <=1'b1;// Second Assignmentendend
I would like to know in above code when also condition met which assignment will be executed although both assignments are same? First Assignment or Second Assignment?
If there is clear execution ordering of a set of nonblocking assignments, the order of the resulting updates to the LHS are preserved. So the second assignment overrides the first.
In synthesis, the conditional statement would be optimized away as it has no impact on the result.