CS 61C Homework 7-2

Background reading

P&H Chapter 8

Administrative requirements

Submit your solution online by 8 pm on the 8th of August, 2004. Do this by creating a directory named hw7-2 that contains the file hw7-2.txt (put your answers to the problems in here). From within the directory, type:

     submit hw7-2

This is not a partnership assignment -- hand in your work, and don't collaborate with anyone else.

Problem 1: Book Problems

P&H 8.1, 8.3, 8.8, 8.9

Problem 2:

There are two different brands of machines, "Apple" & "Cantelope", which implement different instruction sets. Here are the clock rates from their advertisements:
          Apple     0.7 GHz (i.e. 700 MHz)        Cantelope     0.6 Ghz (i.e. 600 MHz)

Your friends advised you to buy an "Apple" computer because it has a higher clock rate. From specifications of each machine, you get the following CPI for the various classes of instructions:
          
       Machine      |      Memory Access    |   Branch/Jump    |    Floating Point     |    Integer ALU
  ----------------------------------------------------------------------------------------------------------
      Apple         |          10           |        2         |          1            |         1
      Cantelope     |          14           |        3         |          3            |         1

You write a C program and compile it on the three machines. The table shows the instruction count you get for each instruction class
          
       Machine      |      Memory Access    |   Branch/Jump    |    Floating Point     |    Integer ALU
  ----------------------------------------------------------------------------------------------------------
      Apple         |       7 * 10^9        |    3 * 10^9      |      2 * 10^9         |      6 * 10^9
      Cantelope     |       2 * 10^9        |    4 * 10^9      |      2 * 10^9         |      2 * 10^9

Answer the following questions based on the above information. Please show all the steps in your calculations.