Number of stall cycles introduced by mispredicted branch instruction

Thread Starter

Mahesh Abnave

Joined Jan 12, 2016
3
Q. What are the number of stall cycles introduced by mispredicted branch instruction doing branch condition evaluation in EX stage in pipelined processor?

I was solving problems from chapter 4 in the book Computer Organization and Design by Patterson and Hannessey (4th edition). In one of the exercise, it says that the number of stall cycles introduced by mispredicted branch instruction doing branch condition evaluation in EX stage is 3. But I feel it should be 2:

upload_2017-7-10_1-59-12.png

So as you can see above, F and D of 2nd instruction is wasted beacause instruction 1 branch condition output was mispredicted. So shouldnt it be 2 stall cycles?

PS
I dont whether the question related to the instruction pipelining is on topic or not. Beg me pardon if I shouldnt be posting this on this site.
 

Attachments

Top