Answer:
program A runs in 1 sec in the original processor and 0.88 sec in the new processor.
So, the new processor out-perform the original processor on program A.
Program B runs in 1 sec in the original processor and 1.12 sec in the new processor.
So, the original processor is better then the new processor for program B.
Explanation:
Finding number of instructions in A and B using time taken by the original processor :
The clock speed of the original processor is 2 GHz.
which means each clock takes, 1/clockspeed
= 1 / 2GH = 0.5ns
Now, the CPI for this processor is 1.5 for both programs A and B. therefore each instruction takes 1.5 clock cycles.
Let's say there are n instructions in each program.
therefore time taken to execute n instructions
= n * CPI * cycletime = n * 1.5 * 0.5ns
from the question, each program takes 1 sec to execute in the original processor.
therefore
n * 1.5 * 0.5ns = 1sec
n = 1.3333 * 10^9
So, number of instructions in each program is 1.3333 * 10^9
the new processor :
The cycle time for the new processor is 0.6 ns.
Time taken by program A = time taken to execute n instructions
= n * CPI * cycletime
= 1.3333 * 10^9 * 1.1 * 0.6ns
= 0.88 sec
Time taken by program B = time taken to execute n instructions
= n * CPI * cycletime
= 1.3333 * 10^9 * 1.4 * 0.6
= 1.12 sec
Now, program A runs in 1 sec in the original processor and 0.88 sec in the new processor.
So, the new processor out-perform the original processor on program A.
Program B runs in 1 sec in the original processor and 1.12 sec in the new processor.
So, the original processor is better then the new processor for program B.