Table of Contents

Last modified on October 30th, 2023

Binary subtraction is one of the 4 binary operations performed using the 2 binary numbers 0 and 1; the other 3 are addition, multiplication, and division.

It is similar to decimal addition in mathematics. However, we follow some rules while doing subtraction involving binary numbers.

The subtraction involving 2 binary numbers follows the 4 rules:

- 0 – 0 = 0
- 0 – 1 = 1
- 1 – 0 = 1 (Borrow 1 from the next high-order digit)
- 1 – 1 = 0

We can summarize it as:

A + B | Subtraction | Borrow |

0 – 0 | 0 | 0 |

0 – 1 | 1 | 0 |

1 – 0 | 1 | 1 |

1 – 1 | 0 | 0 |

Let us subtract 110_{2} from 1010_{2} using the rules.

**Step 1**: Aligning the numbers based on their place values

**Step 2**: We will consider the first column and subtract the first column, which gives the result 1 (0 – 1 = 1) with a borrow of 1 from the 10’s place. The value 1 in the 10’s column is converted to 0 after being borrowed from the 10’s column as 1.

**Step 3**: Subtracting the value in the 10’s place, (0 – 0) = 0

**Step 4**: Now, for subtracting the values in 100’s place, we will borrow 1 from the 1000’s place (0 – 1) = 1

Thus, subtracting 110_{2} from 1010_{2}, we get 0101_{2}

Let us subtract 10_{2} from 111_{2} to understand binary subtraction involving borrow.

**Step 1**: Aligning the numbers based on their place values

**Step 2**: There is no borrow in this case, as there is no instance of subtraction of 1 from 0. Thus, the result is:

Thus, subtracting 10_{2} from 111_{2}, we get 0101_{2}

It is similar to binary addition using 1’s complement, where:

- 0 represents the positive sign
- 1 represents the negative sign

The basic steps to be followed while performing subtraction using 1’s complement are:

- Finding the 1’s complement of the subtrahend
- Adding it with the minuend or the first number
- If there is a carry, then we add it to the Step 2 result
- If there is no carry, the result from step 2 is the difference of the two numbers using 1’s complement

Let us subtract 100101_{2} from 110101_{2}

**Step 1**: Aligning the numbers based on their place values

**Step 2**: Finding the 1’s complement of the subtrahend and adding it to the minuend

**Step 3**:

1 1 0 1 0 1

+1 0 0 1 0 1

_________

0 0 1 1 1 1

+ 1

_________

0 1 0 0 0 0

_________

Thus, the required result is + 010000

Similar to 1’s complement, we can find 2’s complement of a number by adding a 1 to the 1’s complement of a number.

The method involves adding one integer to the 2’s complement of another number. It involves the following steps:

- Finding the 2’s complement of the smaller number
- Adding the result to the larger number
- Omitting the carry forward

Using this method, let us subtract (1010)_{2} from (1111)_{2}.

**Step 1**: Finding the 2’s complement of the smaller number, we get

(1010)_{2 }→ (0110)_{2}

**Step 2**: Adding (0110)_{2} to (1111)_{2}, we get

**Step 3**: Omitting this carry, we get

Thus, the required result is +0101

Last modified on October 30th, 2023