There are a few approaches to representing negative numbers

  • Signed bit
  • One’s complement
  • Two’s complement

Signed Bit

Just reserve the last bit (most significant) to represent the sign.

1111-7
1110-6
1101-5
1100-4
1011-3
1010-2
1001-1
1000-0
00000
00011
00102
00113
01004
01015
01106
01117

Con’s

  • Has two 0’s (positive 0 and negative 0)
  • Does correctly handle addition and subtraction between positive and negative

1’s Complement

To get one’s complement, take the complement of the positive representation of the number. In other words, flip all the bits of positive representation to get the negative representation.

1000-8
1110-7
1010-6
1011-5
1100-4
1101-3
1110-2
1111-1
00000
00011
00102
00113
01004
01015
01106
01117

Con’s

  • Has two 0’s (positive 0 and negative 0)
  • Off by 1 errors due to the negative 0

2’s Complement

Same as 1’s complement expect it removes negative 0.

1000-8
1110-6
1010-5
1011-4
1100-3
1101-2
1110-1
1111-0
00000
00011
00102
00113
01004
01015
01106
01117

To negate (~) in two’s complement:

Negate and than add 1

Additional Resources