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 mantissa 
The 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.

Normally, a bias value is added to the true exponent so that the true exponent is actually the number in the exponent field minus the bias value.Using biased exponents allows two normalized real numbers of the same sign to be compared by simplycomparing the bytes from left to right as if they were integers.

The 8087 recognizes three real data types: short real, long real and temporary real.In the short real data format, the biased exponent E and the fraction F have 8 and 23 bits, respectively and the number is represented by the form:
                                  (- 1)^S x 2^(E-127) x 1.F
where 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.10011
After normalizing this number by moving the binary point until it is between the first and second bits, it is written:
                                    1.010010011 x 2^4
From this form it is seen that
      S = 0,      E = 127 + 4 = 131 = 10000011    and     F = 010010011
and 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.

A biased exponent of all 1s is reserved to represent infinity or "not-a-number" (NAN).At the other extreme, a biased exponent of all 0s is used to represent +0 (all 0s with + sign), or a denormal.A denormal is a result that causes an underflow and has leading 0s in the mantissa even after the exponent is adjusted to its smallest possible value.NANs and denormals are normally used to indicate overflows and underflows, respectively, although they may be used for other purposes.

The long real format has 11 exponent bits and 52 fraction bits.As with the short real format, the first nonzero bit in the mantissa is implied and not stored.The range of representable nonzero quantities is extended to approximately ±10^-308 to ±10^308.As a comparison the range of nonzero real numbers for the IBM 370 real format is ±10^-78 to ±10^76.

The 8087 internally stores all numbers in the temporary real format which uses 15 bits for the exponent and 64 bits for the mantissa.Unlike the short and long real formats, the most significant bit in the mantissa is actually stored.Because of the extended precision (19 to 20 decimal digits), integer and packed BCD operands can be operated on internally using floating point arithmetic and still yield exact results.A primary reason for using the temporary real format for internal. . .

PRETHODNA FOLIJA SADRZAJ SLEDECA FOLIJA