One's complement: Difference between revisions

From Computer History Wiki
Jump to navigationJump to search
Somewhat duplicative of content elsewhere
 
now unused
Line 2: Line 2:


Negative numbers are formed by taking the positive number, and complementing it (bit-by-bit inversion). So. for example, using a 4-bit [[word]], 1 is '0001'; to get -1, invert, which gives '1110'.
Negative numbers are formed by taking the positive number, and complementing it (bit-by-bit inversion). So. for example, using a 4-bit [[word]], 1 is '0001'; to get -1, invert, which gives '1110'.
It has now been universally replaced by the [[two's complement]] system.


[[Category: Theory]]
[[Category: Theory]]

Revision as of 15:51, 12 May 2021

One's complement is the original system for representing integers (both positive and negative) in binary; if the high bit (the 'sign' bit) is '1', the number is negative; if '0', the remaining bits encode either 0 (if all '0'), or a positive number. 0 has a second representation (sometimes called '-0'), with all bits (including the sign bit) set to '1'.

Negative numbers are formed by taking the positive number, and complementing it (bit-by-bit inversion). So. for example, using a 4-bit word, 1 is '0001'; to get -1, invert, which gives '1110'.

It has now been universally replaced by the two's complement system.