Question: For the given code, what is the speedup achieved by moving branch execution into the ID stage? Explain your answer. In your speedup calculation, assume

For the given code, what is the speedup achieved by moving branch execution into the ID stage? Explain your answer. In your speedup calculation, assume that the additional comparison in the ID stage does not affect clock cycle time.


This exercise is intended to help you understand the relationship between delay slots, control hazards, and branch execution in a pipelined processor. In this exercise, we assume that the following MIPS code is executed on a pipelined processor with a 5-stage pipeline, full forwarding, and a predict-taken branch predictor:a. b. Label1: LW R2,0 (R2) BEQ OR SW R2, RO, Label; Taken once, then not taken R2, R2, R3 R2,0 (R5) LW R2,0

a. b. Label1: LW R2,0 (R2) BEQ OR SW R2, RO, Label; Taken once, then not taken R2, R2, R3 R2,0 (R5) LW R2,0 (R1) Label1: BEQ R2, RO, Labe12; Not taken once, then taken LW R3,0 (R2) BEQ ADD Label2: SW R3, RO, Labell; Taken R1, R3, R1 R1,0 (R2)

Step by Step Solution

3.40 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To analyze the speedup achieved by moving branch execution into the ID stage lets first understand the given MIPS code and its execution in a pipelined processor Assuming a 5stage pipeline IF Instruction Fetch ID Instruction Decode EX Execute MEM Memory Access WB Write Back and a branch predictor that predicts taken once and then not taken for branch instructions a Label1 LW R2 0R2 BEQ R2 R0 Label Taken once then not taken OR R2 R2 R3 SW R2 0R5 b LW R2 0R1 Label1 BEQ R2 R0 Label2 Not taken once then taken LW R3 0R2 BEQ R3 R0 Label1 Taken ADD R1 R3 R1 Label2 SW R1 0R2 Lets analyze the impact of moving the branch execution into the ID stage Without Branch in ID Stage In a standard pipeline the branch instruction introduces a control hazard in the IF stage This hazard results in a pipeline ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Organization Design Questions!