Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

3/25/2024

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 1

QUIZ
1) Give 2-examples for each of the following:
A. New instructions not found in 8086.
B. 386-developed registers.
C. 64-bit Pentium developed registers.
D. 386-New registers.
E. 64-bit Pentium registers.

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 2

1
3/25/2024

The Math Co-processors


(80X87)

Part1
Introduction
Data Format
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 3

Dr. Mazin H. Aziz 2nd-Class Microprocessor 4


3/25/2024

2
3/25/2024

Introduction to the Arithmetic Coprocessor 80x87


➢ The Intel family of arithmetic coprocessors includes the 8087, 80287, 80387SX, 80387DX, and
the 80487SX for use with the 80486SX microprocessor.
➢ The 80486DX–Core2 microprocessors contain their own built-in arithmetic coprocessors.
➢ The instruction sets and programming for all devices are almost identical; the main difference
is that each coprocessor is designed to function with a different Intel microprocessor.
➢ The family of coprocessors, which is labeled the 80X87, can multiply, divide, add, subtract,
find the square root, and calculate the partial tangent, partial arctangent, and logarithms.
➢ Data types include 16, 32, and 64-bit signed integers; 18-digit BCD data; and 32, 64, and 80-
bit floating-point numbers.
➢ The operations performed by the 80X87 generally execute many times faster than equivalent
operations written with the most efficient programs that use the microprocessor’s normal
instruction set.
➢ The Pentium Pro through Core2 coprocessors are similar in performance to the Pentium
coprocessor, except that a few new instructions have been added: FCMOV and FCOMI.
Dr. Mazin H. Aziz 2nd-Class Microprocessor 3/25/2024 5

Introduction to the Arithmetic Coprocessor 80x87 (cont.)


➢ Microprocessor and coprocessor compatibility.

Dr. Mazin H. Aziz 2nd-Class Microprocessor 3/25/2024 6

3
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR


➢ Data types include 16-, 32-, and 64-bit signed integers; 18-digit BCD data; and 32-, 64-, and
80-bit floating-point numbers.

DATA FORMATS

Signed Integer Signed BCD Floating Point


16-bit (Word )
18-Digit 32-bit
32-bit
(Double Word) 64-bit
64-bit 80-bit
(Quad Word)
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 7

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


➢ Positive numbers are stored in true form with a leftmost sign-
Signed Integer bit of 0, and negative numbers are stored in two’s complement
form with a leftmost sign-bit of 1.
Sign Bit −32,768

16-bit (word )
-32,768 to +32,767
Sign Bit −2,147,438,648

32-bit
(doubleword)
±2 ×109
64-bit
Sign Bit

(quadword integer)
±9 ×1018 3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 8

4
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Signed BCD The 80 Bit Packed 18-Digit + Sign
Decimal Integer 9-Bytes + Sign Byte

Bit
(BCD) (80-bits)
Bit

Byte(10) Byte(9) Byte(1)

➢ Byte(10) = 00h for the positive numbers


(Example: 10h=00 00 00 00 00 00 00 00 00 10h)
➢ Byte(10) = 80h for the negative numbers 3/25/2024
(Example: -10h=80 00 00 00 00 00 00 00 00 10h) Dr. Mazin H. Aziz 2nd-Class Microprocessor 9

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)

Floating Point (The Scientific Notation of the Fixed Point)


➢ A fixed-point number, is a positive or negative whole number with a decimal
point.
➢ For example, 5.5, 0.25, and -103.342 are all fixed-point numbers, while 91, and
0 are not.
➢ Fixed-point numbers are often called real numbers because they hold signed
integers, fractions, and mixed numbers and can be written as floating-point
numbers using the scientific notation.
➢ For example, the Scientific Notation for the decimal number 24 239.58 is:
2. 423958 X 104 Exponent
➢ Mantissa and Exponent: 2.3423958 X 10 4

Mantissa Dr. Mazin H. Aziz 2nd-

➢ An
3/25/2024
example of a scientific notation binary is: Class Microprocessor
1
0

10

5
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)

Floating Point in Binary (IEEE-754 standard)


