Full subtractor: build and simulate it online

X − Y − Bin: two half subtractors and an OR.

Build the full subtractor in the free online simulator — it checks your circuit automatically.

What you need

  • 3 logic switches labelled X, Y, Z
  • 2 probes labelled D, Bout
  • 2 XOR
  • 2 NOT
  • 2 AND
  • 1 OR

Step by step

  1. Inputs and outputs. From the Logic section of the library, drop digital inputs (0/1 boxes) or logic switches for the inputs, and digital outputs or probes for the outputs; give each its label in the inspector (the checker finds them by label). Switches X, Y, Z (the borrow in); Probes D, Bout
  2. Two half subtractors. Stage 1: X − Y. Stage 2: that difference − Z. 2 XOR, 2 NOT, 2 AND
  3. Merge the borrows. Bout = B1 + B2. 1 OR
  4. Prove it. All eight rows. D = X ⊕ Y ⊕ Z; Bout = X̄Y + X̄Z + YZ

Truth table

XYZDBout
00000
00111
01011
01101
10010
10100
11000
11111

Frequently asked questions

How do you build a full subtractor?

X − Y − Bin: two half subtractors and an OR. In short: inputs and outputs, then two half subtractors, then merge the borrows, then prove it.

What is the truth table of a full subtractor?

It has 3 inputs (X, Y, Z) and 2 outputs (D, Bout), so 8 rows. The full table is on this page; the Embedded Lab checks all of them against your circuit.

What parts do you need for a full subtractor?

2 XOR; 2 NOT; 2 AND; 1 OR — plus logic switches for the inputs and probes for the outputs.

Can I simulate a full subtractor online for free?

Yes. Open it in the BitForBytes Embedded Lab, a free browser-based circuit and logic simulator: drag in the gates, wire them, and press "Check my circuit" — every input combination is simulated and marked for you. No download or sign-up needed.

Part of DSD 17 · Full subtractor in the free BitForBytes digital system design course.

More subtractors builds