OVERVIEW OF NUMERIC PROCESSING
The instruction address saved
in
the 80287 will point to any prefixes that preceded the instruction.
This
is
different from the 8087, for which the instruction address pointed only to the ESC instruction
opcode.
COMPUTATION
FUNDAMENTALS
This section covers 80287 programming concepts
that
are common to all applications.
It
describes the
80287's internal number system and the various types of numbers that can be employed in
NPX
programs. The most commonly used options for rounding, precision, and infinity (selected by fields in
the control word) are described, with exhaustive coverage of less frequently used facilities deferred to
later sections. Exception conditions
that
may arise during execution of
NPX
instructions are also
described along with the options
that
are available for responding to these exceptions.
Number System
The system of real numbers that people use for pencil and paper calculations
is
conceptually infinite
and continuous. There
is
no
upper or lower limit to the magnitude of the numbers one can employ in a
calculation, or to the precision (number of significant digits) that the numbers can represent. When
considering any real number, there
is
always an infinity of numbers both larger and smaller. There
is
also an infinity of numbers between (i.e., with more significant digits than) any two real numbers. For
example, between
2.5
and 2.6 are 2.51,2.5897,2.500001, etc.
While ideally it would be desirable for a computer to be able to operate
on
the entire real number
system, in practice this
is
not possible. Computers,
no
matter
how
large, ultimately have fixed-size
registers and memories that limit the system of numbers that can be accommodated. These limitations
determine both the range and the precision of numbers. The result
is
a set of numbers that
is
finite
and discrete, rather than infinite and continuous. This sequence
is
a subset of the
r~al
numbers that
is
designed to form a useful approximation of the real number system.
Figure
1-8
superimposes the basic 80287 real number system
on
a real number line (decimal numbers
are shown for clarity, although the
80287 actually represents numbers in binary). The dots indicate the
subset of real numbers the
80287 can represent
as
data and final results of calculations. The 80287's
range
is
approximately ±4.19XlO·307 to
±1.67X10
308
. Applications that are required to deal with
data and final results outside this range are rare. For reference, the range of the IBM
370
is
about
±0.54X10·
78
to ±0.72X1076.
The finite spacing in figure
1-8
illustrates
that
the
NPX
can represent a great many, but not all, of the
real numbers in its range. There
is
always a gap between
two
adjacent 80287 numbers, and it
is
possible
for the result of a calculation to fall in this space. When this occurs, the
NPX
rounds the true result
to a number
that
it can represent. Thus, a real number that requires more digits than the 80287 can
accommodate (e.g., a
20-digit number)
is
represented with some loss of accuracy. Notice also
that
the
80287's representable numbers are not distributed evenly along the real number line. In fact, an equal
llulliber of representable
!!umb~r~
p.xists
between successive powers of 2 (i.e., as many representable
numbers exist between 2 and 4 as between 65,536 and
131,072). Therefore, the gaps between repre-
sentable numbers are larger as the numbers increase in magnitude. All integers
in
the range ± 2
64
(approximately ±
10
18
), however, are exactly representable.
In
its internal operations, the 80287 actually employs a number system that
is
a substantial superset of
that
shown in figure
1-8.
The internal format (called temporary real) extends the 80287's range to
about ± 3.4X
10-4932
to ± 1.2X
10
4932
, and its precision to about
19
(equivalent decimal) digits. This
format
is
designed to provide extra range and precision for constants and intermediate results, and
is
not normally intended for data or final results.
1-14