<<< Signed Magnitude Data Types     Index     2's complement integers >>>

7. 1's complement integers


  • Quite simple idea: to represent negative number,

    1. Take positive number,

    2. Set leftmost bit equal to 1.

    3. Flip the bits of positive number.

  • For example,

      5 = 0000 0101
     -5 = 1111 1010
    
  • Unfortunately, this too requires cumbersome hardware to do further addition.

  • 8 bit ones' complement:

    Binary value Ones' complement interpretation Unsigned interpretation
    00000000 0 0
    00000001 1 1
    ... ... ...
    01111101 125 125
    01111110 126 126
    01111111 127 127
    10000000 -127 128
    10000001 -126 129
    10000010 -125 130
    ... ... ...
    11111110 -1 254
    11111111 -0 255

<<< Signed Magnitude Data Types     Index     2's complement integers >>>