Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following MIPS code that is being executed on the above 5-stage pip

ID: 3709056 • Letter: C

Question

Consider the following MIPS code that is being executed on the above 5-stage pipeline:

Complete the following table showing the timing of the above code on the 5-stage pipeline MIPS processor (IF, ID, EX, MEM, WB). Draw an arrow showing forwarding between the stage that provides the data and the stage that receives the data. Show all stall cycles by placing an X in the box to represent a stall cycle,

1

2

3

4

5

6

7

8

9

10

11

12

lw

IF

ID

EX

MEM

WB

add

or

lw

sub

1

2

3

4

5

6

7

8

9

10

11

12

lw

IF

ID

EX

MEM

WB

add

or

lw

sub

Explanation / Answer

Solution:

1

2

3

4

5

6

7

8

9

10

11

12

lw

IF

ID

EX

MEM

WB

add

IF

X

X

ID

EX

MEM

WB

or

IF

X

IF

EX

MEM

WB

lw

IF

ID

EX

MEM

WB

sub

IF

X

X

ID

EX

MEM

WB

The execution will be finished in 11 cycles.

lw will load the data at MEM that is why ID is delayed in the next instruction until MEM for lw is finished.

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

1

2

3

4

5

6

7

8

9

10

11

12

lw

IF

ID

EX

MEM

WB

add

IF

X

X

ID

EX

MEM

WB

or

IF

X

IF

EX

MEM

WB

lw

IF

ID

EX

MEM

WB

sub

IF

X

X

ID

EX

MEM

WB

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote