Subtraction method mentioned earlier looks good when we do it on paper and pencil but to implement a subtraction method on a digital platform then subtraction using compliments is better and efficient.

**r’s compliment:**

If we are given numbers M & N with base r, then we can to have to find M – N then we can apply the following method:

**If M and N both are positives** then

- Take r’s compliment of subtrahend N
- Add the compliment to minuend M
- If we get a carry then discard it otherwise take r’s compliment of the result we get in step 2 and place –ve sign in front of this.

**If M is negative and N is positive** then i.e. – m – n where m & n are magnitudes of M&N

- Take r’s compliment of subtrahend N
- Add the compliment to minuend M
- If we get no carry then discard it otherwise if carry is 1 then, take r’s compliment of the result we get in step 2 and place –ve sign in front of this.

Eg. 76543_{10} – 66543_{10}

M=76543

N=66543

10’s compliment of N=33457

As both we ignore carry and answer we get is 0010 which is 2 (not -14) hence it is a wrong answer. It may seem very surprising as we have followed the proper procedure and yet not able to get the answer. Why???????????

Because we have to apply the 2^{nd} rule as M is negative and carry is 1 so ** we take 2’s compliment of the answer and final answer we get is – (2’s compliment of 0010 _{2}) = – 1110_{2} = – 14_{10}**

**Eg. – 9 _{10} – 10_{10}**

**Here **we see – 10** _{10}** can be represented in 2’s compliment in 5 bits so we use 5 bits for both 9= 01001 10=01010

2’s compliment of 9 to represent -9 = 10111_{2}

2’s compliment of 10 to represent -10 = 10110_{2}

As there is a carry so we’ll not ignore it as M is negative and we’ll calculate 2’s compliment of answer to get the actual answer

Answer= – (2’s compliment of 01101) = – 10011 = – 19_{10}

And we find the correct answer

**Eg. 26 _{10} – 6_{10}**

26 = 11010

6 = 00110

2’s compliment of 6 = 11010

We ignore the carry as M is positive and answer is 10100

Final answer = 10100 = 20 CORRECT