Question

3-Explain data hazard and structural hazard. Then, explain how we can prevent each type of hazard. Provide two examples to su

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

Data Hazard occurs when two instructions in pipeline that exhibit data dependence modify data in different stages of a pipeline.
For example,
I1: Add R1, R2, R3
I2: Add R2, R3, R1
Here instruction I1 writing register R1, and I2 reading register R1, cause Read After Write(RAW) Data Hazard.

Here instruction I1 reading register R2, and I2 writing register R2, cause Write After Read(WAR) Data Hazard.

Structural hazards: when two instructions in the pipeline require the same resource in same clock cycle, results Structural hazards.

For Example,
I1: LW R1, 0(R2)
I2: Add R1, R2, R3
I3: Add R2, R3, R4
I4: Sub R1, R2, R3

Here instruction I1 accessing memory for data read in cycle 4 ,in same clock instruction I4 is fetched from memory resulting Structural hazard.

Add a comment
Know the answer?
Add Answer to:
3-Explain data hazard and structural hazard. Then, explain how we can prevent each type of hazard....
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