Question: 8 . 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 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 stage pipeline, full forwarding, and a predicttaken branch predictor:
lw rr
label: beq rrlabel# not taken once, then taken
lw rr
beq rrlabel# taken
add rrr
label: sw rr
a Draw the pipeline execution diagram for this code, assuming there are no delay slots and that branches execute in the EX stage.
b Repeat a but assume that delay slots are used. In the given code, the instruction that follows the branch is now the delay slot instruction for that branch.
c One way to move the branch resolution one stage earlier is to not need an ALU operation in conditional branches. The branch instructions would be "bez rdlabel" and "bnez rdlabel", and it would branch if the register has and does not have a zero value, respectively. Change this code to use these branch instructions instead of beq. You can assume that register R is available for you to use as a temporary register, and that an seq set if equal Rtype instruction can be used.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
