How to build a full adder from logic gates
A full adder adds three bits (two operands plus a carry-in) and is built from two XOR gates, two AND gates, and one OR gate.
Unlike a half adder, a full adder has a carry input, so you can chain one per bit to add whole numbers. It takes A, B and a carry-in Cin, and produces a sum bit S and a carry-out Cout.
Open this circuit in the lab →
What you need
- 2× XOR — the sum: S = A XOR B XOR Cin
- 2× AND — the two carry-generating terms
- 1× OR — combining the carry terms into Cout
Step by step
- Place three inputs:
A,Band the carry-inCin. - XOR
AandBin a firstXORgate to get the half-sum, then XOR that withCinin a secondXORgate. The result is the sum bitS. - AND
AandBin oneANDgate: this carry is generated when both operand bits are 1. - AND
Cinwith the first XOR's half-sum in a secondANDgate: this carry is propagated when exactly one operand bit is 1 and a carry came in. - OR the two AND outputs together. That
ORgate's output is the carry-outCout. ProbeSandCoutand the full adder is done.
Full adder 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 |
The carry-out is 1 whenever at least two of the three inputs are 1. Wire the carry-out of one full adder into the carry-in of the next and you have a ripple-carry adder that sums multi-bit numbers.
You can also read the full theory in the lesson on 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.
Build more parts from gates
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 and course.
Open the full adder in the lab →Frequently asked
What gates are needed for a full adder?
A full adder uses two XOR gates, two AND gates, and one OR gate: five gates in total. The XORs make the sum bit, and the two ANDs feeding an OR make the carry-out.
How do you build a full adder from two half adders?
Feed A and B into the first half adder, then feed its sum and the carry-in into a second half adder. The second half adder's sum is the final sum; OR the two half adders' carry outputs to get the carry-out.
What is the carry-out logic of a full adder?
Cout = (A AND B) OR (Cin AND (A XOR B)). The first term generates a carry when both operands are 1; the second propagates an incoming carry when exactly one operand is 1.