Answer:
(a) Calculate 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) Calculate the average MIPS ratings for each machine, M1 and M2.
MIPS rating can be found by 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 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 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 smaller MIPS rating?
- M2 has a smaller MIPS rating which is 40.
Which individual instruction class CPI do you need to change, and by how much, to have this machine have the same or better performance as the machine with the higher MIPS rating.
Machine M1 has the higher MIPS rating than M2 and in order to make M2 perform better than M1, the CPI of instruction class A should be modified. Lets change the instruction class A CPI to 1 in place of 2.
Then:
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
Average MIPS rating is of M2 after changing instruction class A CPI is 52.6 which is better than the average MIPS rating of M1 which is 50.0