• edited by
31,904 views
69 69 votes

Instruction execution in a processor is divided into $5$ stages, Instruction Fetch (IF), Instruction Decode (ID), Operand fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementation of the processor are contemplated:

  1. a naive pipeline implementation (NP) with $5$ stages and
  2. an efficient pipeline (EP) where the OF stage is divided into stages $\text{OF1}$ and $\text{OF2}$ with execution times of 12 ns and 8 ns respectively.

The speedup (correct to two decimal places) achieved by EP over NP in executing $20$ independent instructions with no hazards is _________ .

10 Answers

Best answer
68 68 votes

Case 1:

Stages $5,$ max delay $= 22\text{ (after adding buffer delay), number of instructions}= 20$

Case 2:

Stages $6,$ (since OF is split), max delay $= 14,\text{ number of instructions}=20$

So, execution time is $(K+N-1)\times \text{ Max delay}$

Speed Up $=\dfrac{528}{350}=1.508 ($Execution time case $1/$Execution time case $2)$

So, the answer is 1.508

• edited by
27 27 votes

NP=5,4,20,10,3    ,latch=2  ,clock cycle time=20+2=22

EP=5,4,12,8,10,3 ,latch=2 ,clock cycle time=12+2=14

For 20 instructions

NP=(5+19)*22=528

EP=(6+19)*14=350

speedup=NP/EP=528/350=1.508

• edited by
23 23 votes

Answer: 1.51

Case -1 Naive Pipeline

Since the cycle time is chosen as the largest stage time, so here the cycle time would be 20ns. 

We are given that there is an interstage delay of 2ns after each stage. So effectively each stage would take 22ns.  (Except the last stage of last instruction being executed)

So, let us choose the cycle time as 22ns

So, 20 instructions would take

[1st instruction x (20ns max stage time + 2ns stage delay) x total stages] +
[Rest 19 instructions x (20ns max stage + 2ns stage delay)] - 2ns (as last stage would not take buffering time)
[22 x 5] + [19 x 22 ] - 2
110 + 418 - 2
526

Case - 2 Efficient Pipeline

Here cycle time is chosen as the largest stage time (i.e of stage OF2), so here the cycle time would be 12ns. 

We are given that there is an interstage delay of 2ns after each stage. So effectively each stage would take 14ns.  (Except the last stage of last instruction being executed)

So, let us choose the cycle time as 22ns

So, 20 instructions would take

[1st instruction x (12ns max stage time + 2ns stage delay) x total stages] +
[Rest 19 instructions x (12ns max stage + 2ns stage delay)] - 2ns (as last stage would not take buffering time)
[14 x 6] + [19 x 14 ] - 2
84 + 266 - 2
348

Speedup is given by

Time taken without EP / Time taken with EP
526 / 348
1.51
• edited by
10 10 votes

For Naive pipelined CPU

K = 5, Tseg = max(5,4,20,10,3) + 2(delay) = 22 ns, n = 20.

Total time needed for 20 instructions

TNP =(k+n-1) x Tseg = (5 + 20 –1) x 22 ns = 24 x 22 ns = 528 ns

For Efficient pipelined processor

K = 6,Tseg = max(5,4,12,2,10,3) + 2(delay) = 14 ns; k = 6, n = 20

Total time for 20 instructions

TEP =(k+n-1) x Tseg = (6 + 20 – 1)  x 14 ns = 350 ns.

Speed up =528/350 =1.508

4 4 votes
Naive pipeline Implementation:

IF                      ID                     OF                     EX                 WB                    

5ns                  4ns                20ns                  10ns             3ns

delay = 2 ns

Phase time =largest stage delay + delay = 20 + 2  =22 ns

Time to Execute N instructions in pipelined  processor = k * phase time + (N-1)  * phase time                      k=number of stages

                                                                                                 = 5 * 22  + 19 * 22

                                                                                                 = 528 ns

Similarly, Efficient pipeline Implementation:

IF                      ID                     OF1               OF2                     EX                 WB                    

5ns                  4ns                      12ns             8ns                     10ns                3ns

delay = 2 ns

Phase time =largest stage delay + delay = 12 + 2  =14 ns

Time to Execute N instructions in pipelined  processor = k * phase time + (N-1)  * phase time                      k=number of stages

                                                                                = 6 *14   +  19 * 14

                                                                                 = 350 ns

The speedup (correct to two decimal places) achieved by EP over NP =  528 /350 = 1.50
Answer:
Position:
Show:

Related questions

79 79 votes
11 answers 11 answers
34.1k
34.1k views
go_editor asked Sep 28, 2014
34,063 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...
200 200 votes
9 answers 9 answers
79.2k
79.2k views
Kathleen asked Sep 22, 2014
79,180 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
74 74 votes
4 answers 4 answers
36.0k
36.0k views
Kathleen asked Sep 12, 2014
36,030 views
Which of the following are NOT true in a pipelined processor?Bypassing can handle all RAW hazardsRegister renaming can eliminate all register carried WAR hazardsControl h...
89 89 votes
12 answers 12 answers
29.1k
29.1k views
Arjun asked Feb 14, 2017
29,062 views
A cache memory unit with capacity of $N$ words and block size of $B$ words is to be designed. If it is designed as a direct mapped cache, the length of the $\textsf{TAG}$...