Answer
1.
CPI for Compiler A = 1.1
CPI for Compiler B = 1.25
2. The clock rate of A is 27% slower than clock rate of B
3. C is 1.67 times faster than A and 2.27 times faster than B
Explanation:
1.
Given
Cycle Time = 1ns = 10^-9
CPU Time for A = 1.1s
Instruction count = 10^9
CPU Time for B = 1.5s
Instruction Count = 1.2*10^9
CPU Time = Instructions * Cycle Time * CPI
So, CPI = CPU Time / (Instructions * Cycle Time)
CPI for A = 1.1/(10^9 * 10^-9)
CPI = 1.1
CPI for B = 1.5/(1.2 * 10^9 * 10^-9)
CPI = 1.5/12
CPI = 1.25
2.
Given
Execution Time on A = Execution Time on B
CPU Time for A = 1.1s
Instruction count = 10^9
CPI = 1.1
CPU Time for B = 1.5s
Instruction Count = 1.2*10^9
CPI = 1.25
Execution Time = Instructions * CPI/ Clock Rate
Execution Time A = Execution Time B
Instruction A * CPI A / Clock Rate A = Instruction B * CPI B/ Clock Rate B. Make Clock Rate A the subject of formula
Clock Rate A = (Instruction A * CPI A * Clock Rate B) / (Instruction B * CPI B)
Clock Rate A = (10^9 * 1.1 * Clock Rate B) / (1.2 * 10^9 * 1.25)
Clock Rate A = 0.73 Clock Rate B
So the clock rate of A is 27% slower than clock rate of B
3.
For compiler A and C,
CPU Time = Instructions * Cycle Time * CPI
CPU Time of C = 6 * 10^8 * 1.1 * 10^-9 = 0.66s
Using ratio of CPU time and Compiler performance
i,e.
CPU Time of A * Performance of A = CPU Time of C * Performance of C
Given
CPU Time of A = 1.1
CPU Time of C = 0.66
1.1 * Performance of A = 0.66 * Performance of C
Performance of C: Performance of A = 1.1/0.66
Performance of C : Performance of A = 1.67
So, C is 1.67 times faster than A
Also,
CPU Time of B = 1.5
CPU Time of C = 0.66
1.5 * Performance of B = 0.66 * Performance of C
Performance of C: Performance of B = 1.5/0.66
Performance of C : Performance of B = 2.27
So, C is 2.27 times faster than B