**Multiple Non-Blocking Assignments to Same Variable** What is the final…
**Multiple Non-Blocking Assignments to Same Variable** What is the final value of q at the end of the simulation time step? reg [3:0] q; initial begin q <= 4'd2; q <= 4'd7; q <= 4'd12; end
- 4'd2
- 4'd7
- 4'd12
- Undefined / x
Correct answer
C. 4'd12
Explanation
According to IEEE 1364 Verilog standards, when multiple non-blocking assignments target the same variable in the same time step, they are committed in procedural order. The last scheduled assignment overwrites earlier ones, so q becomes 12.