Ask Question

You wrote a C application that takes 20 seconds using your desktop processor. An improved C compiler is released that requires only 0.5 as many instructions as the old compiler. The CPI however increased by 1.3. How fast will the application run when compiled with the new compiler?

+4
Answers (1)
  1. 23 July, 05:52
    0
    13 Seconds

    Explanation:

    Let P1 denotes the performance when old compiler was used to write the C application and P2 denotes the performance when the application is compiled with the new compiler.

    CPU time measures of processor performance which is the execution time from the start till end of the program application.

    CPU Time of P1 = Instruction count * Average cycles per instruction * Clock cycle time

    CPU Time (P1) = I * CPI * T

    20 seconds = I * CPI * T

    Clock cycle time (T) is also called Clock Rate. So

    CPU Time of P1 = Instruction count * Average cycles per instruction * Clock Rate

    ClockRate = CPU Time of P1 / Instruction count * Average cycles per instruction

    Clock Rate = 20 seconds / (I * CPI)

    number of instructions of application = 0.5

    Increased CPI = 1.3

    The performance of application when compiled with new compiler:

    CPU Time of P2 = Instructions count * Cycles per instruction * Clock Rate

    = I * CPI * Clock rate

    = 0.5 * 1.3 * Clock rate

    As Clock Rate = 20 seconds / (I * CPI) So

    CPU Time of P2 = (0.5 I) * 1.3 CPI) * 20 / (I * CPI)

    = 0.5 * 1.3 * 20

    = 13 seconds

    So the execution time of application when compiled with new compiler is 13 seconds.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “You wrote a C application that takes 20 seconds using your desktop processor. An improved C compiler is released that requires only 0.5 as ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers