COPROCESSOR 8087

Er. AMIT MAHAJAN

OVERVIEW OF COPROCESSOR 8087
‡ ‡ ‡ ‡

‡ ‡

‡ ‡

MICROPROCESSOR IS DEFINED AS CENTRAL PROCESSING UNIT ON A SINGLE IC. ADDRESS BUS IS ONE THAT CARRIES THE ADDRESS OF THE MEMORY LOCATION THAT THE CPU WANTS TO ACCESS. DATA BUS IS ONE THAT IS USED TO TRANSFER DATA BETWEEN THE PROCESSOR ,MEMORY AND I/O DEVICES. CONTROL BUS IS ONE THAT IS USED TO CARRY THE NECESSARY CONTROL SIGNALS BETWEEN THE PROCESSOR, MEMORY AND I/O DEVICES. CO MEANS TOGETHER OR ASSOCIATE IN AN ACTIVITY COPROCESSOR IS A COMPUTER PROCESSOR USED TO SUPPLEMENT THE FUNCTIONS OF THE PRIMARY PROCESSOR(CPU) TWO OR MORE PROCESSORS CAN DIRECTLY SHARE THE ADDRESS,DATA AND CONTROL BUSES. PROCESSORS WHICH CAN SHARE THE LOCAL BUSES ARE REFERRED TO AS COPROCESSORS.

SOME POINTS ABOUT 8087
‡ ‡ ‡ ‡ ‡ ‡

‡

‡ ‡

THIS WAS THE FIRST MATH COPROCESSOR FOR 16 BIT PROCESSORS DESIGNED BY INTEL. I8231 WAS OLDER BUT DESIGNED FOR THE 8 BIT INTEL 8080. IT WAS BUILT TO BE PAIRED WITH THE INTEL 8088 AND 8086 MICROPROCESSORS. THIS COPROCESSOR INTRODUCED ABOUT 60 NEW INSTRUCTIONS AVAILABLE TO THE PROCESSOR. REQUIREMENT OF 8087 COPROCESSOR: THE INSTRUCTION SET OF GENERAL PURPOSE PROCESSORS SUCH AS 8086 IS NOT OPTIMIZED TO DO COMPLEX NUMERICAL CALCULATIONS,CRT GRAPHICS MANIPULATIOS OR WORD PROCESSING. ALSO THESE GENERAL PURPOSE PROCESSORS HAVE LIMITED MATHEMATICAL PROCESSING CAPABILITY SUCH AS ADDITION, SUBSTRACTION, MULTIPLICATION AND DIVISION. THEY DO NOT EVALUATE TRIGNOMETRIC ,LOGARITHMIC AND EXPONENTIAL FUNCTIONS. THESE FUNCTIONS CAN BE EVALUATED EITHER BY SOFTWARE SUBROUTINES(SMALL PROGRAM FOR A PARTICULAR TASK) OR BY IN CORPORATING ADDITIONAL HARDWARE CIRCUITRY IN THE COMPUTER SYSTEM.

y

y y

y

ALSO IN MANY MICROCOMPUTER PROGRAMS SUCH AS THOSE USED FOR SCIENTIFIC RESEARCH, ENGINEERING ETC WE OFTEN REQUIRE TO CALCULATE THE TANGENT, LOG OF A NUMBER. ALSO SOMETIMES IT IS REQUIRED TO DO ARITHEMETIC OPERATIONS ON VERY LARGE NUMBERS AND ON VERY SMALL NUMBERS. THERE ARE SEVERAL WAYS TO DO THIS. SEVERAL WAYS ARE: FIRST WAY IS TO WRITE THE NUMBER CRUNCHING( THE PROCESS OF CALCULATING NUMBERS ESPECIALLY WHEN LARGE AMOUNT OF DATA IS INVOLVED AND THE DATA IS TO BE PROCESSED IN A SHORT SPACE OF TIME) PART OF THE PROGRAM IN A HIGH LEVEL LANGUAGE SUCH AS FORTRAN,COMPILE THIS PART OF THE PROGRAM AND LINK IN I/O MODULES WRITTEN IN ASSEMBLY LANGUAGE. BUT THE PROBLEM WITH THIS APPROACH IS THAT THE PROGRAMS WRITTEN IN HIGH LEVEL LANGUAGES TEND TO RUN CONSIDERABLY SLOWER THAN THE PROGRAMS WRITTEN IN THE ASSEMBLY LANGUAGE.

