2-bit adder: circuit and truth table, live
A 2-bit adder adds two 2-bit numbers, A1 A0 and B1 B0, and outputs a 3-bit sum, Cout S1 S0, from 0 to 6. It takes a half adder for the low bit and a full adder for the high bit, with the half adder's carry feeding the full adder.
The low column has nothing to add but A0 and B0, so a half adder does it: S0 = A0 XOR B0 and its carry is A0 AND B0. The high column adds A1, B1 and that carry, which is the job of a full adder: S1 = A1 XOR B1 XOR carry, and Cout is 1 when at least two of the three are 1. Cout is the sum's third bit, so 3 + 3 = 6 comes out as 110. Chain more full adders the same way and you get the 4-bit ripple-carry adder and the 8-bit adder; try the sums by hand with the binary calculator.
Open this circuit in the lab →
What you need
- 1× XOR: S0 = A0 XOR B0 (half adder)
- 1× AND: carry out of bit 0 = A0 AND B0 (half adder)
- 2× XOR: S1 = A1 XOR B1 XOR carry (full adder)
- 2× AND: A1 AND B1, and carry AND (A1 XOR B1) (full adder)
- 1× OR: Cout, the OR of the two ANDs (full adder)
Step by step
- Place inputs
A1,A0,B1,B0and probesCout,S1,S0. - Bit 0: a half adder. XOR A0 and B0 for S0, and AND them for the carry into bit 1.
- Bit 1: a full adder. XOR A1 and B1, then XOR that with the carry for S1.
- Cout: OR together A1 AND B1 and carry AND (A1 XOR B1). Step through all 16 inputs: Cout S1 S0 is always A + B in binary.
2-bit adder truth table
| A1 A0 | B1 B0 | A + B | Cout | S1 | S0 |
|---|---|---|---|---|---|
| 00 | 00 | 0 | 0 | 0 | 0 |
| 00 | 01 | 1 | 0 | 0 | 1 |
| 00 | 10 | 2 | 0 | 1 | 0 |
| 00 | 11 | 3 | 0 | 1 | 1 |
| 01 | 00 | 1 | 0 | 0 | 1 |
| 01 | 01 | 2 | 0 | 1 | 0 |
| 01 | 10 | 3 | 0 | 1 | 1 |
| 01 | 11 | 4 | 1 | 0 | 0 |
| 10 | 00 | 2 | 0 | 1 | 0 |
| 10 | 01 | 3 | 0 | 1 | 1 |
| 10 | 10 | 4 | 1 | 0 | 0 |
| 10 | 11 | 5 | 1 | 0 | 1 |
| 11 | 00 | 3 | 0 | 1 | 1 |
| 11 | 01 | 4 | 1 | 0 | 0 |
| 11 | 10 | 5 | 1 | 0 | 1 |
| 11 | 11 | 6 | 1 | 1 | 0 |
All 16 rows of the live circuit are checked against A + B before the page is built. Cout is 1 only when the sum reaches 4, on the six rows where the two numbers add up to 4, 5 or 6. One bit wider: the 3-bit adder.
You can also read the full theory in the lesson on the full adder. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.
More builds: Arithmetic
All 246 build guides, by topic
Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.
Open the 2-bit adder in the lab →Frequently asked
How do you make a 2-bit adder?
With a half adder for the least significant bit and a full adder for the next bit, the half adder's carry feeding the full adder's carry input. The outputs are S0, S1 and the carry out, which is the sum's third bit.
How many outputs does a 2-bit adder have?
Three: S0, S1 and Cout. Two 2-bit numbers add up to at most 3 + 3 = 6, which needs three bits (110).
How many gates are in a 2-bit adder?
Seven in this design: the half adder's XOR and AND, and the full adder's two XORs, two ANDs and an OR.
Can a 2-bit adder be built from two full adders?
Yes: use a full adder for bit 0 too, with its carry input tied to 0 or used as a carry in from an earlier stage. That is how wider ripple-carry adders are built.