Name: Box: Date:

## HW10 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 Freq
A 2 0.40
B 3 0.25
C 3 0.25
D 5 0.10
$$CPI_{avg} = 2*0.4 + 3*0.25 + 3*0.25 + 5*0.10 = 2.8$$
2. (3 points) If the benchmark program has 2000 instructions, what is the execution time of the program?

$$2000 * 2.8 * \frac{1}{2.5 billion} = 5.1/2.5$$
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?

Instruction Class CPI Freq
A 2 0.40
B 2 0.25
C 3 0.25
D 5 0.10
$$CPI_{avg} = 2*0.4 + 2*0.25 + 3*0.25 + 5*0.10 = 2.55$$
4. (3 points) If the same benchmark program is run on this processor, what is the execution time?

$$2000 * 2.55 * \frac{1}{3 billion} = 1.7\mu s$$
1. (5 points) Optimize the software An improved compiler would reduce the number of instructions in the benchmark program. 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 and you will need to normalize the frequences to get the correct CPI.

Instruction Class CPI Freq
A 2 0.30
B 3 0.20
C 3 0.20
D 5 0.10
$$CPI_{avg} = 2*0.3 + 3*0.20 + 3*0.20 + 5*0.10 = 2.3$$

However, the result needs to be normalized for the changed frequencies:

$$CPI_{avg} = \frac{2.3}{0.8} = 2.875$$
2. (3 points) If the benchmark program is compiled with the above enhancements, it is now smaller. What is the execution time of this new, smaller program on the base computer?

$$0.8(2000) * 2.875 * \frac{1}{2.5 billion} = 1.84\mu s$$
3. (2 points) Which processor enhancement is faster?

The hardware changes are faster.