Question: Following code lines are written in a high level language: a = c + d; b = c + e; The corresponding instructions for MIPS

Following code lines are written in a high level language:

a = c + d;

b = c + e;

The corresponding instructions for MIPS are:

LW R1, 0(R0)

LW R2, 4(R0)

ADD R3, R1, R2

SW R3, 12(R0)

LW R4, 8(R0)

ADD R5, R1, R4

SW R5, 16(R0)

These instructions are to be executed on a pipelined processor with forwarding.

  1. Identify hazards by showing the execution of these instructions per cycle bases.
  2. Reorder these instructions to avoid any pipeline stalls.
  3. How many cycles are saved after executing the reordered instructions?

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 Databases Questions!