digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen 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.

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.

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 →

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.

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.