Ones' Complement
Another system representation of negative numbers is ones' complement.
"Ones' complement" because a negative number is a "complement" to its positive counterpart up to 1. That is, if you add, bit by bit, the number and its negative counterpart, you get 11..1112.
To find negative counterpart, simply invert all bits of a given positive number.
Ones' complement form of 011011002(9910) is 100100112(-9910). If you add this two numbers, you get 1 in all bits.
01101100 99
+
10010011 -99
---------
11111111
But this is just a clarification of the term "ones' complement".
To add two numbers represented in this system, you need:
- Find counterpart
- Add bit by bit (not forget about carry)
- If occurred do the end-around carry
Example: Add +210 and -110
binary decimal
00000010 +2
+
11111110 -1
-------- --
1 00000000 0 incorrect
+
1 add carry
--------
00000001 +1 correct
Limitations
- two zeros