Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksBuild a CPUToolsOpen the lab →

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. In equations: S = A XOR B XOR Cin and Cout = AB + Cin(A XOR B).

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. Look at the five gates and you will find two half adders plus an OR: the first adds A and B, the second adds that sum to Cin, and the OR merges their two carries (they can never both be 1). The same circuit with the two half adders as blocks runs in the full adder using half adders.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

Embed or cite this circuit

Free to embed on a course page, blog or worksheet: paste this code. The circuit stays live, and the small digiwleea badge links back here.

To cite it: digiwleea, “full adder”, https://digiwleea.wleeaf.dev/tools/build/full-adder/

What you need

Step by step

  1. Place three inputs: A, B and the carry-in Cin.
  2. XOR A and B in a first XOR gate to get the half-sum, then XOR that with Cin in a second XOR gate. The result is the sum bit S.
  3. AND A and B in one AND gate: this carry is generated when both operand bits are 1.
  4. AND Cin with the first XOR's half-sum in a second AND gate: this carry is propagated when exactly one operand bit is 1 and a carry came in.
  5. OR the two AND outputs together. That OR gate's output is the carry-out Cout. Probe S and Cout and the full adder is done.

Full adder truth table

ABCinSCout
00000
00110
01010
01101
10010
10101
11001
11111

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. Projects like Tiny Tapeout let you put a design like this on a real chip. Compared with the half adder in half adder vs full adder. Worked example: 1 + 1 + 1 = 3, which is 11 in binary, so S = 1 and Cout = 1 (the last row). A common mistake is to take the carry-out as A OR B OR Cin; that gives 1 for a single 1 input, but 0 + 0 + 1 = 1 produces no carry.

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.

More builds: Arithmetic

All 247 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 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.

What is the Boolean expression of a full adder?

The sum is S = A XOR B XOR Cin. The carry-out is Cout = AB + Cin(A XOR B), which equals AB + A Cin + B Cin: it is 1 when at least two of the three inputs are 1.

How many full adders are needed for a 4-bit adder?

Four, one per bit, each carry-out feeding the next carry-in. The lowest bit has no carry in, so it can be a half adder instead, giving one half adder and three full adders.