y

y

y

y

y

ALSO ANOTHER APPROACH IS TO BUY A LIBRARY OF FLOATING POINT ARITHMETIC OBJECT MODULES FROM THE MANUFACTURER OF THE PROCESSOR. THEN IN THE PROGRAM YOU JUST DECLARE THE PROCEDURE NEEDED FROM THE LIBRARY AS EXTERNAL , CALL THE PROCEDURE AS REQUIRED AND LINK THE LIBRARY TO THE OBJECT CODE OF THE PROGRAM. THIS APPROACH SAVES THE LABOUR OF WRITING ALL THE PROCEDURES. BUT WHERE CALCULATIONS NEED TO BE DONE AS QUICKLY AS POSSIBLE THEN ALL THESE APPROACHES DON¶T WORK . TO SOLVE THE ABOVE STATED PROBLEM WE NEED SPECIAL PROCESSORS WHICH HAVE ARCHITECTURE AND INSTRUCTION SET OPTIMIZED FOR NUMBER CRUNCHING AND THIS IS WHERE WE NEED COPROCESSORS. 8087 IS USED IN PARALLEL WITH THE MAIN PROCESSOR IN THE SYSTEM ,RATHER THAN SERVING AS A MAIN PROCESSOR ITSELF SO THE NAME IS COPROCESSOR. THE MAJOR PRINCIPLE HERE IS THAT THE MAIN PROCESSOR ,8086,HANDLES THE GENERAL PROGRAM EXECUTION AND THE 8087 COPROCESSORHANDLES THE SPECIALIZED MATHEMATICAL COMPUTATIONS

‡

‡

‡ ‡

‡ ‡ ‡ ‡ ‡

‡

TO DIFFERENTIATE THE INSTRUCTIONS USED FOR 8087 HERE ALL THE MNEMONICS BEGINS WITH ³F´. FOR EXAMPLE ,IN CONTRAST TO ADD/MUL ,IN 8087 THERE IS FADD/FMUL. THIS MATH COPROCESSOR CAN BE INCORPORATEDIN A COMPUTER SYSTEM EITHER AS AN I/O DEVICE OR AS AN EXTENSION TO THE CPU. IF IT IS CONNECTED AS AN I/O DEVICE IT IS CALLED AS PERIPHERAL MATH PROCESSOR. A PERIPHERAL PROCESSOR CAN BE USED WITH ANY HOST CPU WHEREAS A COPROCESSOR IS DESIGNED FOR A PARTICULAR FAMILY OF CPU¶S. EXAMPLES OF MATH COPROCESSORS ARE 8087,80287,80387 ETC THE MATH COPROCESSOR IS ALSO CALLED F.P.U(FLOATING POINT UNIT). THE 486,PENTIUM,PENTIUM PRO,PENTIUM II ETC CONTAIN THE FPU WITHIN THE MICROPROCESSOR CHIP. FEATURES OF 8087: IT CAN PROCESS 16,32,64 BIT INTEGERS; 32,64,80 FLOATING POINT; 18 DIGIT BCD OPERANDS. IT HAS THE CAPABILITY TO CONTROL THE ROUND OFF,UNDERFLOW,OVERFLOW ERRORS IN THE CALCULATIONS. THE ARITHEMETIC ,EXPONENTIAL TRIGNOMETRIC ETC FUNCTIONS ARE EVALUATED BY BUILT IN HARDWARE CIRCUIT.

CONSTRUCTIONAL DETAILS
y y

