By hand, binary subtraction works like decimal subtraction. Go column by column from the right. The column rules:
- 0 − 0 = 0
- 1 − 0 = 1
- 1 − 1 = 0
- 0 − 1: borrow 1 from the left, then
10₂ − 1 = 1
The borrowed 1 is worth two in the receiving column, so the 0 becomes 10₂, and the column you borrowed from goes down by 1.
If the column to the left is also 0, the borrow passes through it, turning each 0 it crosses into 1, just as 1000 − 1 = 999 turns zeros into nines.
Hardware usually doesn't borrow at all. It uses twos complement subtraction: A − B = A + (inverted B) + 1, so the same adder handles both jobs. That's exactly what an adder subtractor does.