9 / 37 · Check
Check: range and explicit extension
Check the input and output widths of an adder together.
Lessons are free to read. Enroll to save your learning progress.
You want to preserve carry in the sum of two unsigned four-bit values. Establish the calculation width first.
With a=4'd15 and b=4'd1, what is {1'b0,a}+{1'b0,b} stored in a five-bit sum?
Each input is explicitly extended to five unsigned bits, so 15+1=16 is preserved as 10000. Storing into a four-bit destination truncates the high carry and gives 0000.
✓ Check completed