Docsity

CS3220 Processor Design Homework 3 - SRT Division Error and Floating Point Format - Prof. , Assignments of Computer Science

Toggle sidebar
bg1
Homework 3
Prof. Loh
CS3220 - Processor Design - Spring 2005
Handed Out: 10 Feb 2005
Due: 22 Feb 2005
1. SRT Division
In the Intel Pentium “FDIV” bug, five entries in the SRT lookup table were removed. This effectively set the entries
to zero when they should have contained 2’s. Consider the region of the table between Rk
D=4
3and 5
3where the table
could return either 2 or 1 and still result in a correct answer. In the version of the SRT algorithm that we covered in
class, we divided this region such that any entry above the midpoint (Rk
D=3
2) returns a value of 2, and any entry below
returns 1.
Let us suppose that the engineer in charge of the SRT lookup table is not good at plotting straight lines, and ends up
using a line that is slightly “higher” than Rk
D=3
2(shown as a bold line in the figure below – the “correct” line would
have terminated slightly lower where the dash-dot horizontal line hits the end of the table). That is, he uses the line
Rk
D=3
2+ ∆ (see the figure below). How would this affect the correctness of the divider? Assuming you cannot
change the lookup table, how would you modify the algorithm to fix the problem?
Rk=8
3D
Rk=4
3D
Rk=2
3D
Rk=1
3D
Rk=−
1
3D
Rk=−
2
3D
Rk=−
4
3D
Rk=−
5
3D
Rk=−
8
3D
Rk=5
3Dq = 2
q= 1
q= 0
q=−1
q=−2
Rk= ( 3
2+ ∆)D
D
Rk
Hint: Consider that (1) the region is supposed to be able to return either 1 or 2, and (2) the table is not indexed with Rk
and D, but rather by the approximated versions e
Rkand e
D.
pf3

Partial preview of the text

Download CS3220 Processor Design Homework 3 - SRT Division Error and Floating Point Format - Prof. and more Assignments Computer Science in PDF only on Docsity!

Homework 3

Prof. Loh

CS3220 - Processor Design - Spring 2005

Handed Out: 10 Feb 2005

Due: 22 Feb 2005

  1. SRT Division

In the Intel Pentium “FDIV” bug, five entries in the SRT lookup table were removed. This effectively set the entries to zero when they should have contained 2’s. Consider the region of the table between R Dk = 43 and 53 where the table could return either 2 or 1 and still result in a correct answer. In the version of the SRT algorithm that we covered in class, we divided this region such that any entry above the midpoint ( R Dk = 32 ) returns a value of 2, and any entry below returns 1.

Let us suppose that the engineer in charge of the SRT lookup table is not good at plotting straight lines, and ends up using a line that is slightly “higher” than R Dk = 32 (shown as a bold line in the figure below – the “correct” line would have terminated slightly lower where the dash-dot horizontal line hits the end of the table). That is, he uses the line Rk D =^

3 2 + ∆^ (see the figure below). How would this affect the correctness of the divider? Assuming you cannot change the lookup table, how would you modify the algorithm to fix the problem?

Rk = 83 D

Rk = 43 D

Rk = 23 D Rk = 13 D

Rk = − 13 D Rk = − 23 D

Rk = − 43 D Rk = − 53 D

Rk = − 83 D

q = 2 Rk = 53 D

q = 1

q = 0

q = − 1

q = − 2

Rk = ( 32 + ∆)D

D Rk

Hint: Consider that (1) the region is supposed to be able to return either 1 or 2, and (2) the table is not indexed with Rk and D, but rather by the approximated versions R˜k and D˜.

  1. Floating Point

In class we covered the IEEE single- and double-precision floating point formats. Let us consider a “half-precision” format:

Sign Exp Mantissa s e e e e e m m m m m m m m m m

Except for the different field sizes, assume that the format is in all other respects the same as the single- and double- precision FP formats.

(a) What is the largest representable real number using this format? (not counting +∞) (b) What is the smallest representable (normalized) non-zero number? (c) What is the base-10 value of the half-precision number 1110011001011000? (d) What is the half-precision binary representation of 1332?

( Problem 3 on next page. )