Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the fragment of MIPS assembly below: sw $s5, 12($s3) lw $s5, 8($s3) sub $s4, $s2, $s1 beq $s4, $zero, label add $s2, $s0, $s1

Consider the fragment of MIPS assembly below:

sw $s5, 12($s3)

lw $s5, 8($s3)

sub $s4, $s2, $s1

beq $s4, $zero, label

add $s2, $s0, $s1

sub $s2, $s6, $s1

Suppose the pipeline was modified 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.

  1. (2 point) Draw a pipeline diagram to show where the code above will stall.
  2. (1 point) In general, is it possible to reduce the number of stalls resulting from this structural hazard by reordering code?
  3. (1 point) 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.
  4. (1 point) Assume you could build a CPU where the clock cycle time was different for each instruction, according to the following mix.

R-type / I-type (non-lw)

lw

sw

beq

52%

25%

11%

12%

Approximately how many stalls would you expect this structural hazard would have?

PreviousNext

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

Recommended Textbook for

Accounting Information Systems Understanding Business Processes

Authors: Brett Considine, Alison Parkes, Karin Olesen, Michael Lee, Derek Speer

3rd Edition

1742165559, 978-1742165554

More Books

Students also viewed these Accounting questions

Question

Assign oxidation numbers to the atoms in H3PO4.

Answered: 1 week ago

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago