**Bit-Width Expansion in Addition** What is the hex value of sum ? reg [3…
**Bit-Width Expansion in Addition** What is the hex value of sum ? reg [3:0] a, b; reg [3:0] sum; initial begin a = 4'hC; // 12 b = 4'h8; // 8 sum = a + b; end
- 4'h4
- 5'h14
- 4'h0
- 4'hE
Correct answer
A. 4'h4
Explanation
The addition $12 + 8 = 20$ ( 5'b10100 ). Because sum is only 4 bits wide, the carry-out is truncated, retaining only the lower 4 bits: 4'b0100 ( 4'h4 ).