0
\$\begingroup\$

Computer A has an overall CPI of 1.3 and can be run at a clock rate of 600MHz. Computer B has a CPI of 2.5 and can be run at a clock rate of 750 Mhz. We have a particular program we wish to run. When compiled for computer A, this program has exactly 100,000 instructions. How many instructions would the program need to have when compiled for Computer B, in order for the two computers to have exactly the same execution time for this program?

  (CPUTime)A = (Instruction count)A * (CPI)A * (Clock cycle Time)A
   = (100,000)*(1.3)/(600*10^6) ns

  (CPUTime)B = (Instruction count)B * (CPI)B * (Clock cycle Time)B
   = (I)B*(2.5)/(750*10^6) ns

The result should be 65000

However, I'm unable to get there.

  The first calculation gives me 0.00022ns = ~2s

  2 = (I) (2.5)/(750*10^6) ns -- I can't solve this to be 65000

What am I missing here and how can I simplify it?

Thanks

\$\endgroup\$
2
\$\begingroup\$

Solving the first part gave me 216.667 us. I would double check your math there.

$$100000 \cdot 1.3 = 130000$$ $$\frac{130000}{600 \cdot 10^6} = 2.167 \cdot 10^{-4}$$

Using this gives you the correct solution.

\$\endgroup\$
2
\$\begingroup\$

You've got a mistake in the first equation: I get a CPU time of \$2.2 \cdot 10^{--4} s\$, or ~200 us.

The second equation can be reworked to \$I = \dfrac{f \cdot T_{CPU}}{CPI}\$

\$\endgroup\$
1
\$\begingroup\$

Try: -

\$100,000 \times \dfrac{750\times 1.3}{600\times 2.5}\$ = 65,000

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.