retagged by
31,014 views
59 59 votes
Consider a non-pipelined processor operating at $2.5$ GHz. It takes $5$ clock cycles to complete an instruction. You are going to make a $5$- stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at $2$ GHz. In a given program, assume that $30\%$ are memory instructions, $60 \%$ are ALU instructions and the rest are branch instructions. $5 \%$ of the memory instructions cause stalls of $50$ clock cycles each due to cache misses and $50 \%$ of the branch instructions cause stalls of $2$ cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to $2$ decimal places) is_____________.

5 Answers

Best answer
64 64 votes
Time taken by non-pipelined processor to finish executing the $n$ instructions $: \frac{5n}{2.5}=2n\;\text{ns}$

Now, for pipelined processor,

$\small \begin{array}{|c|c |c| c|} \hline  \text{Instruction type} & \text{Number of such instructions} & \% \text{Causing stalls} & \text{Number of stall cycles} \\\hline  \text{Memory}  & 0.3n & 5\% \;\text{of}\; 0.3n & 50  \\\hline \text{ALU}  & 0.6n & \text{None} & 0    \\\hline  \text{Branch} & 0.1n & 50\% \;\text{of}\;0.1n & 2 \\\hline \end{array}$

Therefore, time taken by pipelined processor:

$0.6n(1) + 0.3n[0.05(1+50) + 0.95(1)] + 0.1n[0.5(1+2) + 0.5(1)]$ cycles

$= 1.85n$ cycles

$= \frac{1.85n}{2}\;\text{ns}$

$= 0.925n\;\text{ns}$

Speedup $= \frac{2n}{0.925n} = 2.162 \approx 2.16.$
edited by
109 109 votes
Non-pipelined processor operates at 2.5GHz ==> T$_{Non-pipelined}=\frac{1}{2.5GHz}= 0.4 ns $

CPI of Non-pipelined processor = 5 clocks.

 

pipelined processor operates at 2GHz ==> T$_{Pipelined}=\frac{1}{2GHz}= 0.5 ns $

Memory instructions = 30 %

in those memory instructions 5 %, each creating stalls of 50 cycles

 

ALU instructions = 60%, these are creating no stalls

 

Branch instructions = 10%

in those branch instructions 50 %, each creating stalls of 2 cycles.

 

CPI of Pipelined processor = 1 + extra cycles. = 1 + stalls by memory instructions + stalls by Branch instructions.

= $1 + (\frac{30}{100}*\frac{5}{100}*50) + (\frac{10}{100}*\frac{50}{100}*2)$ = 1.85

 

Execution time = no.of instructions * No.of clock cycles * clock time = CPI * clock time.

Speed up achieved = $\frac{5*0.4}{1.85*0.5}$ = 2.16
edited by
15 15 votes

Speedup = $\frac{\frac{5}{2.5*{10^{9}}}}{\frac{1 \space \space + \space \space 0.3*0.05*50 \space  \space + \space \space 0.1*0.5*2}{2*{10^{9}}}}$

which is 2.16

edited by
1 flag:
✌ Low quality (js__)
11 11 votes

Just wanted to share the visualization of the types if instruction to calculate avg cycles:

Answer:
Position:
Show:

Related questions

60 60 votes
4 answers 4 answers
24.9k
24.9k views
Arjun asked Feb 12, 2020
24,929 views
Consider a double hashing scheme in which the primary hash function is $h_1(k)= k \text{ mod } 23$, and the secondary hash function is $h_2(k)=1+(k \text{ mod } 19)$. Ass...
78 78 votes
11 answers 11 answers
33.4k
33.4k views
go_editor asked Sep 28, 2014
33,389 views
Consider a $6$-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is exec...
64 64 votes
9 answers 9 answers
45.5k
45.5k views
Arjun asked Feb 12, 2020
45,494 views
A processor has $64$ registers and uses $16$-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a re...
49 49 votes
8 answers 8 answers
31.0k
31.0k views
Arjun asked Feb 12, 2020
30,973 views
A direct mapped cache memory of $1$ MB has a block size of $256$ bytes. The cache has an access time of $3$ ns and a hit rate of $94 \%$. During a cache miss, it takes $2...