Half and Full Subtractors in Logisim-evolution

Subtractors are the mirror image of adders and often appear in the same lab report. A subtractor computes A minus B and produces a Difference and a Borrow.

Half subtractor

  • Difference = A XOR B (same as the adder’s sum)
  • Borrow = (NOT A) AND B — we borrow when A is 0 and B is 1

Build it with two input pins, one XOR gate, one NOT gate, one AND gate, and two output pins.

Full subtractor

A full subtractor handles a borrow-in, exactly like the full adder handles a carry-in: use two half subtractors and one OR gate. Feed A and B into the first half subtractor, feed its Difference and the Borrow-in into the second, then OR the two borrows together for Borrow-out.

Shortcut: subtract with an adder

In practice, hardware rarely uses dedicated subtractor circuits. Instead, it reuses the adder: A − B = A + (two’s complement of B). Invert every bit of B and set the carry-in to 1, then run your 4-bit ripple-carry adder. Many instructors accept this as the “full subtractor” answer — ask yours which construction they expect.

See also: adders tutorial · troubleshooting