in CO and Architecture retagged by
17,993 views
49 votes
49 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 ______.
in CO and Architecture retagged by
18.0k views

4 Comments

This is more of Aptitude question.

Here data are given in comparison with one another it means we should try to equate both processor values by using some equation. If we think closely there is nothing equal in both except no. of instructions to be executed. Then how can we find no. of instructions (given total time to compute, CPI, Cycle time)

$\frac{Total time}{CPI * Cycle time} = No. of Instructions$

$\frac{Total time.1}{CPI.1 * Cycle time.1} = \frac{Total time.2}{CPI.2 * Cycle time.2}$

11
11

$Performance \propto \dfrac{1}{execution\ time}$

$execution\ time=CPU\ time$


$CPU\ time= \#\ of\ seconds/program$

$or$

$CPU\ time= \#\ of\ inst/program\times \#\ of\ cycles/inst\times \#\ of\ sec/cycle$

$CPU\ time= inst\ count\times CPI\times cycle\ time$

$In\ the\ program\ different\ instruction\ takes\ different\ cycles\ to\ complete$

$\therefore\ CPU\ time=\Sigma (IC_{i}\times CPI_{i})\times cycle\ time$


$T_{1}=(IC\times x)\times\dfrac{1}{1GHz}.....(1)$

$0.75\ T_{1}=(IC\times 1.2x)\times\dfrac{1}{F_{2}}.....(2)$

$(2)\div(1)$

$F_{2}=1.6\ GHz$

4
4
this is nothing but a game of units as per me, here's how i approached...

Given data says, t2=75% of t1=0.75*t1..where ti: time taken by ith processor and CPI2=120%CPI1

thus CP12=1.2*CPI1.

Units of CPI are cycle per Inst and that of time are seconds.

So, (CPI2/t2)=(1.2/0.75)(CPI1/t1)                             (1)

frequncy is cycle per second hence CPI/t ~ frequency

Thus,  (1) becomes...

f2=1.6*f1=1.6 GHZ                                                  [ANS]
1
1
Lets say, $P_1$ have cycle time $t_1$, $P_2$ have cycle time $t_2$.

Assuming $CPI(cycles/instruction)= 100$ for $P_1$

Time to execute 1 instruction on $P_1 =$ cycles/instruction * 1 cycle time = $100t_1$

$CPI$ for $P_2=120$ (given)

Time to execute 1 instruction on $P_2 = 120t_2$

But, question says $120t_2$ is $25\%$ less than $100t_1$ which means $120t_2 = 75t_1$,

Question also says, $t_1=1ns (f=1GHz$ means cycle time $= 1ns)$,

So, $t_2 = 0.625 ns$ which is $1.6 GHz$
2
2

7 Answers

1 vote
1 vote

Let's assume values.

$P_1$ takes $10ns$ with $CPI=1$, and clock cycle time = $1ns$ (derived from frequency)

This means

$P_2$ takes $7.5ns$ with $CPI=1.2$, and clock cycle time = $?=xns$


Number of instructions = $10$. (Evident from $P_1$)

For $10$ instructions $P_2$ takes $7.5ns$ (Because they work on same instructions; given)

So, $10*1.2xns=7.5ns$

=> $x=\frac{7.5}{12}$

Frequency = $=\frac{1}{x}=\frac{12}{7.5}=1.6\ GHz$

 

0 votes
0 votes
For P1,

let no. of clocks = 100

clock time  = 1 ns (1/1GHz)

Total time = 100 * 1 ns = 100 ns

For P2,

No. of clocks = 20% more that P1 = 120

Total time = 25% less than P1 = 75 ns

    120 * x = 75 ns

⇒ x = 0.625 ns = 1/0.625 GHz = 1.6 GHz
0 votes
0 votes

We know that Execution time = CPI *$\frac{1}{Clock Rate}$   ………….(1)

P1 :

CPI = x(let)

Execution Time =y (let)

Put in equation 1

y = $\frac{x}{Clock rate}$     (given clock rate for P1 is 1 ghz)

y= $\frac{x}{1 Ghz}$

x = y*1ghz …...…….…….(2)

P2 :

CPI (given it is 20% more than P1) = x+x*$\frac{20}{100}$ =$\frac{120x}{100}$

Execution Time (given it is 25% less than P1) = y-y*$\frac{25}{100}$ =$\frac{75y}{100}$

Put in eq 1

$\frac{75y}{100}$ = $\frac{120x}{100}$ *$\frac{1}{Clock Rate}$

Clock Rate = $\frac{24x}{15y}$ 

Using eq 2

Clock Rate = $\frac{24 *y*1ghz}{15y}$ 

Clock Rate = 1.6 Ghz

Answer:

Related questions