edited by
4,174 views
0 votes
0 votes

Consider a machine with $40 \; \text{MHz}$ processor which has run a benchmark program. The executed program consists of $100,000$ instruction executions, with the following instructions mix and clock cycle count. What will be the effective $\text{CPI, MIPS}$ rate, and execution time.

 

$$\begin{array}{|l|l|r|} \hline \textbf{Instruction Type}& \textbf{Instruction Count}& \textbf{Cycles/Instructions} \\\hline \text{Integer arithmetic}&45000&1 \\\hline \text{Data Transfer}&32000&2 \\\hline \text{Floating point}&15000&2 \\\hline \text{Control transfer}&8000&2 \\\hline \end{array}$$

  1. $\text{CPI} : 3.55; \; \text{MIPS : 30;}$ Execution time $:1.87 \; \text{ms}$
  2. $\text{CPI} : 1.55; \; \text{MIPS : 25.8;}$ Execution time $:3.87 \; \text{ms}$
  3. $\text{CPI} : 5.60; \; \text{MIPS : 45.8;}$ Execution time $:2.87 \; \text{ms}$
  4. $\text{CPI} : 2.55; \; \text{MIPS : 35.8;}$ Execution time $:4.87 \; \text{ms}$
edited by

1 Answer

Best answer
3 votes
3 votes

Given,

Frequency =40 MHz

Clock time = $\frac{1}{40*10^{6}} sec$

Instruction type Instruction count cycle/instructions % of instruction type 
Integer arithmetic 45000 1 45%
Data transfer 32000 2 32%
Floating point 15000 2 15%
Control Transfer 8000 2 8%
Total 100000   100%

 

$\text{CPI}= \displaystyle  \sum_i (\text{Fraction of instruction type } i \times \text{Cycles needed by instruction type }i)$

$\implies \text{CPI}= 0.45*1 +(0.32+0.08+0.15)*2 = 1.55$

$\text{Execution time} = \text{CPI} * \text{total number of instructions} * \text{Clock time}$ 

$\qquad =1.55*10^{5}*\frac{1}{40*10^{6}}$ sec

$\qquad =3.875 \;ms$

$\text{MIPS} = \frac{\text{Clock Frequency}}{\text{CPI}*10^{6}}$

$\qquad =\frac{40*10^{6}}{1.55*10^{6}}$

$\qquad =25.8$

So correct answer is option (B).

Reference :- https://en.wikipedia.org/wiki/Cycles_per_instruction#:~:text=For%20example%2C%20with%20two%20executions,1%2F2%20%3C%2001).

The question was copied from wikipedia itself.

selected by

Related questions

1 votes
1 votes
0 answers
4
soujanyareddy13 asked Apr 12, 2022
896 views
Match the following:$$\begin{array} {ll} \qquad \quad\textbf{List-I} & \qquad \quad \textbf{List-II} \\ \text{(P) Condition coverage} & \text{(1) Black-box testing} \\ \t...