CPIbase = 2 x .4 + 3 x .25 + 3 x .25 + 5 x .1 = 2.8
b.
CPIopt = 2 x .4 + 2 x .25 + 3 x .25 + 4 x .1 = 2.45
instructions MIPS = -------------------- execution time x 106 execution time = instructions x CPI x cycle time instructions MIPS = ------------------------------------- instructions x CPI x cycle time x 106instructions1 = -------------------------------------instructionsx CPI x cycle time x 106 1 cycle time = ---------- clock rate 1 MIPS = ---------------------- 1 CPI x ---------- x 106 clock rate clock rate = ---------- CPI x 106 500 x 106 MIPSbase = --------- 2.8 x 106 600 x 106 MIPSopt = ---------- 2.45 x 106
execution time = instructions x CPI x cycle time execution timebase speedup = ------------------ execution timeopt instructions x CPIbase x cycle timebase = -------------------------------------- instructions x CPIopt x cycle timeopt
We have to assume the same number of instructions are executed by the two machines or we will not have enough information to answer the question.
instructionsx CPIbase x cycle timebase = --------------------------------------instructionsx CPIopt x cycle timeopt CPIbase x cycle timebase = ----------------------- CPIopt x cycle timeopt 1 cycle time = ---------- clock rate CPIbase ------------- clock ratebase speedup = ------------- CPIopt ------------ clock rateopt 2.8 --------- 500 x 106 = --------- 2.45 --------- 600 x 106
execution cycles CPI = ---------------- instructions
Let I be the total number of instructions executed by Mbase. The new numbers of classes of instructions are:
A: I x 40% x 90% = 0.36 x I B: I x 25% x 90% = 0.225 x I C: I x 25% x 85% = 0.2125 x I D: I x 10% x 95% = 0.095 x I New total number of instructions = 0.36 x I + 0.225 x I + 0.2125 x I + 0.095 x I 2 x 0.36 x I + 3 x 0.225 x I + 3 x 0.2125 x I + 5 x 0.095 x I CPIcomp = -------------------------------------------------------------- 0.36 x I + 0.225 x I + 0.2125 x I + 0.095 x I (2 x 0.36 + 3 x 0.225 + 3 x 0.2125 + 5 x 0.095) xI= --------------------------------------------------- (0.36 + 0.225 + 0.2125 + 0.095) xI
execution timebase speedup = ------------------ execution timecomp instructionsbase x CPIbase x cycle timebase = ----------------------------------------- instructionscomp x CPIcomp x cycle timecomp cycle timebase = cycle timecompIx 2.85 xcycle timebase= ------------------------------------------------------------- (0.36 + 0.225 + 0.2125 + 0.095) xIx CPIcomp xcycle timecomp
(2 x 0.36 + 2 x 0.225 + 3 x 0.2125 + 4 x 0.095) xICPIcomp = ---------------------------------------------------- (0.36 + 0.225 + 0.2125 + 0.095) xIexecution timebase speedup = ------------------ execution timeboth instructionsbase x CPIbase x cycle timebase = ----------------------------------------- instructionsboth x CPIboth x cycle timeboth