➢ A floating-point number has three parts: a Sign-bit, a Biased Exponent, and a
Significand also called (Mantissa).
➢ Floating-point numbers are written in Scientific Binary Notation.
➢ The Intel family of arithmetic coprocessors supports three types of floating-
point numbers: single (32 bits), double (64 bits), and temporary (80 bits).
➢ The Biased exponent = Bise + Exponent.
➢ The Bise for the (32-bit) value= 127 and the Bise for the (64-bit) value= 1023

Mantissa or Significand

3/25/2024 1
Dr. Mazin H. Aziz 2nd-Class Microprocessor 1

11

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)

Floating Point in Binary (IEEE-754 standard)


➢ The double Precision (64 bits).

➢ Comparison between the Single Precision (32-bit) and the Double Precision
(64-bit).
BIASED NORMALISED
TYPES SIGN BIAS
EXPONENT MANTISA

Single precision 1(31st bit) 8(30-23) 23(22-0) 127


Double precision 1(63rd bit) 11(62-52) 52(51-0) 1023
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 12

12

6
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)

Floating Point in Binary (IEEE-754 standard)

➢ 32 Bit Single
Precision Floating
Point Format.

➢ 64 Bit Double
Precision Floating
Point Format.

➢ 80 Bit Extended
Precision Floating
Dr. Mazin H. Aziz 2nd-Class
Point Format. 3/25/2024
Microprocessor
13

13

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary

➢ Example1: Convert the Number (- 4.40625) to a floating-point number using


the scientific binary notation in (a)single precision and (b) double precision.
1) Find the binary equivalent for both sides of the decimal point.
4 = 100 , 0. 40625 = 01101 , 4.40625 = 100. 01101
2) Normalize the number & find the Sign–bit:
100.01101 = 1.0001101 x 22 , sign-bit = 1
Exponent
1
2

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 14

14

7
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary
➢ Example1(cont.): Convert the Number (- 4.40625) to a floating-point number.
Exponent
(a) The single precision (32-bit) for (-4.40625 = 1.0001101 x 22 ):
1) Biased Exponent = 127+2 = 129 , 129 = 10000001
2) Normalized Mantissa = 0001101 add 0s to the right to complete the 23 bits
3) The IEEE 754 Single precision is: 1 10000001 00011010000000000000000
4) This can be written in hexadecimal form as: C08D0000h.

1 10000001 00011010000000000000000
1100 0000 1000 1101 0000 0000 0000 0000 = C08D0000h 15
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor

15

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)

Conversion from Decimal to Floating-Point Binary


➢ Example1(cont.): Convert the Number (- 4.40625) to a floating-point number.
(b) for the double precision (64-bit):
1) Biased exponent = 1023+2 = 1025 , 1025 = 10000000001
2) Normalized Mantissa = 0001101 add 0s to the right to complete the 52 bits
3) The IEEE 754 Single precision is:
1 10000000001 0001101000000000000000000000000000000000000000000000
2) This can be written in hexadecimal form C01A000000000000h

1 10000000001
000110100000000000000000000000000000000000000000000016
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor

16

8
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary
➢ Example2: Convert the Number (85.125) to a floating-point number using the
scientific binary notation in (a)single precision and (b) double precision.
1) Find the binary equivalent for both sides of the decimal point.
85 = 1010101 , 0.125 = 001 , 85.125 = 1010101.001
2) Normalize the number & find the Sign –bit:
1010101.001 = 1.010101001 x 26 , sign-bit = 0
(a) for the single precision (32-bit):
1) Biased exponent = 127+6 = 133 , 133 = 10000101
2) Normalized Mantissa = 010101001 add 0s to the right to complete the 23 bits
3) The IEEE 754 Single precision is: 0 10000101 01010100100000000000000
4) This can be written in hexadecimal form 42AA4000h
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 17

17

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary
➢ Example2 (cont.): Convert the Number (85.125) to a floating-point number.
(b) for the double precision (64-bit):
1) Biased exponent = 1023+6 = 1029 , 1029 = 10000000101
2) Normalized Mantissa = 010101001 add 0s to the right to complete the 52 bits
3) The IEEE 754 Single precision is:
0 10000000101 0101010010000000000000000000000000000000000000000000
2) This can be written in hexadecimal form 4055480000000000h

0 10000000101
010101001000000000000000000000000000000000000000000018
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor

18

