Question: Problem 2 ( Data Hazards, Chapter 4 ) This exercise examines the relationship among data forwarding, hazard detection, and ISA design. It uses the following

Problem 2(Data Hazards, Chapter 4)
This exercise examines the relationship among data forwarding, hazard detection, and ISA design. It uses the following instruction sequence and assumes that it is executed on a 5-stage pipeline data path as described in Chapter 4. Register writes are done in the first half, and register reads in the second half of the WB stage.A. If there is no hardware data forwarding and hazard detection support, please insert nops to ensure correct execution of the code sequence above, and show your revised code sequence.B. Assume we can rearrange the code to reduce the number of nops needed. Please show your improved code sequence with minimal number of nops needed.
C. Assume there are data forwarding and hazard detection. For the optimized code in (B), in each cycle, please show which signals are asserted (and their values) by the hazard detection unit and the data forwarding unit in Figure 4.60(in textbook) shown below. The signals relevant here are PCWrite, IF/IDWrite and ID/EXZero (which controls the MUX connected to the output of the control unit) from the hazard detection unit; and ALUSel1 and ALUSel2 to those two input MUXes to ALU from the forwarding unit. The three possible values for ALUSel1 and ALUSel2 are: 0(no forwarding),1(forward ALU output from previous instruction), or 2(forward data value from the second-previous instruction). You only need to show the first 7 cycles in the following table.
D. If there is no data forwarding unit, what additional inputs and output signals do we need for the hazard detection unit in Figure 4.60 to have a correct execution? Explain in detail why each of those additional signals is necded.
E. For the new data hazard detection unit obtained from (D) and with no data forwarding unit (i.e. ALUSell and ALUSel2 are not there), specify which output signals it asserts in each of the first 10 cycles during the execution of the code sequence in (B). Please use a time table similar to the one in (C).
(Figure 4.60 in Textbook)
Problem 2 ( Data Hazards, Chapter 4 ) This

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 Programming Questions!