Half Subtractor: Implementation and Truth Table
A half subtractor computes A - B for two single bits, producing a DIFFERENCE and a BORROW. It mirrors the half adder almost exactly, with one revealing difference.
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
Exactly as in the half adder, the difference bit is 1 when the inputs differ: DIFF = A XOR B.
BORROW needs an inverter
You borrow only when subtracting 1 from 0, so BORROW = (NOT A) AND B. This is the one asymmetry with the half adder, whose carry is a plain A AND B with no inversion.
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 change the carry branch. It is a one-inverter edit.
Loading circuit…