Question

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

Official answer and solution
Official answer
1.6
From
Official GATE 2014 answer key

Solution

Relate CPU execution time to instruction count, clock cycles per instruction (CPI), and clock frequency.

The basic CPU execution time equation is:

T=I×CPIfT = \frac{I \times \text{CPI}}{f}

where II is instruction count, CPI\text{CPI} is cycles per instruction, and ff is clock frequency.

Given conditions for P1P_1 and P2P_2:

  • Same instruction set and identical program input   ⟹  I1=I2=I\implies I_1 = I_2 = I.
  • P2P_2 takes 25% less time than P1P_1:
    T2=(1−0.25)T1=0.75T1T_2 = (1 - 0.25) T_1 = 0.75 T_1
  • P2P_2 incurs 20% more CPI than P1P_1:
    CPI2=(1+0.20)CPI1=1.20CPI1\text{CPI}_2 = (1 + 0.20) \text{CPI}_1 = 1.20 \text{CPI}_1
  • Clock frequency of P1P_1: f1=1 GHzf_1 = 1\text{ GHz}.

Taking the ratio of execution times:

T2T1=CPI2CPI1×f1f2\frac{T_2}{T_1} = \frac{\text{CPI}_2}{\text{CPI}_1} \times \frac{f_1}{f_2}

Substitute the known ratios:

0.75=1.20×1 GHzf20.75 = 1.20 \times \frac{1\text{ GHz}}{f_2}

Solve for f2f_2:

f2=1.200.75×1 GHz=12075=85=1.6 GHzf_2 = \frac{1.20}{0.75} \times 1\text{ GHz} = \frac{120}{75} = \frac{8}{5} = 1.6\text{ GHz}

Thus, the clock frequency of P2P_2 is 1.6 GHz1.6\text{ GHz}.

Final answer

1.6

Common trap

Dividing 0.75/1.20=0.6250.75 / 1.20 = 0.625 instead of solving for f2f_2 in the denominator.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
65 of 65, printed as CS Q.55
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.