Half Adder: Implementation and Truth Table
A half adder adds two single bits and produces two outputs: a SUM bit and a CARRY bit. It is the smallest piece of arithmetic hardware there is, and every larger adder is built from copies of it.
Why two outputs are necessary
Adding two bits can produce 2, which does not fit in one bit. 1 + 1 = 10 in binary: a sum of 0 and a carry of 1. That overflow is exactly what the carry output is for.
Truth table
| A | B | SUM | CARRY |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Which gates produce each output
SUM is XOR
Look at the SUM column: it is 1 exactly when the inputs differ. That is the definition of XOR, so SUM = A XOR B.
CARRY is AND
CARRY is 1 only when both inputs are 1, which is AND. So CARRY = A AND B. The entire half adder is two gates.
The limitation: no carry in
A half adder has nowhere to accept a carry from a previous column, so it can only ever add the rightmost bit of a number. Fixing that is what the full adder is for.
Build it yourself
Two gates, four rows to check. This is the best possible first circuit to build from scratch.