This lesson builds step by step toward a half adder — a circuit that can add two binary digits.
Feed the output of an AND gate into a NOT gate. Output is only 0 when both inputs are 1.
| A | B | AND | Q (NAND) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
An OR gate followed by a NOT. Output is 1 only when both inputs are 0.
| A | B | OR | Q (NOR) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
A and B feed an AND gate. That result, plus a third input C, feed an OR gate. Q = (A AND B) OR C.
| A | B | C | A·B | Q |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Two inputs, two gates in parallel, two outputs. XOR gives the Sum bit. AND gives the Carry bit.
| A | B | Sum (XOR) | Carry (AND) | Decimal |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0+0 = 0 |
| 0 | 1 | 1 | 0 | 0+1 = 1 |
| 1 | 0 | 1 | 0 | 1+0 = 1 |
| 1 | 1 | 0 | 1 | 1+1 = 2 |