Subtraction by 2’s Complement | How to do 2s Complement Subtraction?

Subtraction using 2’s Complement is an easy way to find the subtraction of numbers. Binary Subtraction is nothing but subtracting one binary number from another binary number. The Two’s Complement is the best process to works without having to separate the sign bits. The results are effectively built-into the addition/subtraction calculation using 2’s Complement method.

Check out the 2’s complement method for the binary number subtraction. We can easily subtract the binary numbers with the 2’s complement method. The expression for the 2’s complement is X – Y = X + not (Y) + 1.
For example, Y = 2 we can write it as 0010 in binary format
Not (Y) = 1101 and
Not (Y) + 1 = 1101
= 0001
Therefore, not(Y) + 1 = 1110
1110 is the 2’s complement of not(Y) + 1 where X is called as Minued and Y is called as a subtrahend.

Also, Read:

Conversion of Numbers into Binary Format

The very first thing, we should know the converting process of numbers into binary format. To convert the numbers into binary numbers, we have to follow one code. That is ‘8421’. Based on this code we can write the binary format numbers up to 15.

Example:
8421
0000 – 0 —-1’ s complement is 1111.
0001 – 1 —- 1’s complement is 1110.
0010 – 2 —-1’s complement is 1101.
0011 – 3 —-1’s complement is 1100.
0100 – 4 —-1’s complement is 1011.
0101 – 5 —-1’s complement is 1010.
0110 – 6 …..1’s complement is 1001.
up to 1111 = 15 —- 1’s complement is 0000.
For 2’s complement values, we need to add the ‘1’ to the 1’s complement values.
By applying the subtraction on binary numbers, we need to know some basic things like below,

  • 0 – 0 = 0.
  • 1 – 0 = 1.
  • 0 – 1 = 1 (Borrow 1).
  • 1 – 1 = 0.

How to Subtract Binary Numbers using 2’s Complement?

Follow the simple and easy steps to Perform Subtraction of Binary Numbers by 2S Complement. They are as follows

  1. Note down the given numbers in the binary format.
  2. Change the negative integer or number into its own 1’s complement. That means, change numbers as ‘0’ in place of ‘1’ and ‘1’ instead of ‘0’.
  3. After getting the 1’s complement value of the number, add the 1 in terms of binary format to the 1’s complement value.
  4. Now, the resultant value should be considered as a two’s complement of the negative integer.
  5. Finally, add the two’s complement of the negative integer with the first integer value.
  6. If you get the carrier that is ‘1’ by adding the above two numbers, then the result is considered positive.
  7. If you won’t get the carry, then the resultant value should be considered as a negative number.

Solved Examples on Binary Subtraction by 2’s Complement

1. 1100 – 1010.

Solution:
We can write the given numbers as 1100 + (- 1010).
Step (i) The given numbers are already in binary format.
Step (ii) Change the negative integer or number or subtrahend into its own 1’s complement. That means, change numbers as ‘0’ in place of ‘1’ and ‘1’ instead of ‘0’.
The 1’s complement of 1010 is 0101.
Step (iii) Add the ’1’ to the 0101 that is 0101 + 1 = 0110.
Step (iv) 0110 is a two’s complement of – 1010.
Step (v) Minued ——1100.
Subtrahend ————1010.
Resultant value = 1   0110.

The carry number in the resultant value is ‘1’. So, the final value is a positive number. That is (+) 0110.

2. Find the value of 15 – 10 by 2’s complement?

Solution:
The given numbers are 15 – 10.
15 – 10 in terms of binary format is 1111 – 1010.
We can write it as 1111 + (-1010).
Here, 1111 is minued and the 10101 is subtrahend.
1’s complement of subtrahend is 0101.
For the 2’s complement, add the ‘1’ to the 0101. That is, 0101 + 1 = 0110.
Now, add the minued number with the 2’s complement of subtrahend number.
Minued ——-                     1111.
Subtrahend —                    0110.
The resultant value is    1  0101.

The carry number is ‘1’. So the resultant value is a positive number that is (+) 0101.

3. Calculate the subtraction of 11100 – 01100 by two’s complement?

Solution:
The given numbers are 11100 – 01100.
we can write it as 11100 + (- 01100).
Here, 11100 isminued and 01100 is subtrahend.
1’s complement of 01100 is 10011.
For the 2’s complement, add the ‘1’ to the 10011. That is 10011 + 1 = 10100.
Now, add the minued number with 2’s complement of subtrahend number.
Minued ———-                                     11100.
2’s complement of subtrahend ——-10100.
The resultant value is ——               1  10000.

The carry number is ‘1’. So the resultant value is positive. That is (+) 10000.

4. Find the subtraction by 2’s complement for 00111 – 10101?

Solution:
The given numbers are 00111 –10101.
we can write it as 00111 + (- 10101).
Here,00111 isminued and 10101 is subtrahend.
1’s complement of 10101 is 01010.
For the 2’s complement, add the ‘1’ to the 01010. That is 01010 + 1 = 01011.
Now, add the minued number with 2’s complement of subtrahend number.
Minued ———-                                     00111.
2’s complement of subtrahend ——-01011.
The resultant value is —— 10010.

There is no carry number. So the resultant value is negative. That is (-) 10010.

5. Calculate 1001.01 – 1100.10?

Solution:
The given numbers are 1001.01 – 1100.10.
we can write it as 1001.01 + (– 1100.10).
Here, 1001.01isminued and 1100.10 is subtrahend.
1’s complement of 1100.10 is 0011.01.
For the 2’s complement, add the ‘1’ to the 0011.01. That is 0011.01 + 1 = 0011.10.
Now, add the minued number with 2’s complement of subtrahend number.
Minued ———-                                     1001.01.
2’s complement of subtrahend ——-0011.10.
The resultant value is ——                   1100.11.

There is no carry number. So the resultant value is negative. That is (-) 1100.11.

6. Find the subtraction by 2’s complement for 101011 – 011001?

Solution:
The given numbers are 101011 – 011001.
We can write it as 101011 + (– 011001).
Here, 101011isminued and 011001 is subtrahend.
1’s complement of 011001 is 100110.
For the 2’s complement, add the ‘1’ to the 100110. That is 100110 + 1 = 100111.
Now, add the minued number with 2’s complement of subtrahend number.
Minued ———-                                      101011.
2’s complement of subtrahend ——- 100111.
The resultant value is ——1  110010.

The carry is ‘1’ in the resultant value. So the resultant value is positive. That is (+) 110010.

Leave a Comment