Bit widths in arithmetic expressions
reg [3:0] a, b, temp;
reg [5:0] c, z;
z = (a + b) + c; // intermediate value is 6-bit truncated
temp = a + b; // result is 4-bit truncated
z = temp + c; // result is 6-bit truncated
Bit widths set by declarations
Intermediate values are inferred
Previous slide
Next slide
Back to first slide
View graphic version