A borrow is subtraction's version of a carry. When a column needs to take away more than it has, it takes 1 from the column to its left. In decimal that 1 is worth ten in the receiving column; in binary it's worth two.
In binary, the only column that needs a borrow is 0 − 1. Borrowing turns the 0 into 10₂ = 2, and 2 − 1 = 1. The lending column drops by 1.
If the lending column is 0, it has nothing to give, so it borrows from its own left neighbor first. A borrow can travel through a run of zeros, turning each one into a 1 on the way.
In hardware, adders subtract by adding the twos complement instead, and the borrow shows up in the carry out. When computing A − B as A + (inverted B) + 1:
- carry-out 1 means no borrow: A ≥ B as unsigned numbers
- carry-out 0 means a borrow: A < B, and the unsigned result has wrapped around
So after a subtraction, the carry flag is the opposite of a borrow flag in this convention (ARM works this way; x86 stores the borrow itself).