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

ABDIFFBORROW
0000
0111
1010
1100

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 adderHalf subtractor
Main outputSUM = A XOR BDIFF = A XOR B
Second outputCARRY = A AND BBORROW = (NOT A) AND B
Gate count23

Build it yourself

Build the half adder first, then change the carry branch. It is a one-inverter edit.

Loading circuit…