CS 207
Final Exam
Jeff Ondich
Due 5:00 PM Monday, November 24, 2003

This is an exam. If you have questions, you may consult books, the Internet, or Jeff Ondich, but not anybody else. Have fun.

I. In the beginning

(20 points) This part of the exam concerns the first few pages of John von Neumann's First Draft of a Report on the EDVAC. Read it and answer the following questions. For the first three questions, which concern the historical context of this report, you may need to look elsewhere for information.

  1. Patterson and Hennessy discuss von Neumann's report in Chapter 1 of your textbook. They note that the report was one of several things that attorneys used to break the Mauchly/Eckert patent on the computer. What besides this report was relevant in the patent case?

  2. Who besides von Neumann deserves credit for this report?

  3. During the 1940's, several women were heavily involved in the development and operation of the ENIAC. Name at least two of them, and briefly describe their roles in the project.

  4. Throughout the Draft Report, von Neumann refers to the main subdivisions of a computing system as CA, CC, I, O, R, and M. To what modern concepts do these six subdivisions refer?

  5. What does von Neumann means by the term elastic in section 2.3? He also advocates separating some things in the interests of elasticity. What does he want to separate, and how does this separation serve the goals of elasticity?

  6. There is a sentence in section 2.9 that begins with "As to (h) (sorting and statistics), the situation is somewhat ambiguous...." This sentence hints at the subject of one of the chapters in Patterson and Hennessy. Which chapter?

  7. Clarify the first paragraph of section 4.1. You might find it handy to include an example or two using modern gate language.

  8. Summarize von Neumann's arguments in favor of binary rather than decimal computation. Are these arguments still valid?

  9. Why does von Neumann like vacuum tubes? (Vacuum tubes, by the way, are devices that can be used to perform switching operations like those done by transistors. Thus, you could build gates out of vacuum tubes. Vacuum tubes tended to burn out like light bulbs do, so it was common for drug stores and hardware stores to sell them. When I was a kid, our neighborhood drug store had a kiosk where you could bring in a burnt-out tube and stick it into the plugs on the kiosk to figure out which replacement tube would work. This was necessary if you wanted your TV to keep working.)

  10. Consider the last paragraph of section 5.6. In what ways is von Neumann's advice still valid, and in what ways is it not?

II: Caches

(10 points) Consider the following caches, each of which can hold up to sixty-four 32-bit words of data. Assume that addresses are 32 bits long.

For each of these caches, answer the following questions.

III. Pipelining

  1. (8 points) Do problem 6.9 on page 530 of Patterson and Hennessy. You may wish to print out Figure 6.71.

  2. (8 points) Consider the beq instruction. By the time the datapath in Figure 6.30 determines whether to branch or just move on, several of the instructions immediately following the beq instruction have been fetched. If the branch is taken, then those instructions need to be ignored, and fetching needs to take place starting at the branch destination.

    Modify the datapath of Figure 6.30 so that whenever a beq instruction actually branches, the incorrectly fetched instructions don't do any damage as they pass through the pipeline. Please draw your additions on a copy of figure 6.30, and give me a few sentences explaining what you've done and why.

IV. The further education of Jeff

(3 points) You've recommended books and movies, for which I am grateful. To round out my cultural edification, I guess I had better ask you to recommend some music for me. So let me have it: what should I listen to?

V. Building a datapath

(20 points) Suppose you have an anemometer that reports wind speed as a 16-bit non-negative integer (the leftmost bit is always 0--wasteful, but it will make your job easier, since you'll be able to treat all 16-bit integers as signed), continuously transmitted over 16 wires coming from the device. Suppose further that you have a two-character display, capable of displaying any two ASCII characters, represented as 8-bit bytes sent to the display over another 16 wires.

In addition to the anemometer and the display, you have a small machine/assembly-language architecture. It consists of:

Each instruction has the format:

op code [3 bits] destination register number D [3 bits] first operand register number A [3 bits] second operand register number B [3 bits] immediate data N [16 bits]

Register R0 takes input from the anemometer (see LOAD below). Register R1's contents are wired directly to the display, so whatever characters you put into R1 appears immediately on the display.

The op-codes are as follows.

Here's an example program, that puts "UP" on the display if the wind speed is rising, and "DN" in the display otherwise. (By "rising," I mean in the most trivial sense--that is, the most recent measurement is higher than the measurement before it--in reality, you would want to write a more sophisticated program.)


// Initialize R2
SUB R2, R2, R2, 0

// Now loop forever.

// Get the next measurement.
LOAD

// Modify the display, depending on the two most recent measurements.
BLT R0, R2, 3
SUB R1, R1, R1, 01010101 01010000 [ASCII for "UP"]
BR 2
SUB R1, R1, R1, 01000101 01001110 [ASCII for "DN"]

// Wait for a while, and then loop back up to the LOAD instruction.
// I'm assuming for this example a 15KHz clock, for which this delay loop
// will take about 1 second.
SUB R3, R3, R3, -5000
SUB R4, R4, R4, 0
BEQ R3, R4, -7
ADD R3, R3, R4, 1
BR -2

Here's your job. Design a datapath and control to implement this machine architecture. Hand in a drawing of the datapath, a chart showing how op-codes would map to control values, and any explanations you deem appropriate.

VI. In conclusion

Have a great break.