9
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary
➢ Example3: Convert the Number (0.75) to a floating-point number using the
scientific binary notation in (a)single precision and (b) double precision.
1) Find the binary equivalent for both sides of the decimal point.
0=0, 0.75 = 11 , 0.75 = 0.11
2) Normalize the number & find the Sign –bit:
0.11 = 1. 1 x 2-1 , sign-bit = 0
-1
(a) for the single precision (32-bit):
1) Biased exponent = 127+(-1) = 126 , 126 = 01111110
2) Normalized Mantissa = 1 add 0s to the right to complete the 23 bits
3) The IEEE 754 Single precision is: 0 01111110 10000000000000000000000
4) This can be written in hexadecimal form 3F400000h
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 19

19

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Decimal to Floating-Point Binary
➢ Example3 (cont.): Convert the Number (0.75) to a floating-point number.
(b) for the double precision (64-bit):
1) Biased exponent = 1023+(-1) = 1022 , 1022 = 01111111110
2) Normalized Mantissa = 1 add 0s to the right to complete the 52 bits
3) The IEEE 754 Single precision is:
0 01111111110 1000000000000000000000000000000000000000000000000000
2) This can be written in hexadecimal form 3FE8000000000000h

0 01111111110
100000000000000000000000000000000000000000000000000020
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor

20

10
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Binary to Floating-Point Decimal
➢ Example1: Convert the Single Precision scientific floating-point Number
1 1000 0000 0100 0000 0000 0000 0000 000 to Decimal.
1) Separate the sign-bit, biased exponent, and mantissa.
sign-bit = 1 , biased exponent = 1000 0000 , & mantissa = 010…..

2) Convert the biased exponent into a true exponent by subtracting the bias.
true exponent= biased exponent – 127 = 1000 0000 – 0111 1111 = 1
3) Write the number as a normalized binary number.
normalized binary number = (-1)S X 1.mantissa X 2 true exponent = -1 X 1.01 X 21
= -1.01 X 21
4) Convert it to a fixed-point binary form. -1.01 X 21 = -10.1
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 21

21

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Binary to Floating-Point Decimal
➢ Example1 (cont.): Convert the Single Precision scientific floating-point Number
1 1000 0000 0100 0000 0000 0000 0000 000 to Decimal.

5) Finally Convert the fixed-point binary number to decimal.


= - 10.1 = - 2.5

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 22

22

11
3/25/2024

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Binary to Floating-Point Decimal
➢ Example2: Convert the Single Precision scientific floating-point Number
0 1000 0010 0100 0000 0000 0000 0000 000 to Decimal.
1) Separate the sign-bit, biased exponent, and mantissa.
sign-bit = 0 , biased exponent = 1000 0010 , & mantissa = 010…..

2) Convert the biased exponent into a true exponent by subtracting the bias.
true exponent= biased exponent – 127 = 1000 0010 – 0111 1111 = 3
3) Write the number as a normalized binary number.
normalized binary number = (-1)S X 1.mantissa X 2 true exponent = 1 X 1.01 X 23
= 1.01 X 23
4) Convert it to a fixed-point binary number. 1.01 X 23 = 1010.0
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 23

23

DATA FORMATS FOR THE ARITHMETIC COPROCESSOR (cont.)


Conversion from Binary to Floating-Point Decimal
➢ Example2 (cont.): Convert the Single Precision scientific floating-point Number
0 1000 0010 0100 0000 0000 0000 0000 000 to Decimal.

5) Finally Convert the fixed-point binary number to decimal.


= 1010.0 = 10.0

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 24

24

12
3/25/2024

HOMEWORK-1
1. Find the scientific floating-point binary in both single precision
and double precision forms for the following decimal numbers.
A. 17.75
B. - 25.125
C. 130.5
D. 260.25

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 25

25

HOMEWORK-1
2. Convert the following single precision scientific floating-point
binary numbers to decimal.
A. 1 1010 0110 0110 0000 0000 0000 0000 000
B. 1 1010 0101 0110 1000 0000 0000 0000 000
C. 0 1001 0110 0110 0100 0000 0000 0000 000
D. 0 1000 1110 0111 1000 0000 0000 0000 000

3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 26

26

13
3/25/2024

THE END
3/25/2024 Dr. Mazin H. Aziz 2nd-Class Microprocessor 27

27

14

You might also like