0
18kviews
Explain 8087 math co-processor and Usages
1 Answer
3
529views

Features of 8087:

  1. It is a high performance numeric co-processor.

  2. It can work on integer, decimal and real type numbers.

  3. It has an instruction set capable of doing complex arithmetic and trigonometric calculations.

  4. It follows IEEE floating-point standard.

Architecture of 8087:

The architecture of 8087 NDP is divided into control unit and numerical execution unit.

Control unit:

It receives all instructions for the numeric data processor (NDP).

Instructions involving the register stack are given to the numeric execution unit (NEU) while the control unit executes the remaining instructions.

Its main components area.

Instruction queue:

8087 maintains an instruction queue identical to that of the host processor (8086).

Any instruction having an ESC prefix is decoded and executed by the 8087, other instructions are ignored by it.

This queue is synchronized by monitoring the QS0 and QS1 lines.

Control word:

Control words are sent to 8087 by writing them to a memory location and having 8087 execute an instruction which reads in the control word from the memory.

The control word is shown in the figure below:

enter image description here

Status word:

To read the status word from an 8087, you have it execute an instruction which writes the status word to memory where you can read or check it with an 8086 instruction.

The status word is shown in the figure below:

enter image description here

Instruction pointer:

It mainly contains address of the ESC instruction. Its 32 bit complete composition is

  • 20 bits address of ESC instruction.

  • 11 bits out of the 16 bit instruction code (the other 5 bits being 11011 for ESC).

  • 1 bit is always 0.

Data pointer:

It mainly contains address of data. Its 32 bit complete composition is

  • 20 bits memory address of data.

  • 12 bits are always 0.

Numerical Execution Unit

Instructions involving the register stack are executed by the NEU.

It uses operands from the register stack

During arithmetic operations, 8087 handles exponents and mantissa separately. Example:

For addition, it will first compare and equalize the exponents by shifting and only then add the mantissa

Its main components are

Register stack:

8087 has eight 80 bit numeric data registers available to the programmer.

These registers operate in LIFO (Last in First Out) manner hence they are called as the register stack of 8087.

Each register is 80 bits as the data is stored internally in the temporary-real format.

The current top of the stack is called as ST (0) or simply ST and the subsequent registers are called ST (1), ST (2) etc.

8087 has a 3 bit stack pointer to hold the number of the register that is the current ST.

On initialization the stack pointer contains 000 i.e. Register (0) is the ST.

It is a circular stack i.e. after pushing 8 elements if we PUSH the 9th element it will overwrite on the 1st element itself.

After the first PUSH, SP is decremented by 1. Therefore, SP = 111 and hence the data is stored at register 7. So register 7 becomes ST (0).

During POP, data is read from top of stack and SP is incremented by 1. Therefore, SP = 000 so register 0 becomes ST (0).

Tag word:

8087 contains 2 tag bits for each stack register.

These tag bits indicate the type of number stored in the respective register.

As there are 8 registers, there is 2 x 8 = 16 tag bits called collectively as the Tag word.

When 8087 is initialized, tag word = FFFF (all 1s) as all registers are empty.

Tag bits Information
00 Normal number (non-zero finite)
01 Zero
10 Special number (NaN, Infinity or De-Normal)
11 Empty
Please log in to add an answer.