in CO and Architecture retagged by
2,835 views
4 votes
4 votes
Consider a 5 stage pipeline with Instruction Fetch(IF),Instruction decode(ID),Execute(EX),Write back(WB),and Memory access(MA) having latencies(in ns) 3,8,5,6 and 4 respectively. What is average CPI of NON-PIPELINE CPU when speedup achieved by pipelined processor is 4?
in CO and Architecture retagged by
2.8k views

34 Comments

1.23?
0
0
How can you provide solution?
0
0
Speedup = T(old)/T(new) = CPI*Clock Cycles (old)/ CPI* Clock Cycles (new)

Therefore, $4 = \frac{CPI \times 26 (\text{as it is 3 + 8 +5 +6 +4})}{1 \times 8}$

CPI of ideal pipelined processor is 1, it will take clock cycles = longest stage.
0
0
You have taken Tclock for non-pipeline processor = sum of all delays = 26ns ..so we got CPI for NP = 1.23

means time for 1 Instruction on NP = 1.23 * 26 = 31.98 ns

But we have that on non pipeline processor Time for 1 instruction will be Sum of delays  =26

How it takes 31.98 ns ??

Please correct if anything wrong
0
0
I think it is different because we have calculated the average CPI over a large number of instructions. This is not the exact time that every instruction will take - some might take less, some might take more.

Although I am not very sure about this.
0
0

@sushmita maam

@Shaik Masthan sir

correct me if wrong

0
0

@jatin khachane 1

speedup=non-pipeline execution time/pipeline execution time

             = n*CPI*26ns/(n+k-1)*8ns

            as n->infinity                ------------------(1)

               CPI*26/8 =4            ----------------(2)

           =CPI=32/26

in step 1, we have assumed n to be very large, that's why CPI came to be as 1.23 in step 2.

the point is, speedup for different number of instructions are different. that's why in some questions we are explicitly mentioned to calculate speedup for some particular number of instructions. if nothing mentioned, calculate it for large number of instructions.

1
1
IF we consider n-->infinity ..time for 1 instruction on non-pipeline CPU differs ??
0
0

@aambazinga

I am not able to understand the numerator part here

n*CPI*26ns/(n+k-1)*8ns

1 instruction takes 26ns right? Then execution time for n instructions should be 26n ?

What is n*CPI*26 implying? (n*CPI) = no. of cycles for n instructions.

(n*CPI)*26 It seems like its taking per cycle time as 26ns..please clear me this.. 

1
1

@MiNiPanda

Yes it is considerd here that Tclock for Non pipline  = 26ns

0
0
T clock for non pipeline is 26 how?? It is the total time to execute a single instruction on non pipeline CPU and not one clock time.
0
0

@aambazinga

But an instruction is going through 5 stages to complete execution and sum of delays of all stages is 26 ns. Then isn't this the execution time of 1 instruction? :/

1
1

in ME solution they considered lke this

if we consider Cycle time for 1 instruction on NP  = sum of delays..doesn't is say CPI for NP = 1

coz after sum of all delays we are getting one instruction..they why answer here 1.23

0
0

@MiNiPanda

in a program execution, different instruction takes different cycles to complete.

therefore, CPU time for non-pipeline instruction is = #instructions**cycles per instruction*cycle time

while calculating speedup, they provide CPI.

suppose, we had to calculate speedup here with cpi=1.

then answer would be simply 26/8=3.25.

but here, they have given speedup and we have to calculate CPI, it means that CPI is not equals to 1, and something else.

this is my understanding.

please share your solution.

0
0

@aambazinga

I don't have any solution :( I am not understanding this solution.

$ Execution-time= \frac{n* CPI}{frequency}= n* CPI* cycle time $

Here cycle time per instruction in non-pipeline is my doubt. If its 26 ns then in 1 cycle only we can execute 1 instruction i.e. CPI=1 which means pipeline efficiency has been achieved in non-pipelining system :/

 

1
1
made easy shatters the concepts. i don't agree with this solution at all.
2
2