IT CONTAINS EIGHT 80 BIT DATA REGISTERS. IN ADDITION TO THESE DATA REGISTERS IT ALSO CONTAINS SOME 16 BIT SPECIAL PURPOSE REGISTERS SUCH AS STATUS REGISTER,CONTROL REGISTER,TAG WORD,INSTRUCTION POINTER AND DATA POINTER. INTERNAL ARCHITECTURE OF 8087

y

CONTROL WORD FORMAT

STATUS WORD FORMAT

EXPLANATION OF CONTROL WORD AND STATUS WORD REGISTER
y y y y y y y y y y y y y y

BOTH ARE OF 16 BIT. CONTROL WORD REGISTER: 0 BIT IS FOR INVALID OPERATION 1 BIT IS FOR DENORMALIZED OPERAND 2 BIT FOR ZERO DIVIDE 3 BIT FOR OVERFLOW 4 BIT FOR UNDERFLOW 5 BIT FOR PRECISION NEXT BIT IS RESERVED 7 BIT FOR INTERRUPT ENABLE MASK NEXT TWO BITS ARE FOR PRECISION CONTROL NEXT TWO FOR ROUNDING CONTROL NEXT TWO FOR INFINITY CONTROL AND THE LAST THREE ARE RESERVED

STATUS WORD FORMAT
y y y y y y y y

1 TO 6 BIT ARE SAME HERE NEXT IS FOR INTERRUPT REQUEST 8,9,10,14 BIT ARE CONDITION CODE 11,12,13 FOR STACK TOP POINTER 15 FOR BUSY. THE VALUES OF STACK TOP POINTER: 000 REGISTER 0 IS STACK TOP SIMILARILY FOR REST i.e. 001,«««««..111

y

TO HOLD NUMBERS BEING WORKED ON , THE 8087 HAS A REGISTER STACK OF EIGHT ,80 BIT REGISTERS LABELED(0) TO (7) THESE REGISTERS ARE USED AS A LAST IN FIRST OUT STACK IN THE SAME WAY THE 8086 USES THE STACK THERE IS A 3 BIT STACK POINTER WHICH HOLDS THE NUMBER OF THE REGISTER WHICH IS THE CURRENT TOP OF THE STACK. WHEN THE 8087 IS INITIALIZED , THE 2 BIT STACK POINTER IN THE 808 IS LOADED WITH 000, SO REGISTER 0 IS THE TOP OF THE STACK. ONE POINT TO NOTE IS THAT IN THE 8087 INSTRUCTIONS THE REGISTER THAT IS CURRENTLY THE TOS IS REFERRED TO AS ST(0) OR SIMPLY ST. THE REGISTER JUST BELOW THIS IN THE STACK IS REFERRED TO AS ST(1). NOW LET US PUSH THREE NUMBERS ON THE STACK AFTER INITIALIZING, THEN THE REGISTER 101 IS TOS SO IT WILL BE REFERRED TO AS ST(0),110 AS ST(1),111 AS ST(2).

y y

y

y

y

How coprocessor works
y

The 8087 is a numeric data processor(NDP). It is basically made to work with 8086/8088 processors. It cannot fetch its instruction by own so its buses(address and data buses)are simply connected to the respective buses of the processor.Its instruction are recognized by the word F because each and every instruction of this coprocessor starts with the word F.this is how the main processor distinguishes between its own and the coprocessor instructions.(e.g.):FADD,FSUB,etc.this coprocessor has 8-registers eacch capable of storing 80-bit temporary real numbers. the BUSY pin of the coprocessor is connected to the main processor's TEST pin. This TEST pin is active low in nature. This is because the speed of operation of the coprocessor and the main processor is different. The coprocessor is initialized by loading it with the control word which gives the idea to the 8087 that which exceptions are to be ignored. Usually after the calculations the status word of the coprocessor is loaded to see which errors have

y

y

Sign up to vote on this title
UsefulNot useful