**Evaluation of Unknowns in Equality** What are the resulting values of e…
**Evaluation of Unknowns in Equality** What are the resulting values of eq1 and eq2 ? reg [3:0] a, b; reg eq1, eq2; initial begin a = 4'b10x1; b = 4'b10x1; eq1 = (a == b); eq2 = (a === b); end
- eq1 = 1'b1, eq2 = 1'b1
- eq1 = 1'bx, eq2 = 1'b1
- eq1 = 1'b0, eq2 = 1'b1
- eq1 = 1'bx, eq2 = 1'bx
Correct answer
B. eq1 = 1'bx, eq2 = 1'b1
Explanation
Logical equality ( == ) evaluates to x whenever any bit is x or z . Case equality ( === ) checks exact bit-level matches, including x and z , returning 1'b1 .