There are three standard ways to represent negative numbers
The 2's complement is formed by toggling all the bits in the nubmer and then adding 1.
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 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
|
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.
|
To represent a number in excess 7Fh notation, add the number to 7Fh.