Subtraction using addition - method of complements.

xyz

New member
Joined
Sep 21, 2016
Messages
1
I've been surfing the net to understand the 'method of complements'. The problem is that, different sites explaining certain aspects differently, for Ex:- Wiki. shows 9's complement subtraction by taking 9's complement of the minuend and adding that to the subtrahend and 10's complement subtraction by taking 10's complement of the subtrahend and adding that to the minuend. Other sites are applying both 9's and 10's complement to the subtrahend only.

Moreover, the methods (both 9's and 10's complements) are not working when both the operands are negative as shown below:-

The rules that I've understood so far:-
a) 9's comp: If there is a carry beyond the number of digits, add that to the addition result to get the final answer, if there is no carry, the answer is negative and we have to take 9's complement of the result to get the answer(and put a -ve sign).
b) 10's comp: If there is a carry beyond the number of digits, just discard that, if there is no carry, the answer is negative and we have to take 10's complement of the result to get the answer(and put a -ve sign).

Ex: -8-5 = (-8)+(-5) = -13
10's comp. of 8(2) + 10's comp. of 5(5) = 7 (no carry, answer will be negative)
-(10's comp. of 7) = -3 (but this should be -13).

Please explain were am I doing wrong and on which operand the complement should be applied? If it can be applied on any one of the operands and they have different methods, then please explain that too.
(Pardon my English, my mother-tongue is not English).
 
I've been surfing the net to understand the 'method of complements'. The problem is that, different sites explaining certain aspects differently, for Ex:- Wiki. shows 9's complement subtraction by taking 9's complement of the minuend and adding that to the subtrahend and 10's complement subtraction by taking 10's complement of the subtrahend and adding that to the minuend. Other sites are applying both 9's and 10's complement to the subtrahend only.

Moreover, the methods (both 9's and 10's complements) are not working when both the operands are negative as shown below:-

The rules that I've understood so far:-
a) 9's comp: If there is a carry beyond the number of digits, add that to the addition result to get the final answer, if there is no carry, the answer is negative and we have to take 9's complement of the result to get the answer(and put a -ve sign).
b) 10's comp: If there is a carry beyond the number of digits, just discard that, if there is no carry, the answer is negative and we have to take 10's complement of the result to get the answer(and put a -ve sign).

Ex: -8-5 = (-8)+(-5) = -13
10's comp. of 8(2) + 10's comp. of 5(5) = 7 (no carry, answer will be negative)
-(10's comp. of 7) = -3 (but this should be -13).

Please explain were am I doing wrong and on which operand the complement should be applied? If it can be applied on any one of the operands and they have different methods, then please explain that too.
(Pardon my English, my mother-tongue is not English).

Possibly the easiest way to explain this is to say that 9's (10's) compliment subtraction should be used subtracting a smaller number from a larger number. Thus, doing the problem (-8)+(-5) we factor out the minus one from -8 and -5 [i.e. -8=(-1)*8 and -5=(-1)*5] and write -(8+5)=-(13)=-13. If we were to do the problem 5-8 we would write -(8-5), do the 9's (10's) complement and get -(3)=-3.

If you really want to do the -8-5 by complements, then you need to pay attention to how many times you do it
-8-5 = -8 + 5(10's complement or 5) - 10 [generally hidden in the working of the problem]
= 2 + 5 [-10 -10 generally hidden]
= ...
 
Top