Same here... :(

@MiNiPanda

That exactly my doubt also

0
0
0
0

i.e. CPI=1 which means pipeline efficiency has been achieved in non-pipelining system :/

@MiNiPanda bro what my understanding is , it is not this way..in above gate question also CPI = 1 for non pipelining

it doesn't mean non pipelinig is effiecient as pipeline ..ultimate goal of pipeline is MAX throughput ..here in both case time for clocks will be different in both Non pipe and pipe. For pipe Cycle time < Cycle time for non pipe hence pipelining is always better than non pipe for large no of instructions in terms of throughput ..number of instructions per sec even though both have CPI = 1

2
2

@jatin khachane 1

Okay..thanks for the link..Didn't know that by default we have to take CPI=1 for non-pipelined organization as well :O

But whats confusing me is, if cycle time is taken to be 26ns, then it means CPI=1.. then what are we calculating? :/

0
0

@MiNiPanda

If its 26 ns then in 1 cycle only we can execute 1 instruction i.e. CPI=1

CPI is equals to 1 under ideal condition, not always.

in general, some instructions take 1 cycle, some more than 1.

that's why the question is asking about average CPI.

average CPI of NON-PIPELINE CPU

 and for 

what are we calculating? 

 we are calculating AVERAGE CPI.

2
2

@aambazinga

Thank you..I  more or less understand it now.. :)

I still find this question a bit doubtful..if under ideal condition CPI=1 then all the instructions executed in that same machine will be under the same ideal condition right..?

0
0

@MiNiPanda

Yes also got cpi = 1 as answer at first place :)

And we should not consider cpi =1 for non pipeline by default..it is possible only when cycle time = sum of all stages

They may give cpi for non pipeline>1 and some other clock freq which has less cycle time than sum of delays..at the end one instruction take sum of all stages delay time..that may be in more than one clock..

0
0

 

A non pipelined single cycle processor operating at  100MHZ.

question explicitly mentioned SINGLE CYCLE here

1
1
in above gate question asnwer would have been same ..

IF for non-pipeline CPI = 2 and clock frequency = 200MHz
0
0

finally what you concluded for this question ?

for me, the explanation given by @aambazinga and @Gokulnath  given is correct.

0
0
No bro...how can cpi= 1.23 by considering time period of clock for non pipeline as some of all stage delays..for instruction on non pipeline it takes sum of all stage delays ..now if we set clock time as this much..then 1 clock needed for 1 instruction right..
0
0
how can you say, by seeing the clock time, it takes CPI = 1 ?

i mean to say, it is depend upon the instructions., for a non-pipelined model CPI can be more than 1.

But if we change the clock time to large enough, then it take CPI = 1.

( ideally what we think is clock time (sum of all buffers) should produce CPI = 1 )

But in this question, they given the speedup, so you can't say clock time ( sum of all buffers ) should produce 1 instruction i.e., CPI = 1.
0
0
In solution they have considered time period of clock for non pipeline as sum of all stage delays
0
0
yes, by taking that as clk, you can't assure CPI = 1

if speedup not given, then you can assume it, but they given speed up and asking CPI, then how can you assume CPI = 1 ?
1
1
M very much confused now :(

Can you explain this bit more...how we cant be sure that 1 instruction takes 1 clock on non pipeline processor ..if tclock= sum of all stage delays ...
0
0
If u got some new concept plz comment so that i cn also understand
0
0
for whom you are asking ?

mention their name in the comment
0
0
0
0

3 Answers

5 votes
5 votes

Tn= time for non pipelined processor . i.e., sum of all stages delay= 26

Tp= time for a pipelined processor . i.e., highest delay of all the stages = 8

speedup = (Tn * CPI) / (Tp * CPI)

CPI for pipelined processor is 1(ideal case)

let CPI for non pipelined processor = x

speedup = 26x/8

4=26x/8

x=32/26

=1.23

2 votes
2 votes

1.23 is right.

 

0 votes
0 votes
Nothing is given about #instructions or value of n.

In that we should consider $n$ = infinity.

So Speedup for n = infinity is  $S$ = $\frac{T_{n}}{t_{p}}$

or we can write like, $S$ = $\frac{k.t_{n}}{t_{p}}$

Now this k tells us the number of stage or k is nothing but no. of cycles required in Non-pipelined processor, which is CPI.

$t_{n}$ is the cycle time.

So, $4$ = $\frac{CPI*(3+8+5+6+4)}{Max(3,8,5,6,4)}$

solving this eqn, we'll get CPI = 1.23

Related questions

3 votes
3 votes
1 answer
3