Difference between revisions of "One's complement"

From Computer History Wiki
Jump to: navigation, search
(now unused)
m (External links: +Minus Zero)
 
Line 4: Line 4:
  
 
It has now been universally replaced by the [[two's complement]] system.
 
It has now been universally replaced by the [[two's complement]] system.
 +
 +
==External links==
 +
 +
* [https://www.fourmilab.ch/documents/univac/minuszero.html Minus Zero] - amusing detailed description of the difference between the two systems
  
 
[[Category: Theory]]
 
[[Category: Theory]]

Latest revision as of 14:43, 2 June 2025

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.

External links

  • Minus Zero - amusing detailed description of the difference between the two systems