Consider two different implementations, Machine M1 and M2, of the same instructi
ID: 3589375 • Letter: C
Question
Consider two different implementations, Machine M1 and M2, of the same instruction set. There are three types of instructions (loads/stores, ALU operations and branches) in the instruction set. M1 has a clock rate of 800 MHz and M2 has a clock rate of 1.25 GHz. The average number of cycles for each instruction type and their frequencies for an image processing algorithm are provided in the table above.
a) Calculate the average CPI for each machine, M1 and M2.
b) Compare the CPU cycle time of each machine for the image processing algorithm.
Instruction Type Machine M1 Machine M2 Instruction 30% 10% Cycles/Instruction Cycles/Instruction Frequency Loads/Stores ALU Operations Branches 4 4Explanation / Answer
(a)Machine M1:
Let instruction frequency be denoted as I and machine cycles/Instruction be denoted as M.
Hence, Average clocks per Instruction (CPI) for Machine 1 = (I1) * M11 + (I2) * M12 + (I3) * M13
= (30/100) * 4 + (60/100) * 1 +(10/100) * 2
= 1.2 + 0.6 + 0.2
= 2
Hence, the average CPI for M1 is 2.
Machine M2:
Average clocks per Instruction (CPI) for Machine 2 = (I1) * M21 + (I2) * M22 + (I3) * M23
= (30/100) * 4 + (60/100) * 2 +(10/100) * 1
= 1.2 + 1.2 + 0.1
= 2.5
Hence, the average CPI for M2 is 2.5.
(b)Machine M1:
Clock rate for M1=800 MHz
CPU Cycle time for Machine 1 in image processing algorithm = 1/clockrate = 1/0.8 = 1.25
Machine M2:
Clock rate for M2=1.25 GHz
CPU Cycle time for Machine 2 in image processing algorithm = 1/clockrate = 1/1.25 = 0.8
Hence, the CPU cycle time for M1 is 1.25 whereas it is 0.8 for M2.