Docsity

Problem Set #7 in Comp 411 - Fall 2007 at The University of North Carolina at Chapel Hill , Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
Comp 411 - Fall 2007 - 1 - Problem Set #7
The U
NIVERSITY
of
N
ORTH
C
AROLINA
at
C
HAPEL
H
ILL
Comp 411 Computer Organization
Fall 2007
Problem Set #7
Issued Wednesday, 10/17/07; Due Wednesday, 10/24/07
Homework Information: Some of the problems are probably too time consuming to be done the
night before the due date, so plan accordingly. Late homework will not be accepted. Feel free to
get help from others, but the work you hand in should be your own.
Problem 1. “Bits of Floating-Point”
Represent the following in single-precision IEEE floating point. Give your answers in
hexadecimal:
a) 2007.0
b) -4014.0
c) -0.00390625 (Hint: -2
-8
)
d) 16777215.0 (Hint: 2
24
-1 )
e) 16777216.0 (Hint: 2
24
)
Convert the following single-precision floating point numbers (given in hexadecimal) to decimal:
f) 0x3e800000
g) 0xbec00000
h) 0x46800000
i) 0xc67ffc00
j) 0x46800200
Problem 2. “Floating-Point Arithmetic”
Given the following two single-precision IEEE floating-point numbers:
x = 0x3c800000 and y = 0x48800000
Compute the following showing all work:
a) x + y
b) x × y
c) x - y
pf3
pf4

Partial preview of the text

Download Problem Set #7 in Comp 411 - Fall 2007 at The University of North Carolina at Chapel Hill and more Assignments Computer Architecture and Organization in PDF only on Docsity!

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Comp 411 Computer Organization Fall 2007

Problem Set # Issued Wednesday, 10/17/07; Due Wednesday, 10/24/

Homework Information: Some of the problems are probably too time consuming to be done the night before the due date, so plan accordingly. Late homework will not be accepted. Feel free to get help from others, but the work you hand in should be your own.

Problem 1. “Bits of Floating-Point”

Represent the following in single-precision IEEE floating point. Give your answers in hexadecimal:

a) 2007. b) -4014. c) -0.00390625 (Hint: -2-8) d) 16777215.0 (Hint: 2^24 -1 ) e) 16777216.0 (Hint: 2^24 )

Convert the following single-precision floating point numbers (given in hexadecimal) to decimal:

f) 0x3e g) 0xbec h) 0x i) 0xc67ffc j) 0x

Problem 2. “Floating-Point Arithmetic”

Given the following two single-precision IEEE floating-point numbers:

x = 0x3c800000 and y = 0x

Compute the following showing all work: a) x + y b) x × y c) x - y

Problem 3. “Half-Precision”

Certain modern graphics cards have adopted a new floating format called “half precision”. Half- precision numbers are stored in 16-bits (2-bytes), and they use the following format:

S EEEEE FFFFFFFFFF

Where S is the sign-bit, E indicates bits of the exponent, which are represented in bias-15, and F is a 10-bit fractional component of an 11-bit significand with a hidden “1”. The exponent values of 00000 2 and 11111 2 are reserved, and the values 0x0000 and 0x8000 are interpreted as 0.0 and -0.0 respectively.

a) Represent the number -0.03125 in half-precision. Give your answer in hexadecimal. b) What value does 0x2bad represent? c) What is the largest positive number representable as a normalized number in half- precision format? d) What is the smallest number greater than zero that is representable as a normalized number in this format?

Problem 4. “Floating-Point Division”

Most floating-point units perform division iteratively using the following process. The expression, A/B is computed by multiplying A times X = 1/B, which is approximated using the following iteration formula.

Xi+1 = Xi (2 – B Xi)

This approach requires an initial guess, X 0. If we assume that B is between 1.0 and 2.0, as would be the case for the significand in IEEE floating point, we can start with X 0 = (3 – B) / 2.

a) Compute X 0 , X 1 , X 2 , and X 3 when B = 1. b) Compute X 0 , X 1 , X 2 , and X 3 when B = 1. c) The number 10 can be represented as 1.25 × 2^3 , and the inverse of the significand can be computed as in part a). How should one adjust the exponent? Compute 1/10.0 using 3 iterations. Make sure your result is of the form, a number between 1.0 and 2.0 multiplied by a power of 2. d) An alternative method for initializing X 0 is to use a look-up table based on a few of the most significant bits of B’s significand (Note: Errors in a table like this one were the cause of the Intel Pentium FDIV bug). Assume the following table for the first 2 bits (note the B values are given in binary, whereas X 0 is given in decimal): B X 0 1.00xxx 0. 1.01xxx 0. 1.10xxx 0. 1.11xxx 0.

Repeat part b), with X 0 initialized from this table. Compare the accuracy of the results after one iteration.

E) Recreate Lee’s state machine using a ROM and a 2-bit state register. What is the size of the ROM. Write out a table showing the new ROM’s contents.

F) After completing his FSM design, Lee closely examines the behavior of the original circuit only to realize that the original circuit expects the year input to be entered most significant bit first. Feeling slightly demoralized, he decides to go ahead and substitute his version on the circuit into a working Mod-3 prototype. Much to his surprise, the prototype system operates just as before. Explain how this is possible.

G) Why is this new “divisible-by-3” circuit immune to the Y2K problem foreseen by Lee? Is it likely to be faster than the original design? Is it likely to be less expensive than the original (explain why)?