Page 3
Adders
Adders are the combinational circuits that perform binary addition inside the ALU. Both boards require the half adder and the full adder, and expect you to recognise how the full adder is built from two half adders.
Half adder
Adds two single bits, A and B, producing a Sum and a Carry. It cannot accept a carry in, which is its limitation.
Truth table
| A | B | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Boolean expressions
Sum = A ^ B Carry = A * BSum is XOR; Carry is AND.
Circuit
Full adder
Adds three bits — A, B and a carry-in (Cin) — producing a Sum and a carry-out (Cout). Because it accepts a carry in, full adders can be chained to add multi-bit numbers (a ripple-carry adder).
Truth table
| 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 |
Boolean expressions
Sum = A ^ B ^ Cin Cout = (A * B) + (Cin * (A ^ B))Built from two half adders
HA1 adds A + B. HA2 adds that sum to Cin to give the final Sum. Either half adder producing a carry sets Cout, so their carries are combined with an OR gate.
Ripple-carry adder. To add n-bit numbers, chain n full adders so each
Cout feeds the next Cin. The carry "ripples" along the chain, which is why wide ripple-carry adders are
relatively slow.