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.
Open this circuit in the lab →
What you need
- 4× NOR: first half subtractor: N1 = NOR(A, B), N2 = A'B (borrow 1), N3, X1 = A XNOR B
- 1× NOR: D1 = NOR(X1, X1) = A XOR B
- 4× NOR: second half subtractor on D1 and Bin: M4, M5 = D1'Bin (borrow 2), M6, X2
- 1× NOR: D = NOR(X2, X2)
- 2× NOR: Bout = NOR(NOR(N2, M5)) = borrow 1 + borrow 2
Step by step
- Place inputs
A,BandBinand probesDandBout. - 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.
- 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.
- NOR the two borrows together and invert with one more NOR: that is
Bout. - 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
| A | B | Bin | D | Bout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
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.