Question

IE Load rA -M Load B-M Add C rA+B Store M-C Branch x NOOP DIE ITIE (b) Two-stage pipelined timing

Reorganize the code sequence in the figure below to reduce the number of NOOPs.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution for the problem is provided below, please comment if any doubts:

The NOOPs are inserted in order to reduce the pipeline hazards.

The instruction can be reorganized such a way that the original execution scenario of the program is not altered so that the pipeline hazards can be reduced so that the number of NOOPs can also reduced.

The instructions are:

Load    rA <-M

Load    rB <-M

Add     rC <-rA+rB

Store    M<-rC

Branch X

The first two load and the subsequent Add using the loaded registers will results in NOOP, it can be avoided by placing the Branch X in instruction after the two load. Sinc the Bracnch instruction don’t have any relation with the load, the NOOPs can be reduced.

Thus the rearranged code sequence is:

Load rA <-M

Load rB <-M

Branch X

Add     rC <-rA+rB

Store M<-rC

Add a comment
Know the answer?
Add Answer to:
Reorganize the code sequence in the figure below to reduce the number of NOOPs. IE Load...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT