Half Subtractor
Subtracts B from A, producing a Difference (XOR) and Borrow (NOT A AND B) output.
Half Subtractor Circuit
DIFF = 0
BORROW = 0
A − B = 0
Truth Table
| A | B | Diff (A⊕B) | Borrow |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
How It Works
DIFF = A XOR B
The difference bit is 1 when A ≠ B — same as half adder's sum.
BORROW = NOT(A) AND B
Borrow is 1 only when A=0 and B=1 — we need to "borrow" from the next bit.