The full adder: adding three bits
When you add two numbers in column, each column can receive a carry from the one on its right. The full adder adds three bits: A, B and the incoming carry Cin. It gives a sum bit S and an outgoing carry Cout for the next column.
Truth table
| A | B | Cin | S | 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 |
Try it Click the inputs to change them.
How it works
The sum is 1 when an odd number of inputs is 1: S = A XOR B XOR Cin. The carry out is 1 when at least two of the three inputs are 1.
The neat way to build it is from two half adders: the first adds A and B, the second adds Cin to that result. Either of them can produce a carry (never both at once), so an OR gate joins their two carries into Cout.
Tip for the challenge: build the half adder as its own circuit first. GateLab lets you use your own circuits as parts, the same way engineers reuse blocks.
Hints and solution
Try on your own first. Each hint gives away a little more.
- S = A XOR B XOR Cin.
- Cout is 1 when at least two of the three inputs are 1.
- Two half adders and an OR make a full adder. Tip: build the half adder as its own circuit and use it here.