Subtraction

Consider if we have to find the subtraction x-y, we perform the following steps:

  1. Take 2’s complement of y
  2. Add x and 2’s complement of y

for eg:

x=3, y=2 for 4 bits 2's complement representation

3---> 0011
Take 2's complement of 2----> 0010
1101 + 1 ---> 1110

Adding 0011 and 1110
0011
1110
0001 

---> +1 (discard carry 1 from MSB)

Arithmetic Operations of 2’s Complement Number System

We all know how to perform arithmetic operations of binary number systems. However, computer system generally stores numbers in 2’s complement format. So it becomes necessary for us to know how arithmetic operations are done in 2’s complement.

Similar Reads

Addition:

In 2’s complement, we perform addition the same as an addition for unsigned binary numbers. The only difference is here we discard the out carry i.e carry from MSB bit as long as the range lies within the accepted range for 2’s complement representation....

Subtraction

Consider if we have to find the subtraction x-y, we perform the following steps:...

Multiplication:

If operands x and y which need to be multiplied are of n and m digits respectively then the result will be n+m digits. To get correct results we extend digits of both operands to n+m digits...