For the same program two different compilers are used The ta

For the same program, two different compilers are used. The table above shows the execution time of the two different compiled programs. Find the average CPI for each program given that the processor has a clock cycle time of 1 ns. Assume the compiled programs run on two different processors. If the execution times on the two pro censors are the same, how mu Ch faster is the clock of the processor running compiler A\'s code versus the clock of the processor running compiler B\'s code? A new compiler is developed that uses only 600 million instructions and has an average CPI of 1.1. What is the speedup of using this new compiler versus using Compiler A or B on the original processor of 1.6.1?

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

 For the same program, two different compilers are used. The table above shows the execution time of the two different compiled programs. Find the average CPI f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site