Figure 1. Single-bit add table. Two operand bits and a carry-in produce a sum bit and a carry-out — exactly what one full-adder cell computes.
One column of binary addition is a full adder: three inputs (A, B, Cin) and two outputs (Sum, Cout). Sum is A⊕B⊕Cin; carry-out is the majority of the three inputs.
Figure 2. Block symbols. The half adder handles the LSB column (no carry-in); the full adder handles every column above it. Chain one HA + (n−1) FAs — or n FAs with the LSB's Cin tied to 0 — to add two n-bit numbers.
The half adder is the stripped-down case: only two inputs (A, B), so its sum is A⊕B and its carry-out is A⋅B. It fits the LSB column where there is no carry coming in from the right.
Figure 3. Half adder, gate level. One XOR produces Sum and one AND produces Cout. Both inputs feed both gates — the trunks branch via junction dots.Figure 4. Full adder = HA + HA + OR. Two half-adders chain through the intermediate Sum1, and an OR merges the two intermediate carries (Co1 from HA1, Co2 from HA2) into the final Cout.
Chain N full adders LSB-to-MSB and you have a ripple-carry adder. Carry propagates from cell to cell, and the time to settle is proportional to N — which is why fast ALUs use carry-lookahead instead.
Subtraction = add the negation
Figure 5. One adder, two modes. The subtract control line MUXes inverted B onto the input and forces Cin = 1; the rest of the datapath is unchanged.
A−B=A+(∼B)+1 in any bit width. The XOR gates on the B input invert when subtract = 1, and feeding 1 into the LSB's carry-in completes the negation. Same hardware, two operations.
Two's complement makes the adder sign-agnostic. The bits of −3 in 4-bit form (11012) are the same bits a hex dump would show; what changes is whether you read the MSB as a sign bit. The adder doesn't care — it just sums the bits.
Overflow vs. carry-out
Figure 6. Two flags, two questions. The Cin / Cout columns are the carry into and out of the MSB (sign-bit) column — not the LSB. Carry-out asks 'did the unsigned sum exceed the register?'; overflow asks 'did the signed sum land on the wrong side of the number line?'
Carry-out is the bit that falls off the MSB during the add. It's the C flag on most CPUs and tells you whether the unsigned sum overflowed 2n.
Overflow is signed: it fires when both operands have the same sign but the result has a different sign. Equivalently, it's Cin⊕Cout at the MSB.
Carry-out and overflow are independent flags. Use carry for unsigned arithmetic and multi-precision chaining; use overflow for signed-arithmetic correctness. Subtraction is just add-the-inverse with carry-in 1, so the same adder handles both — and both flags still apply.