------------------------------------------------------------------------------
MC logo
Binary Subtraction Examples
[^] Boolean Addition and Subtraction   [^^][^^] Binary/Boolean Main Index
------------------------------------------------------------------------------
[Binary Addition Examples] [Binary Subtraction Examples] [Eight-Bit Binary Addition Examples]
Here are some examples of binary subtraction. These are computed without regard to the word size, hence there can be no sense of "overflow" or "underflow". Work the columns right to left subtracting in each column. If you must subtract a one from a zero, you need to “borrow” from the left, just as in decimal subtraction.
1011011 − 10010 = 1001001:
1 0 1 1 0 1 1
10010
1001001
1010110 − 101010 = 101100:
0 0
×1 10 ×1 10 1 1 0
101010
101100
1000101 − 101100 = 11001:
0 1 1
×1 ×10 ×10 10 1 0 1
101100
11001
100010110 − 1111010 = 10011100:
0 1 1 1 10
×1 ×10 ×10 ×10 ×1 10 1 1 0
1111010
10011100
101101 − 100111 = 110:
0 10
1 0 ×1 ×1 10 1
100111
110
1110110 − 1010111 = 11111:
0 10 1 10 10
1 ×1 ×1 ×10 ×1 ×1 10
1010111
11111