Hints:

- You know you'll get some questions about stuff in the problem sets. Though never at the painful level of detail in those.
- I'll likely include a question from Problem Set 6 but it won't involve tracing wires on the diagram. More like, "What does this signal do?"
- Memory questions will be high level, never about circuit diagrams. But you should be ready to talk about the differences between (say) DRAM and SRAM.
- Finite State Machines are great fodder for questions, particularly when representing the state transition table as a ROM.
- Pipelining questions will be about how much you can expect to gain, and identifying the hazards.
- We won't deal with Cache and VM questions until the quiz at the end of class on the final day.

Fill in the missing entries of the Control Logic ROM, based on the data path shown above. Everything you need is in lecture 15.

Opcode | PCSEL | WASEL | SEXT | BSEL | WDSEL | ALUFN | Wr | WERF | ASEL | |||

Sub | Bool | Shft | Math | |||||||||

sub | 0 | 0 | X | 0 | 1 | 1 | XX | 0 | 1 | 0 | 1 | 0 |

xor | 0 | 0 | 0 | |||||||||

la | 0 | 0 | ||||||||||

sll | 0 | 0 | X | 0 | 1 | 0 | 1 | |||||

andi | 0 | 0 | ||||||||||

lw | 2 | 0 | ||||||||||

sw | 1 | |||||||||||

j | X | XX | XX | X | 0 | |||||||

jal | X | XX | X | X | 0 | |||||||

lui | 0 |

**Problem 1.**

We wish to compare the performance of two different computers: M1 and M2. The following measurements have been made on these computers.

Program |
Time on M1 |
Time on M2 |
---|---|---|

1 |
2.0 seconds |
1.5 seconds |

2 |
5.0 seconds |
10.0 seconds |

Which computer is faster for each program, and how many times as fast is it?

**Problem 2.**

Suppose that M1 in problem 1 costs $500 and M2 costs $800. If you needed to run program 1 a large number of times, which computer would you buy in large quantities? Why?

**Problem 3. **

Suppose you wish to run a program P with 7.5 billion instructions on a 5GHz machine with a CPI of 0.8. What is the expected CPU time? When you run P, it takes 3 seconds of wall clock time to complete. What is the percentage of CPU time P received?

**Problem 4.**

Consider two different implementations, I1 and I2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. I1 has a clock rate of 6GHz, and I2 has a clock rate of 3GHz. The average number of cycles for each instruction class on I1 and I2 is given in the following table:

Class |
CPI on I1 |
CPI on I2 |
C1 Usage |
C2 Usage |
C3 Usage |
---|---|---|---|---|---|

A |
2 |
1 |
40% |
40% |
50% |

B |
3 |
2 |
40% |
20% |
25% |

C |
5 |
2 |
20% |
40% |
25% |

The table also contains a summary of average proportion of instruction classes generated by three different compilers. C1 is a compiler produced by the makers of I1, C2 is produced by the makers of I2, and the other compiler is a third-party product. Assume that each compiler uses the same number of instructions for a given program but that the instruction mix is as described in the table. Using C1 on both I1 and I2, how much faster can the makers of I1 claim I1 is compared to I2? Using C2, how much faster can the makers of I2 claim that I2 is compared to I1? If you purchase I1, which compiler would you use? If you purchased I2, which compiler would you use? Which computer and compiler would you purchase if all other criteria are identical including cost?

**Problem 5.**

Consider program P, which runs on a 1GHz machine M in 10 seconds. An optimization is made to P, replacing all instances of multiplying a value by 4 (mult X, X, 4) with two instructions that set x to x+x twice (add x,x,x; add x,x,x). Call this new optimized program P'. The CPI of a multiply instruction is 4, and the CPI of an add is 1. After recompiling, the program now runs in 9 seconds on machine M. How many multiplies were replaced by the new compiler?

]]>