Three bits in, a sum and a carry out — the block every adder is made of. A ready-made arithmetic circuit you can open in the TorchAnvil simulator.
A half adder is nice, but real arithmetic needs to chain. When you add two four-bit numbers column by column, every column — except the first — has a carry coming in from the column to its right. A full adder is a half adder that knows what to do with that incoming carry.
Three inputs: A, B, and the incoming carry Cin. Two outputs: the Sum bit and a Cout that goes to the next column.
It's literally two half adders glued together with an OR:
A ⊕ B)
and a partial carry (A · B).A ⊕ B ⊕ Cin) and a second partial carry.Here's the full truth table. Eight rows because three inputs give 2³ combinations.
| 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 |
Chain four full adders together and you've got a 4-bit ripple-carry adder — a circuit that adds two nibbles. Chain eight and you can add bytes. The entire arithmetic/logic unit of a simple CPU starts right here, with this one circuit.
1 + 1 + 0 = 10.1 + 1 + 1 = 11.