Question: I need help in understanding the solution from solution manual. The question is from the exercise 4.13.5 of chapter 4 in the book Computer Organization

I need help in understanding the solution from solution manual. The question is from the exercise 4.13.5 of chapter 4 in the book Computer Organization and Design by Patterson and Hannessey (4th edition). The question is about instruction pipelining.

The question:

Consider two instruction sequences:

I need help in understanding the solution from solution manual. The question Add NOP instructions to this code to eliminate hazards if there is ALU-ALU forwarding only (no forwarding from the MEM to the EX stage).

The solution from solution manual:

With ALU-ALU-only forwarding, an ALU instruction can forward to the next instruction, but not to the second-next instruction (because that would be forwarding from MEM to EX). A load cannot forward at all, because it determines the data value in MEM stage, when it is too late for ALU-ALU forwarding. We have: is from the exercise 4.13.5 of chapter 4 in the book Computer

Doubts:

1. The question asks to add NOPs. But I dont see single NOP in the solution given.

2. In the solution it says "A load cannot forward at all, because it determines the data value in MEM stage, when it is too late for ALU-ALU forwarding.". Then how there can be "ALU-ALU forwarding of R4 from I2" in isntruction sequence 1?

3. I dont get the meaning of the question itself. Does it mean to replace ALU-ALU forwarding with NOPs and keep MA-EX forwarding untouched?

4. This link: http://islab.soe.uoguelph.ca/sareibi/TEACHING_dr/ENG338_html_dr/outline_WINTER_20xx/docs/ASSIGN_dr/Eng338-assign4-Sol-W17.pdf gives solution to 2nd instruction sequence as follows: Organization and Design by Patterson and Hannessey (4th edition). The question is while this chegg link: http://www.chegg.com/homework-help/questions-and-answers/m-sure-part-5-6-please-answer-explain-thanks-problems-exercise-refer-following-sequence-in-q16879133 gives its as follows: about instruction pipelining. The question: Consider two instruction sequences: Add NOP instructions

The related question is already asked on chegg here: http://www.chegg.com/homework-help/questions-and-answers/m-sure-part-5-6-please-answer-explain-thanks-problems-exercise-refer-following-sequence-in-q16879133

and here: http://www.chegg.com/homework-help/questions-and-answers/questions-exercise-refer-following-sequence-instructions-sw-r16-100-r6-lw-r4-8-r16-add-r5--q12204789 But is never answered to the satisfaction.

(There are other resources giving other instruction sequences, like ppts and pdf from different university courses, but none of them give satisfactory logical solution. I did not give them here to avoid further confusion.)

a. SW R16.-100 (R6) LW R4,8(R16) ADD R5,R4.R4 b.OR R1.R2,R3 OR R2.R1,R4 OR R1.R1,R2 a. SW R16.-100 (R6) LW R4,8(R16) ADD R5,R4.R4 b.OR R1.R2,R3 OR R2.R1,R4 OR R1.R1,R2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!