The difference expressed in binary, padded to the selected bit width.
Decimal (unsigned)8
Decimal (signed)8
A in decimal13
B in decimal5
OverflowNo
Final borrow0 (no borrow)
A (decimal)13
B (decimal)5
A - B (signed)8
▸
1101 - 0101 = 00001000
1101 (decimal 13) minus 0101 (decimal 5) = 00001000 (decimal 8 unsigned, 8 signed in 8-bit).
The borrow method mirrors pencil-and-paper decimal subtraction: when a column has 0 - 1, borrow from the next higher bit, turning that bit from 1 to 0 and giving the current column 2 to work with.
Next stepTo verify: convert the binary result 00001000 back to decimal using positional weights (powers of 2). It should equal 8.