Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We have a 5-stage pipeline: IF instruction fetch ID instruction decode and read registers EX execute instruction or calculate address MEM access memory WB write

We have a 5-stage pipeline: IF instruction fetch ID instruction decode and read registers EX execute instruction or calculate address MEM access memory WB write results to registers

For each of the following blocks of code, (i) determine if there are any pipeline hazards and, if so, what type is each (data hazard or control hazard). Support this with a diagram showing the instructions moving through the pipeline. (ii) if there are pipeline hazards, for how many stages would the pipeline stall? (iii) if there are pipeline hazards, reorder the code to avoid them without introducing new hazards while still accomplishing the same result. (iv) note that there could be more than one hazard in a block of code; deal with all of them.

(a) ADD R1, R2, R3 ADD R4, R5, R6 STR R1, [R8] STR R5, [R8, #4] STR R6, [R8, #8] (b) LDR R1, [R2] ADD R2, R2, #4 LDR R3, [R2] ADD R4, R1, R7 SUB R5, R6, R7 ORR R8, R6, R7 EOR R9, R6, R7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

Define induction and what are its objectives ?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago