Exercise 5 [10 Marks]
This question deals with the following MIPS code fragment.
1w $t0, 0($s1)
1w $t0, 0($s2)
addi $t2, $t0, 14
sw $t1, 0($s1)
add $t1 $t1 $t2
Part A:
Consider the basic MIPS pipeline without any structural hazards but without any forwarding. Using the
table below, complete a pipeline diagram indicating the flow of the 5 instructions through the pipeline.
Do not reorder instructions. Be sure to include "nop" instructions where appropriate to resolve any
hazards.
Instr. 1 2 3 4 5 6 7 Clock Cycle 8 9 10 11 12 13 14 15
Part B:
Consider a MIPS pipeline without structural hazards but now with all possible types of forwarding as
discussed in class. Using the table below, complete a pipeline diagram indicating the flow of the 5
instructions through the pipeline. Do not reorder instructions. Be sure to include "nop" instructions
where appropriate to resolve any hazards.
Clock Cycle
Instr. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15