Name: Date:

HW9 solution

You are the lead designer of a processor and wish to evaluate design options and pick the most efficient. For all problems show your work and include units in your calculations for full credit.

  1. (5 points) Base deisgn You first analyze the current design, Mbase, which has a clock rate of 2.5 GHz. Testing with a benchmark program yields the measurements below. What is the CPI of this machine?

    Instruction Class CPI Count
    A 2 40
    B 3 25
    C 3 25
    D 5 10
    $$ CPI_{avg} = (2*40 cycles + 3*25 cycles + 3*25 cycles + 5*10 cycles )/100 instructions= 2.8 cycles/inst (CPI)$$
  2. (3 points) Another program is made up of 2000 instructions, what is the execution time of the program assuming the benchmark program above is representative of this program?

    $$ 2000 inst * \frac{2.8 c}{1 inst} * \frac{1 s}{2.5 * 10^{9} c } = \frac{5600}{2.5 * 10^{9}} sec = 2.24\mu s $$
  3. (5 points) Optimize the hardware The hardware team can improve the processor to give it a clock rate of 3.0 GHz and some improvements to the CPI. Call this computer Mopt. A simulator estimates the results below. What is the CPI of this machine? Be sure to indicate units for your cycles and instructions counts while showing your work.

    Instruction Class CPI Count
    A 2 40
    B 2 25
    C 3 25
    D 5 10
    $$ CPI_{avg} = (2*40 c + 2*25 c + 3*25 c + 5*10 c)/100 i = 2.55 CPI$$
  4. (3 points) If the same program from Q2 is run on this processor, what is the execution time?

    $$ ET = 2000 inst * \frac{2.55 c}{1 inst} * \frac{1 s}{3 * 10^{9} c} = 1.7\mu s$$
  1. (5 points) Optimize the software An improved compiler would reduce the number of instructions in the programs run on this machine. The combination of an improved compiler and the base computer is Mcomp. The instruction improvements from this enhanced compiler have been estimated below. What is the CPI for Mcomp? Note the the program is shorter now. Be sure to indicate units for your cycles and instructions counts while showing your work.

    Instruction Class CPI Count
    A 2 30
    B 3 20
    C 3 20
    D 5 10
    $$ CPI_{avg} = (2*30 c + 3*20 c + 3*20 c + 5*10 c)/80 i = 2.875 CPI$$
  2. (3 points) If the same program from Q2 is compiled with the above enhancements, it is now smaller. What is the execution time of this new, smaller program on the base computer?

    $$ ET = (0.8*2000) inst * \frac{2.875 c}{1 inst} * \frac{1 s}{2.5 * 10^{9} c} = 1.84\mu s$$
  3. (2 points) Which processor enhancement is faster?

    The hardware changes are faster.