Question: 2 . 4 . 2 2 ( [ 5 ] S 4 . 6 > ) Consider the fragment of MIPS assembly
S Consider the fragment of MIPS assembly below:
sd $s$s
Id $s$s
sub $s$s$s
beqz $s label
add $s$s$s
sub $s$s$s
Suppose we modify the pipeline so that it has only one memory that handles both instructions and data In this case, there will be a structural hazard every time a program needs to fetch an instruction during the same cycle in which another instruction accesses data.
Draw a pipeline diagram to show were the code above will stall.
ANS
In general, is it possible to reduce the number of stallsNOPs resulting from this structural hazard by reordering code?
ANS
Must this structural hazard be handled in hardware? We have seen that data hazards can be eliminated by adding NOPs to the code. Can you do the same with this structural hazard? If so explain how. If not, explain why not.
ANS
Approximately how many stalls would you expect this structural hazard to generate in a typical program? Use the instruction mix from Exercise
ANS
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
