Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . [ 2 0 ] Consider the fragment of MIPS assembly below: sd $s 5 , 1 2 ( $s 3 ) Id $s

2.[20] Consider the fragment of MIPS assembly below:
sd $s5,12($s3)
Id $s5,8($s3)
sub $s4, $s2, $s1
beqz $s4, label
add $s2, $s0, $s1
sub $s2, $s6, $s1
Suppose we modify the pipeline so that it has only one memory (thathandles both instructions and data). In this case, there will be a structuralhazard every time a program needs to fetch an instruction during thesame cycle in which another instruction accesses data.
a.[5] Draw a pipeline diagram to show were the code above will stall.
b.[5] In general, is it possible to reduce the number of stalls/NOPsresulting from this structural hazard by reordering code?
c.[5] Must this structural hazard be handled in hardware? We have seenthat data hazards can be eliminated by adding NOPs to the code. Canyou do the same with this structural hazard? If so, explain how. If not,explain why not.
d.[5] Approximately how many stalls would you expect this structural hazard to generate in a typical program? (Use the instruction mix from Exercise 4.8.)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions