02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Representation of Numbers 263<br />

For the negative numbers we have the same formats as the fixed-point<br />

representations, including the 10s-complement format.<br />

The number of digits used in the exponent determine the range of<br />

representable numbers, whereas the number of digits used in the mantissa<br />

determine the precision of the numbers. For example, if the mantissa is<br />

expressed using 2 digits plus the sign, and the exponent is expressed using<br />

2 digits plus the sign, then the real number line will be covered as:<br />

99 -99 -99 99<br />

-9.99x10 -1.0x10 0 1.0x10 9.99x10<br />

----------+-------------+-----------+-----------+-------------+-----------><br />

| accessible | 0 | accessible |<br />

negative | negative | negative | positive | positive | positive<br />

overflow | numbers | underflow | underflow | numbers | overflow<br />

The range of accessible floating-point numbers with a given representation<br />

can be large, but it is still finite. In the preceding example (e.g., with 2 digits<br />

for the mantissa and 2 digits for the exponent), there are only 9 × 10 ×<br />

10×199 = 179, 100 positive numbers, and as many negative numbers, plus<br />

the number zero, for a total of 358,201 numbers that can be represented.<br />

Binary numbers Although the fraction-only fixed-point arithmetic<br />

does not have any overflow problems when two numbers are multiplied, it<br />

does suffer from overflow problems when two numbers are added. Also, the<br />

fixed-point numbers have limited dynamic range. Both of these aspects<br />

are unacceptable for an intensive computational job. These limitations<br />

can be removed by making the binary point floating rather than fixed.<br />

The floating-point bit arrangement for binary-number representation<br />

is similar to that for the decimal numbers. In practice, however, two exceptions<br />

are made. The exponent is expressed using L-bit excess-2 L−1<br />

format, and the B-bit normalized mantissa is a fractional number with<br />

a1following the binary point. Note that the sign bit is the MSB of the<br />

bit pattern. Thus the B-bit mantissa and L-bit exponent (for a total of<br />

B + L +1word length) bit pattern is given by (note the reversal of the<br />

mantissa exponent places)<br />

ˆx =<br />

Sign of M<br />

↓<br />

± xx ···x<br />

} {{ }<br />

L-bit E<br />

<br />

1x ···x<br />

} {{ }<br />

B-bit M<br />

(6.42)<br />

where exponent E is adjusted so that we have a normalized mantissa—<br />

that is, 1/2 ≤ M

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!