Question: 9. Suppose we want to execute the following code segment on the pipelined CPU: add $2, $5, $4 add $4, $2, $5 lw $5,

9. Suppose we want to execute the following code segment on the 

9. Suppose we want to execute the following code segment on the pipelined CPU: add $2, $5, $4 add $4, $2, $5 lw $5, 100 ($2) add $3, $2, $5 Suppose there is no hardware supports for the forwarding and the stalling, but the register file can be written at the first half of a cycle and be read at the second half. (A) How many NOPs and at what places that you can add to make the code segment (8%) execute correctly on our pipeline? (B) Suppose the pipeline stalls, but no forwards, when there is data hazard. How many (4%) cycles will the above code segment execute?

Step by Step Solution

3.45 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

A Without forwarding support we need to add NOPs to resolve data h... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!