edited by
994 views
2 votes
2 votes

In an enhancement of a design of a CPU, the speed of a floating point unit has been increased by 30% and the speed of a fixed point unit has been increased by 20%. The overall speedup achieved if the ratio of the number of fixed point operation to floating point operations is 4 : 6 and the floating point operation used to take twice the time taken by fixed point operation in the original design (upto 2 decimal places) is _________.

edited by

2 Answers

Best answer
7 votes
7 votes

In such questions in general, we calculate speed-up using the following formula:

$\begin{align*} &S = \left [ {\color{red}{\left ( 1-\sum F_i \right )}} + {\color{blue}{\left ( \sum \frac{F_i}{S_i} \right )}} \right ]^{-1} \\ \\ \hline \\ &\text{Where}\\ &F_i = \text{fraction of a hardware component uses} \\ &S_i = \text{speedup of the respective hardware component in the new design} \\ \end{align*}$

For example in a system having a lot of components of and many of them need improvement or speedup. Suppose out of all components,ony $A$ , $B$ and $C$ units are upgraded and their individual speedups are $x$ , $y$ and $z$.Assume fraction of uses of $A$,$B$ and $C$ in the system are $0.1$, $0.3$, $0.2$ respectively.

Then 

$\begin{align*} &S = \left [ {\color{red}{\left ( 1-0.1-0.2-0.3 \right )}} + {\color{blue}{\left ( \frac{0.1}{x} +\frac{0.3}{y} + \frac{0.2}{z} \right )}} \right ]^{-1} \\ \end{align*}$

( note that $0.1+0.3+0.2 \neq 1$ , other units are also there in the system )


Now in the question of this post,

We have only two hardware units. So, $1-\sum F_i$ term cancels out.

  • Floating point unit
  • Fixed point unit

Ratio of     

No of floating point operations : No of Fixed point operatios = $6 : 4$

and one floating point operation takes $k$ times more time than one fixed point operation.

Then ratio of        

uses of floating point unit : uses of fixed point unit = $6k : 4$.

Now we can choose the constant of proportionality (say ${\color{red}{m}} > 0$) in the above ratio in such a way that   $6k{\color{red}{m}}+4{\color{red}{m}} = 1$.

These manipulation gives us the fraction of uses $\color{maroon}{F_i}$ .

  • $\large\color{maroon}{F_1}$ = $\begin{align*} \frac{k.6}{k.6+4} \end{align*}$
  • $\large\color{maroon}{F_2}$ = $\begin{align*} \frac{4}{k.6+4} \end{align*}$

Respective speed-ups are

  • $S_1$ = $\color{maroon}{1+a}$ for Floating point unit where a is the % increse in speed
  • $S_2$ = $\color{maroon}{1+b}$ for fixed point unit where b is the % increse in speed

So,

$\begin{align*} &S = \left [ {\color{red}{\left ( 1-\frac{6k}{6k+4} - \frac{4}{6k+4} \right )}} + {\color{blue}{\left ( \frac{\frac{6k}{6k+4}}{1+a} + \frac{\frac{4}{6k+4}}{1+b} \right )}} \right ]^{-1} \\ &S = \left [ {\color{blue}{\left ( \frac{6k}{(1+a)(6k+4)} + \frac{4}{(1+b)(6k+4)} \right )}} \right ]^{-1} \\ \\ &\text{Given} \quad k =2 \text{ and } \quad a = 0.3 \quad b = 0.2\\ \\ &S = \left [ {\color{blue}{\left ( \frac{6*2}{(1+0.3)(6*2+4)} + \frac{4}{(1+0.2)(6*2+4)} \right )}} \right ]^{-1} \\ &S = {\large\color{blue}{1.273}} \\ \end{align*}$


We need not go through all these steps for such a question in the next time,

We can directly jump to last two lines and plug the values of the parameters and solve.

selected by
0 votes
0 votes
i try here speed up= (original time/ new time) and i let x is time for floating point. so original time= (3x +2* 2x)/5 = 7x/5 and new time= ((3x/1.1)+(4x/1.2))/5 = 8/1.32*5 so speed up= 1.155

Related questions

0 votes
0 votes
0 answers
2
eyeamgj asked Nov 6, 2018
249 views
https://gateoverflow.in/80201/gate1987-1-viiNOT GETTING ITS ANSWER .......