For the same program two different compilers are used The ta
Solution
CPI stands for Cycle per Instruction
Formula to be used: CPU Time = Instruction count executed x CPI x Clock cycle
Compiler A takes time = 1.1 secs for instruction count 1.00E+09 (1.00 x 109 )
Compiler B takes time= 1.5 secs for instruction count 1.20E+09 (1.20 x 109 )
1.7.1
Clock cycle time= 1ns = 1x 10-9
CPU time = Instruction count × CPI × Clock cycle time
CPI = CPU time / (Instruction count × Clock cycle time)
Compiler A CPI = 1.1 / (1.00 x 109 x 1.00 x 10-9) = 1.1
Compiler B CPI = 1.5 / (1.20 x 109 x 1.00 x 10-9) = 1.25
1.7.2
1/ Clock cycle time = Instruction count × CPI / CPU time
Clock rate (Frequency) = Instruction count × CPI / CPU time
For same CPU or execution time on both processors,
fB/fA = (Instruction count(B) × CPI(B)) / (Instruction count (A) × CPI(A))
= (1.20 x 109 x 1.25) / ( 1.00 x 109 x 1.1)
= 1.3636 approx (1.37)
1.7.3
For the original processor with a clock cycle time of 1 ns:
(CPU time)A / (CPU time)NEW= (Instruction count × CPI)A / (Instruction count × CPI)NEW
= (1.00 x 109 x 1.1) / (6.0 x 108 x 1.1) = 1.6667
(CPU time)B / (CPU time)NEW= (Instruction count × CPI)B / (Instruction count × CPI)NEW
= (1.20 x 109 x 1.25) / (6.0 x 108 x 1.1) = 2.2727
