# 10's complement confusion.

For the sake of simplicity, lets consider only single digit numbers. According to the logic(that I understand), 10's complement of a number 'x' is (10-x). So,

10's comp. of 0 = (10-0) = 10 (due to overflow, only 0 remains, so no -ve 0)(am I correct?),

10's comp. of 1 = (10-1) = 9 (representing -1),

10's comp. of 2 = (10-2) = 8 (representing -2),

10's comp. of 3 = (10-3) = 7 (representing -3),

10's comp. of 4 = (10-4) = 6 (representing -4),

10's comp. of 5 = (10-5) = 5 (representing -5) (here is the problem).

How can 5 represent -5? If we cannot include +5, then 10's complemented 5 is the negative of whom? how this problem is dealt with? Am I making any mistake? Please explain in detail. Thank You!

Edit: How would a processor, which does 2's complement arithmetic(an extension of 10's complement) be able to distinguish between +5(5) and -5(5)?

• $5+5=0$ so of course $5$ is its own negative. Sep 22 '16 at 17:19
• Yes! so is 4+6, 3+7, 2+8, 1+9 and 0+10 but you can distinguish between say +4(4) and -4(6), how would you distinguish between +5(5) and -5(5)?
– samm
Sep 22 '16 at 17:36
• Since $+5$ and $-5$ turn out to be the same, you could just call it $5$. Compare to $0$: we have $+0 = -0$, but usually just write $0$. Sep 22 '16 at 17:51

What you seem to be looking for is perhaps additive inverse for a group where the additive identity is given by $I=10$.

If you understand modular arithmetic, you will know that it's just a definition. For example under mod 10, 1 is equivalent to -9.

Imagine a clock with numbers 0 to 9, moving 5 units forward is the same as moving five units backward 0 9 8 7 6 5 or 0 1 2 3 4 5

You really need more digits to see what is going on. If you have a three digit register, we consider all numbers that start with $0$ to $4$ as positive and all numbers that start with $5$ to $9$ as negative. The range of numbers you can represent is then $-500$ to $+499$. Yes, $500$ and $-500$ would be represented by the same number, but any calculation that results in $+500$ should be considered an overflow. In your example, $5$ would represent $-5$ and not $+5$. $+5$ (and any higher positive number) cannot be represented in this system.

• Thank you! I kind of understood, you mean, since we are using 5 as -5, 5 cannot be used in any calculation or result in a single digit system, we need at least a two digit system to get 5 whose 10's complement will be 95, am I right? another thing, is there any advantage (mathematical/circuital) of using 5 as -5 and making 5 out of range instead of making both 5 and -5 out of range in single digit system?
– samm
Sep 22 '16 at 19:37
• Yes, to represent $5$ you need two digits. In that case $-5$ is represented as $95$. The nice thing about complement notation is that you can add, subtract, and multiply without worrying about signs, so $-2 + (-2)$ is represented as $8+8=6$ (with a carry you ignore) and the result is $-4$. In four bit two's complement the negative numbers range from $1000$, which represents $-8$, to $1111$, which represents $-1$ and the positives range from $0001$, which represents $1$ up to $0111$, which represents $7$. This shows why we keep the most negative value-it lets the high order bit be the sign. Sep 22 '16 at 21:01
• Keeping one of $5,-5$ just gives you more range than excluding them both. Sep 22 '16 at 21:02