First, most computers store the mantissa as a pure fraction, with no integer part. Thus, the mantissas would be between 0 and 1.0, not including 1.0.
Second, most exponents are stored using excess notation, which is another way of representing positive and negative integers. (We have already studied sign-magnitude form and 2's complement.) In excess notation, the representation of a number is the original number plus a certain fixed amount. We will store only 2 decimal digits for our exponents in this chapter and use excess 50 notation. This means that whatever value we see for the exponent, the actual value is that number minus 50. For instance, the speed of light is represented by 1.86×1055. In order to discover the true exponent, we subtract 50 off the exponent. To distinguish between exponents that are to be taken at "face value" from those which are stored in excess-50 notation, we will always underline exponents that are excess-50.
The excess value is always halfway between the minimum and the maximum values so that the range of numbers can be equally divided between negatives and positives. If the numbers we use to represent exponents are 00, 01, 02, ... 97, 98, and 99, then halfway would be 50. Thus any number less than 50 represents a negative exponent while any number over 50 represents a positive one. Real computer hardware often uses excess notation, except that the value they add is a power of 2. Thus, if the exponent were stored in 8 bits, 128 would be the excess value, since it is 10000000 and is halfway between 00000000 and 11111111.
Third, we need to fix the size of the mantissa. We will use 5, which is precision of the real number since it tells how accurate or precise our values are.
Fourth, we need to have a sign bit or digit. In real circuitry one of the bits will store this. In our examples, we will devote the first digit to the sign, letting 0 mean positive and 1 mean negative. Notice that we revert to sign-magnitude representation of signed numbers when we store floating point numbers. 2's complement is not used to represent real numbers in most computers.
Here are some values using this notation:
0|56|18600 1.86 × 105 speed of light in a vacuum 0|27|16734 1.67339 × 10-24 gram mass of the hydrogen atom (proton) 1|51|10000 -1.0 negative 1 1|50|10000 -0.1 negative one tenth 0|50|10000 0.1 positive one tenth
Notice that the exponent of the speed of light is 56, which seems 1 too large. But remember that the implied decimal point is before the mantissa, so we need to change the number to 0.186×106, which of course has the same value as 1.86×105. If we multiply the mantissa by 10, we must subtract 1 from the exponent. Subtracting 1 from the exponent is really the same as dividing the number by 10.
Here's how the mass of the hydrogen atom was encoded. First, 1.67339 can't be stored in 5 digits; our mantissa cannot be that large, so we round up the mantissa to 1.6734. Next, we change 1.6734×10-24 so that the mantissa is between 0 and 1.0 exclusive; hence 0.16734×10-23. Notice that we can multiply any number by 1 and not change its value. Since 1 = 10/10, we can both multiply the number by 10 and divide by 10. Since the number is actually a product of the mantissa and the exponent, we can multiply one part by 10 while dividing the other part by 10. So we choose to divide the mantissa by 10 (shift the decimal point one place to the left) and multiply the exponent by 10 (add 1 to -24 and getting -23). Finally, the exponent is negative, so we subtract the absolute value of the exponent from 50: 50-23=27.