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

Full subtractor using NOR gates only, live

A full subtractor can be built from NOR gates alone: two NOR half subtractors in a row, each giving one borrow term, and a NOR with an inverter to OR the borrows together. This design uses 12 NOR gates and computes D = A XOR B XOR Bin and Bout = A'B + (A XOR B)'Bin.

The first stage works on A and B: N1 = NOR(A, B), then N2 = NOR(A, N1) works out to A'B, which is the first borrow, and NOR(N2, NOR(B, N1)) is A XNOR B, inverted once more into A XOR B. The second stage repeats the pattern on that difference and Bin: its NOR(D1, NOR(D1, Bin)) is D1'Bin, the second borrow, and its XOR output is the final difference. A borrow happens when either stage borrows, so Bout = borrow 1 + borrow 2, an OR built as a NOR followed by a NOR inverter. It is the same two-half-subtractor structure as the full subtractor page, with every gate made from NOR; see the half subtractor using NOR gates for one stage on its own, and the full subtractor using NAND gates and full adder using NOR gates for the neighbouring designs.

Big circuit: pinch, scroll or tap + to zoom in, then drag to move around.

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 subtractor from NOR gates”, https://digiwleea.wleeaf.dev/tools/build/full-subtractor-nor/

What you need

Step by step

  1. Place inputs A, B and Bin and probes D and Bout.
  2. Build the first NOR half subtractor on A and B: four NORs give A XNOR B, a fifth inverts it, and N2 = NOR(A, NOR(A, B)) is its borrow.
  3. Build the second on (A XOR B) and Bin the same way: its output is D, and NOR(D1, NOR(D1, Bin)) is its borrow.
  4. NOR the two borrows together and invert with one more NOR: that is Bout.
  5. Try all eight rows: D is 1 when an odd number of inputs are 1, and Bout is 1 when B + Bin is more than A.

Full subtractor truth table

ABBinDBout
00000
00111
01011
01101
10010
10100
11000
11111

All eight rows are checked on the live circuit before the page is built.

You can also read the full theory in the lesson on the full subtractor. 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: Universal gates: NAND only, NOR only

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 full subtractor from NOR gates in the lab →

Frequently asked

How many NOR gates are needed for a full subtractor?

This design uses 12: five for each NOR half subtractor (four for XNOR, one to invert it) and two to OR the two borrows. The two borrow terms come straight out of the half subtractors' gates.

What is the borrow equation of a full subtractor?

Bout = A'B + A'Bin + B Bin, which can also be written Bout = A'B + (A XNOR B) Bin: borrow from A - B, or borrow from subtracting Bin when A and B are equal.

How do you make a full subtractor from half subtractors?

Use two half subtractors and an OR gate: the first computes A - B, the second subtracts Bin from that difference, and Bout is the OR of their borrows.