Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1- Assume the following instruction mix for some program: 15% stores, 25% loads,

ID: 3588507 • Letter: 1

Question

1- Assume the following instruction mix for some program: 15% stores, 25% loads, 15% branches, 35% integer arithmetic, 5% integer shift and 5% integer multiply.

Given that load instructions require 2 cycles, stores require 1 cycle, branches require 4 cycles, integer ALU and shift instructions require 1 cycle and integer multiplies require 10 cycles, compute the overall CPI.  

2. Given the parametersin problem 1above, consider an optimization that converts multiplies by a constant into a sequence of shits and adds. For this instruction mix, assume 50% of multiplies can be converted to shift-add sequences with an average length of three instructions. Assuming frequency is fixed, what is the new CPI after this optimization? (Hint, notice that the # of instructions changed)

Explanation / Answer

------------------------------------------------------------------------------------------------------------------------

1.975/105% = 1.8810

THey are 5% more instructions per program, so CPI is reduced to 1.8810 and
overall speed = 2.15/1.975 = 1.0886

Type Mix Cost CPI Store 15% 1 0.15 15/100 Load 25% 2 0.5 25*2/100 Branch 15% 4 0.6 15*4/100 Integer 35% 1 0.35 35/100 Shift 5% 1 0.05 5/100 Multiply 5% 10 0.5 5*10/100 Total 2.15