Ask Question
8 November, 22:51

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?

+1
Answers (1)
  1. 9 November, 00:11
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers