Electronic – Average Cycles Per Instruction

assemblycomputer-architecturecomputers

We have two different computers with the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set.
Computer M1 has a clock rate of 80 MHz and Computer M2 has a clock rate of 100 MHz. The average number of cycles for each instruction class and their frequencies (for a typical program) are as follows:

Instruction Class Machine M1 Cycles/Instruction Class Machine M2 Cycles/Instruction Class Frequency

Class    M1 Cycles/Instrctn Class   M2 Cycles/Instrctn Class   Frequency
A               1                               2                   60%
B               2                               3                   30%
C               4                               4                   10%

Calculate the average CPI for each machine, M1 and M2.

My initial hunch would be to just do something like M1: .6*1+.3*2+.1*4 = 1.6/3=.53 average for M1 but that makes no sense.

Best Answer

You had it correct right up to the point where you divided. Since you've already multiplied the values by the weights, no further math needs to be performed and the final result is 1.6.