Problem Set Number 2
Computer Science 471

Due by 5 PM, Monday Sept. 29, 1997

1. Problem 4.10 from the Patterson & Hennessy text.

2. Problem 4.14 from the text. (Beware: the address-displacement field of loads and stores is a signed, 2's-complement number.)

3. Problem 4.18 from the text.

4. Let x = 10010.1101 and y = 00110011.1 and z = -111100.10101 be the representations in base 2 of three numbers. Show exactly how x, y, and z would be represented in the IEEE single-precision floating-point format. Show all the bits, just as they would appear in a MIPS register or memory word.

5. Show the steps involved in the single-precision floating-point addition of x and y from question 4. Use binary operations, and show all the partial results along the way. The operands must start out in IEEE format. This question does not ask you to design any hardware, just to show the computational steps, like ``shift significand'' and ``normalize'' and ``round'' and things like that. Assume that the rounding rule is: round to the nearest representable number, and round to the even one if the result is exactly half-way between the two nearest numbers. Show all the bits of the result in IEEE format, just as in question 4.

6. (counts as three questions) The third ``Fallacy'' of section 4.10 of the text tells the sorry story of a now-infamous hardware bug in the Intel Pentium chip. This bug causes a small relative error in certain floating-point calculations. One initial response to this bug was Intel's claim that the particular numbers involved would occur extremely rarely, and that in any case the error was confined to the ``9th digit.'' The Computer Science Department is the proud owner of a Pentium system that has the bug (node0.cs) and another with the bug fixed (ShrimpFS.cs). Both systems run the Linux operating system. A guest account has been set up on them for your use; the login is ``cs471'' and the password you will hear in class.

For this question, please come up with, and describe, a small computation that makes a big mistake because of this bug. Your computation should solve some semi-plausible real-world problem, not just the calculation of some abstract numerical expression. Please create a personal subdirectory for your experiments (if you work together you can make one for your group). To learn how to expose the bug, just follow some of the links in The Pentium Papers; the articles by Cleve Moler are especially good.

You can write a short program or use a spreadsheet or a calculator program (just look around). Have your program or your spreadsheet produce some output you can hand in. Also hand in the code, if any. Run it on both systems. Please be good citizens while you use these systems; both are used in ongoing research.

The most alarming answers to this question will be mentioned in class.