Well this refreshed my numerical skills

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+20 votes

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

+43 votes

Best answer

CPU TIME (T) = No. of Instructions( I ) x No. of Cycles Per Instruction (c) x Cycle Time (t)

OR

CPU TIME (T) = $\dfrac{\text{No. of Instructions(I) $\times$ No. of Cycles Per Instruction (c)}}{\text{Clock frequency (f)}}$

$\rightarrow T = I_{c} \times CPI \times F^{-1}$

$\rightarrow \dfrac{T \times F}{CPI} = I_{c}$

$P_1$ & $P_2$ executing same instruction set So,

No. of Instructions same for both $= I_1 = I_2 = I$

If $P_1$ takes $T_1$ time,

$\rightarrow T_2 = 0.75\times T_1 \rightarrow\dfrac{T_{2}}{ T_{1}}=0.75$

If $P_1$ incurs $C_1$ clock cycles per instruction,

$\rightarrow C_2 =1.2 \times C_1\rightarrow \dfrac{C_{2}}{C_{1}}=1.2$

Since $I$ is same for both,

$\rightarrow \dfrac{ ( f_{1} \times T_{1} )}{c1} = \dfrac{ ( f_{2} \times T_{2} )}{c2}$ and $f_1 =1\ GHz$

$\rightarrow F_2 =(\dfrac{C_{2}}{C_{1}}) \times (\dfrac{T_{1}}{T_{2}}) \times F_{1}$

$= \dfrac{1.2 \times 1 GHz}{0.75}=1.6\ GHz$

Hence, the clock frequency of $P_2$ is $=1.6\ GHz$.

OR

CPU TIME (T) = $\dfrac{\text{No. of Instructions(I) $\times$ No. of Cycles Per Instruction (c)}}{\text{Clock frequency (f)}}$

$\rightarrow T = I_{c} \times CPI \times F^{-1}$

$\rightarrow \dfrac{T \times F}{CPI} = I_{c}$

$P_1$ & $P_2$ executing same instruction set So,

No. of Instructions same for both $= I_1 = I_2 = I$

If $P_1$ takes $T_1$ time,

$\rightarrow T_2 = 0.75\times T_1 \rightarrow\dfrac{T_{2}}{ T_{1}}=0.75$

If $P_1$ incurs $C_1$ clock cycles per instruction,

$\rightarrow C_2 =1.2 \times C_1\rightarrow \dfrac{C_{2}}{C_{1}}=1.2$

Since $I$ is same for both,

$\rightarrow \dfrac{ ( f_{1} \times T_{1} )}{c1} = \dfrac{ ( f_{2} \times T_{2} )}{c2}$ and $f_1 =1\ GHz$

$\rightarrow F_2 =(\dfrac{C_{2}}{C_{1}}) \times (\dfrac{T_{1}}{T_{2}}) \times F_{1}$

$= \dfrac{1.2 \times 1 GHz}{0.75}=1.6\ GHz$

Hence, the clock frequency of $P_2$ is $=1.6\ GHz$.

+22 votes

Execution time (T) = CPI * #instructions * time for a clock

= CPI * #instructions / clock frequency (F)

Given P1 and P2 execute the same set of instructions and

T_{2} = 0.75 T_{1},

CPI_{2} = 1.2 CPI_{1 }and

F_{1 }= 1GHz.

So,

$\frac{T_1}{CPI_1} \times F_1 =\frac{T_2}{CPI_2} \times F_2$

$\frac{T_1}{CPI_1} \times 1 GHz = \frac{0.75 T_1} {1.2 CPI_1} \times F_2 $

$ \implies F_2 = \frac {1.2}{0.75} GHz$

$=1.6 GHz$

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.5k
- Digital Logic 2.1k
- Programming & DS 4k
- Algorithms 3.4k
- Theory of Computation 4.2k
- Compiler Design 1.6k
- Databases 3.1k
- CO & Architecture 2.7k
- Computer Networks 3.1k
- Non GATE 1.1k
- Others 1.4k
- Admissions 501
- Exam Queries 449
- Tier 1 Placement Questions 19
- Job Queries 62
- Projects 12

38,080 questions

45,572 answers

132,069 comments

49,047 users