Half Subtractor: Implementation and Truth Table
Updated August 30, 2026·1 min read
Binary subtraction for two bits, and the one inverter that separates it from a half adder.
Now subtract instead of add. A half subtractor computes A minus B for two single bits, producing a DIFFERENCE and a BORROW, and it mirrors the half adder closely enough to build by editing a copy.
Truth table
| A | B | DIFF | BORROW |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
Which gates produce each output
DIFFERENCE is XOR
The difference bit behaves as the sum bit did. It is 1 exactly when the inputs differ, so DIFF = A XOR B, the same gate the adder used.
BORROW needs an inverter
Borrowing is different. You borrow only when taking 1 from 0, so BORROW = (NOT A) AND B, and that inverter is the one asymmetry with the half adder.
Half adder vs half subtractor
| Half adder | Half subtractor | |
|---|---|---|
| Main output | SUM = A XOR B | DIFF = A XOR B |
| Second output | CARRY = A AND B | BORROW = (NOT A) AND B |
| Gate count | 2 | 3 |
Build it yourself
Build the half adder first, then edit its carry branch into a borrow branch.
Loading circuit…
0 claps