16 / 63 · Concept
Adders and carry propagation
Derive full-adder equations and analyze ripple carry in terms of function, width and delay.
Lessons are free to read. Enroll to save your learning progress.
Express a one-bit addition with two result bits
The sum of ranges from 0 to 3, requiring a sum bit and a carry into the next position. The sum bit is 1 for an odd number of 1 inputs; the carry is 1 for at least two.
Define generate as and propagate as . Then , where means OR. A half adder is the special case without a carry input: its sum is XOR and its carry is AND.
Change the three inputs and confirm that a+b+cin = sum+2×cout always holds. Carry becomes the next position's input; it does not have the same weight as sum.
a + b + cin = sum + 2 × cout
How far must the carry travel?
Consider four-bit 1111 + 0001. Bit 0 generates a carry that propagates through the other three positions. The stored sum is 0000 and the final carry is 1. In a ripple-carry structure, higher positions may have to wait for carry from lower positions.
Expanding the equations reveals opportunities to compute carry in parallel. Fast adders combine group propagate and generate terms, but trade area against delay through fan-in, wiring and library cells. An RTL + does not necessarily map to a ripple-carry circuit.
Make the sum width explicit in the design
logic [3:0] a, b, sum;
logic cin, cout;
logic [4:0] wide_sum;
assign wide_sum = {1'b0, a} + {1'b0, b} + {4'b0000, cin};
assign sum = wide_sum[3:0];
assign cout = wide_sum[4];Five bits are sufficient because the maximum is . Decide first whether only the low-order sum is needed, whether carry feeds another stage, and whether saturation is required. The interactive exercise checks a single full-adder stage's truth tableTruth table A table listing every possible input combination and its output. Changes over time are checked separately with waveforms. Learn more; it does not measure the delay of an actual synthesized circuit.
Change the inputs
Try it yourself
For four-bit unsigned , and , find the full sum, four-bit sum and carry. If the same circuit is interpreted as signed addition, can carry alone determine overflow?
Read the explanation
The full sum is 16, or 10000, so sum=0000 and carry=1. Under a signed interpretation, 1001 is -7, so , within range. Carry and signed overflow are different conditions.