Answer:
(a) To find the average CPI for each machine, M1 and M2
Average CPI = Cycles per Instruction * Frequency of each Instruction
= CPI * F
For Machine M1:
Cycles per Instruction/ Clocks per Instruction = (60%)* 1 + (30%)*2 + (10%)*4
= (0.60) * 1 + (0.30) * 2 + (0.10) * 4
= 0.6 + 0.6 + 0.4
= 1.6
For Machine M2:
Cycles per Instruction/ Clocks per Instruction = (60%)*2 + (30%)*3 + (10%)*4
= (0.60) *2 + (0.30) * 3 + (0.10) *4
= 1.2 + 0.9 + 0.4
= 2.5
(b) To calculate the average MIPS ratings for each machine, M1 and M2.
MIPS rating can be calculated using this formula
MIPS rating = Instruction Count / Execution Time * 10^6
= Instruction count / IC X CPI * Clock cycle time * 10^6
= IC X Clock rate / IC X CPI X 10^6
= Clock Rate/(CPI * 10^6)
MIPS rating for Machine M1:
The clock rate for M1 is 80 MHz and the CPI calculated in (a) is 1.6 So:
MIPS rating = (80 * 10^6) / (1.6 * 10^6
)
= 80000000/ 1600000
= 50
MIPS rating for Machine M2:
The clock rate for M1 is 100 MHz and the CPI calculated in (a) is 2.5 So:
MIPS rating = (100 * 10^6
) / (2.5 * 10^6
)
= 100000000 / 2500000
= 40
(c) Which machine has a lower MIPS rating?
- M2 has a lower MIPS rating of 40.
Which specific instruction class CPI must be altered, and by how much, for M2 to achieve performance equal or better than the machine with the superior MIPS rating.
For M1, which has the better MIPS rating compared to M2, adjusting the CPI of instruction class A to 1 instead of 2 is the solution needed for M2 to surpass M1.
After making this adjustment:
Cycles per Instruction / Clocks per Instruction = (60%)*1 + (30%)*3 + (10%)*4
= (0.60 * 1) + (0.30 * 3) + (0.10 * 4)
= 0.60 + 0.9 + 0.4
= 1.9
Average MIPS rating = (100 * 10^6) / (1.9 * 10^6
)
= 100000000 / 1900000
= 52.6
Thus, the new average MIPS rating for M2, after changing the instruction class A CPI, is 52.6 which surpasses M1's average MIPS rating of 50.0