Question

Consider the following MIPS code: add $t3,$t2,$t1 lw $t4,0($t3) sw $t7,0($t3) add $t6,$t2,$t8 addi $t3,$t5,4 (a)...

Consider the following MIPS code:

add $t3,$t2,$t1

lw $t4,0($t3)

sw $t7,0($t3)

add $t6,$t2,$t8

addi $t3,$t5,4

(a) Draw a general pipeline diagram from CC1 to CC5

(b) Can you identify the type of hazard in pipeline for executing the code?

(c) What is the solution to the hazard? If NOP (noop or bubbles) have to be inserted to avoid hazard, where will you put them?

(d) Put the code into the MIPS simulator and observe your findings. You may want to load your own numbers into the registers to see better register contents. (a) Provide contents of registers by printing or using screen print to demonstrate the contents after each instruction execution. (b) Provide your .asm file.

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

Answer:-

Consider 5 stage pipeline with the following stages:

IF, ID, OF, EX and WB

The type of hazard is RAW (read after write) and CONTROL hazard. Wherever the hazard occurs, NOOP is inserted.

Add a comment
Know the answer?
Add Answer to:
Consider the following MIPS code: add $t3,$t2,$t1 lw $t4,0($t3) sw $t7,0($t3) add $t6,$t2,$t8 addi $t3,$t5,4 (a)...
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