In: Computer Science
Consider three different processors P1, P2 and P3 executing the same instruction set with clock rates and CPI given in the following table: Processor Clock Rate CPI P1 2 GHz 1.5 P2 1.5 GHz 1.0 P3 3 GHz 2.5 c) We are trying to reduce the execution time by 30% but this leads an increase of 20% in the CPI. What clock rate should we have to get this time reduction? b) If the processors each execute a program in 10 seconds, find the number of cycles and the number of instructions
See the explanation for answer
Explanation:
b)
Execution Time = Instruction Count x CPI x Clock Cycle Time
It is given that for every processor , Execution Time = 10 sec
Also Clock Cycle Time = 1 / Clock Rate
For processor P1,
CPI = 1.5, Clock Cycle Time = 1 / Clock rate = 1 / 2 GHz = 0.5 x 10-9 sec
Execution Time = Instruction Count x CPI x Clock Cycle Time
10 sec = Instruction Count x 1.5 x 0.5 x 10-9 sec
Instruction Count = 13.33 x 109
Clock Cycles = Instruction Count × CPI = 13.33 x 109 x 1.5 = 19.995 x 109
For processor P2,
CPI = 1, Clock Cycle Time = 1 / Clock rate = 1 / 1.5 GHz = 0.66 x 10-9 sec
Execution Time = Instruction Count x CPI x Clock Cycle Time
10 sec = Instruction Count x 1 x 0.66 x 10-9 sec
Instruction Count = 15.15 x 109
Clock Cycles = Instruction Count x CPI = 15.15 x 109 x 1 = 15.15 x 109
For processor P3,
CPI = 2.5, Clock Cycle Time = 1 / Clock rate = 1 / 3 GHz = 0.33 x 10-9 sec
Execution Time = Instruction Count x CPI x Clock Cycle Time
10 sec = Instruction Count x 2.5 x 0.33 x 10-9 sec
Instruction Count = 12.12 x 109
Clock Cycles = Instruction Count x CPI = 12.12 x 109 x 2.5 = 30.3 x 109
c)
It given that Execution Time is reduced by 30% and CPI is increased by 20%
For processor P1,
Execution Time = Instruction Count x CPI x Clock Cycle Time
0.7 x 10 = 13.33 x 109 x 1.2 x 1.5 x Clock Cycle time
Clock Cycle Time = 0.416 x 10-9 sec =
Clock Rate = 1 / Clock Cycle Time = 1 / 0.416 x 10-9 sec = 2.4 GHz
For processor P2,
Execution Time = Instruction Count x CPI x Clock Cycle Time
0.7 x 10 = 15.15 x 109 x 1.2 x 1 x Clock Cycle time
Clock Cycle Time = 0.385 x 10-9 sec =
Clock Rate = 1 / Clock Cycle Time = 1 / 0.385 x 10-9 sec = 2.6 GHz
For processor P3,
Execution Time = Instruction Count x CPI x Clock Cycle Time
0.7 x 10 = 12.12 x 109 x 1.2 x 2.5 x Clock Cycle time
Clock Cycle Time = 0.1925 x 10-9 sec =
Clock Rate = 1 / Clock Cycle Time = 1 / 0.1925 x 10-9 sec = 5.2 GHz