The 8086/8088 can operate on integers of only 16 bits, with a range from
- 2^15 to 2^15 - 1.In addition to the word integer format, the 8087 allows
integer operands to be represented using 32 bits (short integer) and 64 bits
(long integer).Negative integers are coded in 2's complement form.The greater
number of bits significantly extends the ranges of integers to - 2^31 through
2^31 - 1 for the short integer format and - 2^63 through 2^63 - 1 for the long
integer format.This is roughly ± 2 x 10^9 and ± 9 x 10^18, respectively.
In the packed BCD format, a decimal number is stored in 10 bytes.The entire
most significant byte is dedicated to the sign.The most significant bit of
this byte indicates whether a decimal number is positive (0) or negative (1).
The remaining 9 bytes represent the magnitude with two BCD digits packed into
each byte.Therefore, the valid range of values in the packed BCD format is
- 10^18 + 1 to 10^18 - 1.
The real data types, also called the floating point types, can represent
operands which may vary from extremely small to extremely large values and
retain a constant number of significant digits during calculations.A real
data format is divided into three fields: sign, exponent and mantissa, i.e.,
X = ± 2^exp x mantissaThe exponent adjusts the position of the binary point in the mantissa. Decreasing the exponent by 1 moves the binary point to the right by one position.Therefore, a very small value can be represented by using a negative exponent without losing any precision.However, except for numbers whose mantissa parts fall within the range of the format, a number may not be exactly representable, thus causing a roundoff error.If leading 0s are allowed, a given number may have more than one representation in a real number format.But since there are a fixed number of bits in the mantissa, leading 0s increase the roundoff error.Therefore, in order to minimize the roundoff errors, after each calculation the 8087 deletes the leading 0s by properly adjusting the exponent.A nonzero real number is said to be normalized when its mantissa is in the form of 1.F, where F represents a fraction.
(- 1)^S x 2^(E-127) x 1.Fwhere S is the sign bit.Because the 1 appearing before the fraction is always present, it is implied and is not physically stored.For example, suppose that a short real number is stored as follows:
0 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 0 . . . 0 = 41360000
| ~~~~~~v~~~~~~ ~~~~~~~~~~~~~~v~~~~~~~~~~
Sign Biased Fraction
exponent
Then the true exponent is 130 - 127 = 3 and the floating point number being
represented is
+1.011011 x 2³ = 1 x 2³ + 1 x 2¹ + 1 x 2° + 1 x 2² + 1 x 2³ = 11.375
To illustrate the conversion of a real number to its short real form, consider
the number 20.59375.First, one should convert the integral and fractional parts
to binary as follows:
10100 + .10011 = 10100.10011After normalizing this number by moving the binary point until it is between the first and second bits, it is written:
1.010010011 x 2^4From this form it is seen that
S = 0, E = 127 + 4 = 131 = 10000011 and F = 010010011and the short real format of the number is:
0 1 0 0 0 0 0 1 1 0 1 0 0 1 0 0 1 1 0 . . . 0 = 41A4C000
~~~~~~v~~~~~~~~ ~~~~~~~~~~~~v~~~~~~~~~~~~~~
Biased Fraction
exponent
For the short real data type, the valid range of the biased exponent is
0 < E < 255.Consequently, the numbers that can be represented are from
±2^-126 to ±2^128, aproximately ±1 x 10^-38 to ±3 x 10^38.
| PRETHODNA FOLIJA | SADRZAJ | SLEDECA FOLIJA |