GATE CSE
First time here? Checkout the FAQ!
x
0 votes
114 views

I am getting answer as 9 , the given answer is 8.

asked in CO & Architecture by Active (2.5k points)   | 114 views
Ans should be 8 itself, 4 instruction 5 stages Ist instructruction will be completed at 5th cycle, then 6,7 and 8, no stall will be there as all hazards will be removed by forwarding.
Ahh, sorry my mistake.

So basically even if OF stage for second instruction takes wrong value they will be corrected by operand forwarding !
Actually OF stage here is 3 so by that time we will be having correct input. This isn't the case where Ist it is fed wrong input and forwarding will update it. this isn't possible at all. thing is if we are getting correct input by OF stage then proceed otherwise stall. Like if OF is at 2nd stage then we have to insert a 1 stall.
Answer will be 8 ,as here operand forwarding is used
yup, 8 cycles.

But shrestha, 

Is my above reason correct ? - 

So basically even if OF stage for second instruction takes wrong value they will be corrected by operand forwarding 

yes, you are right.

1 Answer

0 votes

 

  1 2 3 4 5 6 7 8
I1 IF ID OF EX WB      
I2   IF ID OF EX WB    
I3     IF ID OF EX WB  
I4       IF ID OF EX WB

 

 

 

 

 

in this question instruction I1 perform the addition operation and result store in ALU in clock cycle 3 and next instruction I2 use the result which is store by instruction I1 using operand forwarding !

hence the total clock cycle is 8.

answered by (457 points)  
edited by

Related questions



Top Users Jun 2017
  1. Bikram

    3686 Points

  2. Hemant Parihar

    1480 Points

  3. junaid ahmad

    1432 Points

  4. Arnab Bhadra

    1334 Points

  5. Niraj Singh 2

    1311 Points

  6. Rupendra Choudhary

    1194 Points

  7. rahul sharma 5

    1110 Points

  8. Arjun

    916 Points

  9. srestha

    898 Points

  10. Debashish Deka

    896 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 19 - 25
  1. Bikram

    1942 Points

  2. Niraj Singh 2

    1306 Points

  3. junaid ahmad

    502 Points

  4. sudsho

    410 Points

  5. just_bhavana

    368 Points


23,347 questions
30,050 answers
67,327 comments
28,372 users