Question: Part 2 - Pipelining and Hazards ( 6 0 pts ) Problems in this exercise refer to the following sequence of instructions, and assume that

Part 2- Pipelining and Hazards (60pts) Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a five-stage pipelined datapath: add $s3, $s1, $s0 lw $s2,4($s3) lw $s1,0($s4) or $s2, $s3, $s2 sw $s2,0($s3) The initial state of the data memory is The initial state of the register table is a) If there is no forwarding or hazard detection, what is the final value of registers $s0~$s4? After the fifth instruction will there be an exception and why? b) If there is no forwarding or hazard detection, insert NOPs to ensure correct execution of the code 3 c) Now, change and/or rearrange the code to minimize the number of NOPs needed. You can assume register $t0 can be used to hold temporary values in your modified code. d) If the processor has forwarding and a hazard detection unit, what is the final value of registers? e) In the multi-cycle pipeline diagram, mark up the pipeline to show the forwarding and stalls needed to execute the following instructions on the pipelined MIPS processor. f) In the multi-cycle pipeline diagram, mark the resources used for each of the 5 instructions. Part 2- Pipelining and Hazards (60pts)
Problems in this exercise refer to the following sequence of instructions, and assume that it is executed on a five-stage pipelined datapath:
```
add $s3, $s1, $s0
lw $s2,4($s3)
1w $s1,0($s4)
or $s2, $s3, $s2
sw $s2,0($s3)
```
The initial state of the data memory is
The initial state of the register table is
a) If there is no forwarding or hazard detection, what is the final value of registers \$s0\$s4? After the fifth instruction will there be an exception and why?
b) If there is no forwarding or hazard detection, insert NOPs to ensure correct execution of the code c) Now, change and/or rearrange the code to minimize the number of NOPs needed. You can assume register \$t0 can be used to hold temporary values in your modified code.
d) If the processor has forwarding and a hazard detection unit, what is the final value of registers?
e) In the multi-cycle pipeline diagram, mark up the pipeline to show the forwarding and stalls needed to execute the following instructions on the pipelined MIPS processor.
f) In the multi-cycle pipeline diagram, mark the resources used for each of the 5 instructions.
4
Part 2 - Pipelining and Hazards ( 6 0 pts )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!