**Self-Determined Expression Truncation** What is the decimal value of re…
**Self-Determined Expression Truncation** What is the decimal value of res ? reg [3:0] a, b; reg [7:0] res; initial begin a = 4'd10; b = 4'd10; res = {a * b}; end
- 100
- 4
- 8
- 64
Correct answer
B. 4
Explanation
Concatenation braces {} create a self-determined expression context. The expression inside ( a * b ) is sized purely to the width of its widest operand (4 bits). The product $10 \times 10 = 100$ ( 7'b1100100 ) is truncated to 4 bits ( 4'b0100 = 4), which is then zero-extended into the 8-bit res .