Answer:
1.1
1.25
Clock rate A = 0.733 clock rate B
Step-by-step explanation:
Given the following :
Clock cycle time = 1ns = 10^-9 s
COMPILER A:
Instruction count = 1.0E9
Execution time = 1.1 s
COMPILER B:
Instruction count = 1.2E9
Execution time = 1.5 s
Using the relation :
CPI = [Execution time / (instruction count × cycle time)]
CPI for compiler A :
[1.1 / (10^9 × 10^-9)] = 1.1 / 10^0 = 1.1 / 1 = 1.1
CPI for compiler B:
[1.5 / (1.2 ×10^9 * 10^-9)]
(1.5 / 1.2 * 1) = 1.5 / 1.2 = 1.25
b. Assume the compiled programs run on two different processors. If the execution times on the two processors are the same, how much faster
Since, execution time is the same on both processors
Execution time = [(Instruction count × CPI) / clock rate] ;
[(Instruction count × CPI) / clock rate] A = [(Instruction count × CPI) / clock rate] B
Make clock rate of A the subject of the formula :
(Instruction count A * CPI A * clock rate B) / (instruction count B * CPI B)
= (10^9 * 1.1 * clock rate B / 1.2 × 10^9 * 1.25)
1.1 × 10^9 clock rate B / 1.5 × 10^9
Clock rate A = 0.733 clock rate B