The Gateway to Computer Science Excellence

+3 votes

Consider two processors P1 and P2 executing the same instruction set. Assume that under identical conditions, for the same input, a program running on P2 takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on P1. If the clock frequency of P1 is 1GHz, then the clock frequency of P2 (in GHz) is _________.

please do explain also

please do explain also

+5 votes

Total execution time, E = No. of instructions executed( #I) $\times$ CPI / clock frequency (F)

$E_{P2} = 0.75 \times E_{P1}$

$\implies 0.75 \times \#I_{P1} \times CPI_{P1} / F_{P1} = \#I_{P2} \times CPI_{P2}/F_{P2} $

$\implies 0.75 \times \#I_{P1} \times CPI_{P1} / F_{P1} = \#I_{P1} \times 1.2 \times CPI_{P1}/F_{P2} $

$\implies 0.75 \times F_{P1} = 1.2 /F_{P2} $

$\implies F_{P2} = 1.2 /(0.75 \times F_{P1}) $

$\implies F_{P2} = 1.2 /(0.75 \times 1) = 1.6$ GHz

$E_{P2} = 0.75 \times E_{P1}$

$\implies 0.75 \times \#I_{P1} \times CPI_{P1} / F_{P1} = \#I_{P2} \times CPI_{P2}/F_{P2} $

$\implies 0.75 \times \#I_{P1} \times CPI_{P1} / F_{P1} = \#I_{P1} \times 1.2 \times CPI_{P1}/F_{P2} $

$\implies 0.75 \times F_{P1} = 1.2 /F_{P2} $

$\implies F_{P2} = 1.2 /(0.75 \times F_{P1}) $

$\implies F_{P2} = 1.2 /(0.75 \times 1) = 1.6$ GHz

52,345 questions

60,497 answers

201,862 comments

95,318 users