Half & Full Adders#
Binary addition is just a combinational function, and it is built from one small cell repeated. That cell is the adder, and understanding it is understanding how gates do arithmetic.
The Half Adder#
A half adder adds two bits and produces a sum and a carry. The sum is 1 when the inputs differ, and the carry is 1 only when both are 1 β which is to say the sum is an XOR and the carry is an AND:
| A | B | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Sum = A β B, Carry = A Β· B. It is called half because it has no way to accept a carry coming in from a lower position β so it can only add the least-significant bit of a larger number.
The Full Adder#
A full adder fixes that by taking a third input, the carry-in from the stage below. It adds three bits and produces a sum and a carry-out:
| A | B | Cin | Sum | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
The sum is A β B β Cin, and the carry-out is 1 whenever at least two of the three inputs are 1 (a majority function, AB + Cin(A β B)).
Building a Word-Wide Adder#
Chain N full adders, each stage’s carry-out feeding the next stage’s carry-in, and the result adds two N-bit numbers. This ripple-carry adder is simple but carries the same flaw as the ripple counter: the carry has to propagate through every stage before the top bits are valid, so the delay grows with word width. Faster adders attack this with carry-lookahead, computing the carries in parallel from the inputs rather than waiting for them to ripple β the trick behind fast arithmetic parts like the 74283. Either way, the adder is the foundation the subtractor and the ALU are built on.