Full adder
A full adder adds three bits (A, B and a carry-in) and outputs a sum bit and a carry-out.
Open this circuit in LogicLab →
Boolean expressions
- Sum = A ⊕ B ⊕ Cin
- Cout = A·B + Cin·(A ⊕ B)
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 |
How it works
The first XOR gate adds A and B, the second adds the carry-in to that result to form the sum. A carry-out occurs when A and B are both 1, or when the carry-in is 1 and exactly one of A or B is 1. Chaining full adders gives a ripple-carry adder of any width.
Try it yourself
Adds two bits plus a carry-in using two XOR gates, two AND gates and one OR gate. Open the circuit, click the switches to change the inputs, and watch the LEDs and the waveform panel respond. You can edit the circuit, convert it to NAND-only or NOR-only gates, and save or export your version.
Related circuits
Reference: en.wikipedia.org/wiki/Adder_(electronics)#Full_adder