# Complement: a number that when added

## Main Question or Discussion Point

http://www.merriam-webster.com/dictionary/complement" [Broken] (noun)
2 c : a number that when added to another number of the same sign yields zero if the significant digit farthest to the left is discarded —used especially in assembly language programming
[M-W's Col. Dic.]

Could you please tell me what this definition means? Please remember I'm not a math student.

Last edited by a moderator:

Janus
Staff Emeritus
Gold Member
http://www.merriam-webster.com/dictionary/complement" [Broken] (noun)
2 c : a number that when added to another number of the same sign yields zero if the significant digit farthest to the left is discarded —used especially in assembly language programming
[M-W's Col. Dic.]

Could you please tell me what this definition means? Please remember I'm not a math student.
Some examples:

In base 10, the compliment of 3 would be 7 because 3+7 = 10 and if you discard the 1, you are left with 0

Thus 4 is the compliment of 6, 8 of 2, etc.

The compliment of 55 would be 45, because 55+45=100 and removing the 1 leaves you with 0 again.

With binary, the compliment of 1 is 1 because 1+1 =10

The compliment of 1010 would be 0110 because 1010 + 0110 = 10000 in binary.

This is handy because compliments can be used for subtraction.
Say you want to subtract 3 from 7. you can do this by converting the 3 to its compliment(7) and add it to 7. This gives you 7+7=14. discard the 1 and you get 4. This is cumbersome with base ten, but works well with binary.

If you take 1010, and convert the 1s to 0s and the zeros to 1, you get 0101, if you then add 1 to this, you get 0110. This works for every binary number.

So it is very easy to convert to a binary compliment.

So for computers, it is simpler to convert to a compliment and add, rather than having a second circuit for subtraction.

Last edited by a moderator: