14
Digital Electronics
60559:1989. An ongoing revision to IEEE-754 is IEEE-754r. Another related standard IEEE 8541987 generalizes IEEE-754 to cover both binary and decimal arithmetic. A brief description of salient
features of the IEEE-754 standard, along with an introduction to other related standards, is given below.
ANSI/IEEE-754 Format
The IEEE-754 floating point is the most commonly used representation for real numbers on
computers including Intel-based personal computers, Macintoshes and most of the UNIX platforms.
It specifies four formats for representing floating-point numbers. These include single-precision,
double-precision, single-extended precision and double-extended precision formats. Table 1.1 lists
characteristic parameters of the four formats contained in the IEEE-754 standard. Of the four formats
mentioned, the single-precision and double-precision formats are the most commonly used ones. The
single-extended and double-extended precision formats are not common.
Figure 1.1 shows the basic constituent parts of the single- and double-precision formats. As shown in
the figure, the floating-point numbers, as represented using these formats, have three basic components
including the sign, the exponent and the mantissa. A ‘0’ denotes a positive number and a ‘1’ denotes
a negative number. The n-bit exponent field needs to represent both positive and negative exponent
values. To achieve this, a bias equal to 2
n−1
− 1 is added to the actual exponent in order to obtain the
stored exponent. This equals 127 for an eight-bit exponent of the single-precision format and 1023 for
an 11-bit exponent of the double-precision format. The addition of bias allows the use of an exponent
in the range from −127 to +128, corresponding to a range of 0–255 in the first case, and in the range
from −1023 to +1024, corresponding to a range of 0–2047 in the second case. A negative exponent
is always represented in 2’s complement form. The single-precision format offers a range from 2
−127
to 2
+127 , which is equivalent to 10
−38 to 10
+38 . The figures are 2
−1023 to 2
+1023 , which is equivalent to
10
−308 to 10
+308 in the case of the double-precision format.
The extreme exponent values are reserved for representing special values. For example, in the case
of the single-precision format, for an exponent value of −127, the biased exponent value is zero,
represented by an all 0s exponent field. In the case of a biased exponent of zero, if the mantissa is zero
as well, the value of the floating-point number is exactly zero. If the mantissa is nonzero, it represents
a denormalized number that does not have an assumed leading bit of ‘1’. A biased exponent of +255,
corresponding to an actual exponent of +128, is represented by an all 1s exponent field. If the mantissa
is zero, the number represents infinity. The sign bit is used to distinguish between positive and negative
infinity. If the mantissa is nonzero, the number represents a ‘NaN’ (Not a Number). The value NaN is
used to represent a value that does not represent a real number. This means that an eight-bit exponent
can represent exponent values between −126 and +127. Referring to Fig. 1.1(a), the MSB of byte 1
indicates the sign of the mantissa. The remaining seven bits of byte 1 and the MSB of byte 2 represent
an eight-bit exponent. The remaining seven bits of byte 2 and the 16 bits of byte 3 and byte 4 give a
23-bit mantissa. The mantissa m is normalized. The left-hand bit of the normalized mantissa is always
Table 1.1 Characteristic parameters of IEEE-754 formats.
Precision
Sign (bits) Exponent (bits) Mantissa (bits) Total length (bits) Decimal digits of precision
Single
1
8
23
32
> 6
Single-extended
1
≥ 11
≥ 32
≥ 44
> 9
Double
1
11
52
64
> 15
Double-extended
1
≥ 15
≥ 64
≥ 80
> 19
Précédent

- 36/741

Suivant