The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
56 views

How to calculate number of stalls here I m confused

asked in CO & Architecture by Active (1k points) | 56 views
here let total number of instruction is...100c

then 95 instruction will execute ideally (CPI=1) and rest 5 instruction will taken CPI=4...becoz evry branch instructon is executing like this....

S2 s2 s3 s4 s5

                     s1 s2 s3 s4 s5

                                          s1 s2 s3 s4 s5....therefor CPI=4..

total time would be....95*1+5*4=115clock=115*4=460/100=4.6ns
(1+5% * (4-1))*4 nsec = 4.6 nsec
Ok means no. Of stalls are 4 due to branching
yes here
stalls= current branch stage - 1
 = 4-1 =3
Why 4-1 ?  Number of stalls shd be 4

@hs_yadav you forgot to divide by 100, as it is asked in the question about avg not total nano sec.

 

whats the given ans????
Ans is 4.6, but how the stalls are 3 , as after execution stage branched instruction starts executing?

Shubhanshu

thanks..

@hs_yadav

I think you need to update your diagram which is given in the comment. First stage should be s1 for 1st instruction, and I2 will be fetched after stage 4 is completed, 

S1 S2 S3 S4 S5        
  STALL STALL STALL S1 S2 S3 S4 S5

Thats why we are getting 3 stalls. 

 

Ok got it , thanks

Please log in or register to answer this question.

Related questions

+2 votes
0 answers
2
asked in CO & Architecture by dm4006 Active (1.1k points) | 35 views
+1 vote
0 answers
3
asked in CO & Architecture by Manis Active (1.2k points) | 37 views


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

33,687 questions
40,230 answers
114,266 comments
38,783 users