Unformatted text preview: Score: Name: ECE 3055 Quiz V, Wednesday, October 2 The program below is executed on the 5 stage pipelined MIPS described in chapter 6. Answer the following questions
about this program. loop: lw 84,100(80)
addi 85,85,6 then: or 88,85,88
beq 85,80,loop Assume the control unit does not have any hazard detection, forwarding, a new branch compare circuit, or automatic
branch ﬂushing, and that the register ﬁle will not write and then read a new register value in one clock cycle. Rewrite
the code sequence by adding the minimum number of NOP instructions (do not reorder or change instructions) to
eliminate all potential data and branch hazards. Assume other non-NOP instructions follow the last branch in the
original code sequence above. Total number of NOPs r uired I Z 4 + F +5 . lw if? . ~\ QOkCl" (\OP 0?? : hop m: n... Mg, \w is? W mafia “a 5 1+ 3:»; no ° .
V1 , ~ 6
Assume the control unit is improved by adding the hazard and forwarding unit as outlined in the text and the current lab i' D V‘ \‘
assignment, adding a branch compare unit to the decode stage, and the register ﬁle writes then reads a new value in a (1‘ Q $ ‘ “3
single clock cycle. Determine the number of clock cycles required to complete the ﬁrst loop execution (i.e. executes l , .
code in loop and branches back to top of loop and is just ready to fetch sw again) of the original code sequence. -' 1
Assume the inner branch is not taken. ( Assume the processor starts this “(5ng initially at power up. if there were no hazards or branch ﬂushing, the original program would require 1 El: clock cycles for execution. (include the time to initially
ﬁll the pipeline). +3P‘i's. But this program will need to stall and/or ﬂushs the pipeline an additional 3 clock cycles so 6 3 Fig ’ a total of I I clock cycles is required for execution ( include the time to initially ﬁll the pipeline). ’l Com/k L oak cycle, 03-...
View Full Document
- Spring '08