Representing Signed Numbers

There are three standard ways to represent negative numbers

  1. 2's complement
  2. signed magnitude
  3. excess (or bias) notation

2's complement

The 2's complement is formed by toggling all the bits in the nubmer and then adding 1.

Signed magnitude

In signed magnitude, the first bit is the sign: 1 for negative, 0 for positive. The remaining bits are the magnitude, which is the unsigned representation of the number.

To represent -5 in binary, make the first bit a sign bit 5 = 00000101 -5 = 10000101

Excess (or bias) notation

Excess notation is what is used in the game of golf. In golf, each hole has a par. The par is the average number of strokes that it takes to complete the hole. The par can be different on each hole. If you complete the hole in par, then your score is not changed. If you take more shots to complete the hole, then points are added to your score. If you take fewer shots to complete the hole, then points are deducted from your score.

For example, suppose that the first hole has a par of 5:

Further, suppose that the second hole has a par of 4:

As you can see, whatever par is determines what 0 is and determines which numbers are positive and negative.

Excess notation uses the same idea. The system designer determines what 0 is.
Suppose in a decimal system that we have 2 digits to represent a number. This means that the numbers are 00, 01, 02, ..., 98, 99. If 49 is chosen as 0, then each number would have the following meaning
00 -49
01 -48
...
48 -1
49 0
50 1
51 2
...
98 49
99 50
For the exponent in a floating point number, the range of numbers is 00h - FFh. The midway point, 7Fh, is chosen as 0. Numbers above 7Fh are positive, numbers below 7Fh are negative.
00 -127
01 -126
...
7E -1
7F 0
80 1
81 2
...
FE 127
FF 128

To represent a number in excess 7Fh notation, add the number to 7Fh.