Académique Documents
Professionnel Documents
Culture Documents
As mentioned previously, all instructions for the FPC are of the F-line
format, that is, they begin with the bit pattern 1111(2). A generic coprocessor
instruction has the following format: the first four bits must be 1111. This
identifies the instruction as being for the coprocessor. The next three bits
identify the coprocessor type, followed by three bits representing the
instruction type. The meaning of the remaining bits varies depending on the
specific instruction.
Coprocessor Operation
When the MPU detects an F-line instruction, it writes the instruction
into the coprocessors memory mapped command register in CPU space.
Having sent a command to the coprocessor, the host processor reads the
reply from the coprocessor's response register. The response could, for
example, instruct the processor to fetch data from memory. Once the host
processor has complied with the demands from the coprocessor, it is free to
continue with instruction processing, that is, both the processor and
coprocessor act concurrently. This is why system speed can be dramatically
improved upon installation of a coprocessor.
MC 68882 Specifics
The MC 68882 floating point coprocessor is basically a very simple
device, though it's data manual is nearly as thick as that of the MC 68000.
This complexity is due to the IEEE floating point arithmetic standards rather
than the nature of the FPC. The 68882 contains eight 80-bit floating point
data registers, FP0 to FP7, one 32-bit control register, FPCR, and one 32-bit
status register, FPSR. Because the FPC is memory mapped in CPU space,
these registers are directly accessible to the programmer within the register
space of the host MPU. In addition to the standard byte, word and longword
operations, the FPC supports four new operand sizes: single precision real
(.S), double precision real (.D), extended precision real (.X) and packed
decimal string (.P). All on-chip calculations take place in extended precision
format and all floating point registers hold extended precision values. The
single real and double real formats are used to input and output operands.
All three real floating point formats comply with the corresponding IEEE
floating point number standards. The FPC has built in functions to convert
between the various data formats added by the unit, for example a register
move with specified operand type (.P, .B, etc).
The 68882 FPC has a significant instruction set designed to satisfy
many number-crunching situations. All instructions native to the FPC start
with the bit pattern 1111(2) to show that the instruction deals with floating
point numbers. Some instructions supported by the FPC include FCOSH,
FETOX, FLOG2, FTENTOX, FADD, FMUL and FSQRT. There are many
more instructions available, but this excerpt demonstrates the versatility of
the 68882 unit.
One of the registers within the FPC is the status register. It is very
similar in function to the status register in a CPU; it is updated to show the
outcome of the most recently executed instruction. Flags within the status
register of the FPC include divide by zero, infinity, zero, overflow,
underflow and not a number. Some of the conditions signaled by the status
register of the FPC (for example divide by zero) require an exception routine
to be executed, so that the user is informed of the situation. These exceptions
are stored and executed within the host MPU, which means that the FPC can
be used to control loops and tests within user programs - further extending
the functionality of the coprocessor.
Intel Math Coprocessor 80387 DX
In many respects, the Intel 80387 math coprocessor (MCP) is very
similar to the MC 68882. Both designs were influenced by such factors as
cost, usability and performance. There are, however, subtle differences in
the designs of the two units.
Firstly, I shall discuss the similarities between the designs followed b
y
differences. Like the 68882, the 80387 requires no additional hardware to be
connected to a 80386. It is a non-DMA device, having no direct access to the
address bus of the motherboard. All memory and I/O is handled by the CPU,
which upon detection of a MCP instruction passes it along to the MCP. If
additional memory reads are necessary to load operands or data, the MCP
instructs the CPU to perform these actions. This design, although reducing
MCP performance when compared to a direct connection to the address bus,
significantly decreases complexity of the MCP as no separate address
decoding or error handling logic is necessary. The connection between the
CPU and the MCP instruction is via a synchronous bus, while internal
operation of the MCP can run asynchronously (higher clockspeed).
Moreover, the three functional units of the MCP can work in parallel to
increase system performance. The CPU can be transferring commands and
data to the MCP bus control logic while the MCP floating unit is executing
the current instruction. Similar to the 68882, the 80387 has a bit pattern
(11011(2)) reserved to identify instructions intended for it. Also, the register
s
of the MCP are memory mapped into CPU address space, making the
internal registers of the MCP available to programmers.
Internally, the 80387 contains three distinct units: the bus
control logic (BCL), the data interface and control unit and the actual
floating point unit. The data interface and control unit directs the data to the
instruction decoder. The instruction decoder decodes the ESC instructions
sent to it by the CPU and generates controls that direct the data flow in the
instruction buffer. It also triggers the microinstruction sequencer that
controls execution of each instruction. If the ESC instruction is FINIT,
FCLEX, FSTSW, FSTSW AX, or FSTCW, the control unit executes it
independently of the FPU and the sequencer. The data interface and control
unit is the unit that generates the BUSYÝ, PEREQ and ERRORÝ signals
that synchronize Intel 387 DX MCP activities with the Intel 80386 DX CPU.
It also supports the FPU in all operations that it cannot perform alone (e.g.
exceptions handling, transcendental operations, etc.).
The FPU executes all instructions that involve the register stack,
including arithmetic, logical, transcendental, constant, and data transfer
instructions. The data path in the FPU is 84 bits wide (68 significant bits, 15
exponent bits, and a sign bit) which allows internal operand transfers to be
performed at very high speeds.
Interface
The MCP is connected to the MPU via a synchronous connection,
while the numeric core can operate at a different clock speed, making it
asynchronous. The following diagram will clarify this.