Build a full adder
Add two bits and a carry input, producing sum and carry outputs.
Include a carry
A full adder has three inputs: A, B, and Carry In. It produces Sum and Carry Out.
The extra input carries a result from the previous bit position when adding multi-bit numbers.
Try the circuit
Turn on one input, then two, then all three. With all three inputs set to 1, Sum and Carry Out are both 1, giving the binary result 11.
Click an input to change its value.
| A | B | Carry In | Carry Out | Sum |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Combine two half adders
The first half adder adds A and B. The second adds that sum to Carry In. An OR gate combines their carry outputs.
- Sum:
A XOR B XOR Carry In - Carry Out:
(A AND B) OR (Carry In AND (A XOR B))
This uses two XOR gates, two AND gates, and one OR gate.
Add more bits
Connect Carry Out from one full adder to Carry In on the next bit position. This arrangement is called a ripple-carry adder.
Each stage adds one pair of bits and passes its carry to the next stage.