next up previous

2.6 Data Representations     continued...

Since we need to represent both positive and negative real numbers, the complete representation for a real number in a floating point format has three fields: a one-bit sign, a fixed number of bits for the mantissa, and the remainder of the bits for the exponent. Note that the exponent is an integer, and that this integer can be either positive or negative, e.g. we will want to represent very small numbers such as . Any method such as two's complement that can represent both positive and negative integers can be used within the exponent field. The sign bit at the front of the number determines the sign of the entire number, which is independent of the sign of the exponent, e.g. it indicates whether the number is or .

In the past every computer manufacturer used their own floating point representation, which made it a nightmare to move programs and datasets from one system to another. A recent IEEE standard is now being widely adopted and will add stability to this area of computer architecture. For 32-bit systems, the standard calls for a 1-bit sign, 8-bit exponent, and 23-bit mantissa. The largest number that can be represented is , and the smallest positive number (closest to 0.0) is . Details of the standard are presented in an appendix to this chapter.

Figure 2: Distribution of Floating Point Numbers.