Respuesta :

Compilers can have a profound impact on the performance of an application. Assume that for a program, compiler A results in a dynamic instruction count of 1.0E9 and has an execution time of 1.5 s, while compiler B results in a dynamic instruction count of 1.2E9 and an execution time of 1.4 s.

a) Find the average CPI for each program given that the processor has a clock rate is 8000 MHZ

b) A new compiler is developed that uses only 4.0E8 instructions and has an average CPI of 1.2. What is the speedup of using this new compiler versus using compiler A or B on the original processor?

Answer:

a)

the average CPI (cycles per instruction) for program A = 12

the average CPI (cycles per instruction) for program B = 9.33

b)

the speedup of using  the new compiler versus compiler A = = 0.04

the speedup of using  the new compiler versus compiler B = 0.043

Explanation:

Given that:

For compiler A:

number of dynamic instruction count = 1.0 × 10⁹

execution time =  1.5 s

For compiler B:

number of dynamic instruction count = 1.2 × 10⁹

execution time =  1.4 s

a)

Find the average CPI for each program given that the processor has a clock rate is 8000 MHZ

Clock rate = 8000 MHZ

Cpu count time = [tex]\frac{1}{8000}*10^{-6[/tex] = 0.125 × 10⁻⁹ ns

= 0.125 × 10⁻⁹ ns

So the average CPI (cycles per instruction) for program A can be calculated as:

1.5 s = 1.0×10⁹ × [tex]x[/tex] × 0.125 × 1.0⁻⁹ ns

1.5 s = [tex]x[/tex] (0.125 ns) ([tex]10^{(9+(-9)}[/tex])

[tex]x[/tex] = [tex]\frac{1.5}{0.125}[/tex]

[tex]x[/tex] = 12

the average CPI (cycles per instruction) for program B can be calculated as:

1.4 s = 1.2×10⁹ × [tex]x[/tex] × 0.125 × 10⁻⁹ ns

1.4 s = [tex]x[/tex](0.15 ns) ([tex]10^{(9+(-9)}[/tex])

[tex]x[/tex]  = [tex]\frac{1.4}{0.15}[/tex]

[tex]x[/tex]  = 9.33

b)

Given that:

Number of instruction of new compiler = 4.0× 10⁸

Average CPI = 1.2

Execution time for the new compiler = Number of instruction of new

                                                                compiler × Average CPI × Cpu count  

                                                                time

Execution time for the new compiler = 4.0 × 10⁸ × 1.2 × 0.125 × 10⁻⁹

= 0.6 ( [tex]10^{8+(-9)}[/tex])

= 0.6 × 10⁻¹

= 0.06 seconds

Therefore,

the speedup of using  the new compiler versus compiler A = [tex]\frac{0.06}{1.5}[/tex]

= 0.04

the speedup of using  the new compiler versus compiler B = [tex]\frac{0.06}{1.4}[/tex]

= 0.043

ACCESS MORE