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

How to calculate number of stalls here I m confused

asked in CO & Architecture by Junior (927 points) | 71 views
0
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
0
(1+5% * (4-1))*4 nsec = 4.6 nsec
0
Ok means no. Of stalls are 4 due to branching
0
yes here
stalls= current branch stage - 1
 = 4-1 =3
0
Why 4-1 ?  Number of stalls shd be 4
0

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

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

Shubhanshu

thanks..

+1

@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. 

0
Ok got it , thanks

Please log in or register to answer this question.



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

40,731 questions
47,461 answers
145,510 comments
62,220 users