Question: Consider the LEGv 8 code below. Assume that x 1 is initialized to 1 1 and x 2 is initialized to 2 2 . ADDI

Consider the LEGv8 code below. Assume that x1 is initialized to 11 and x2 is initialized to 22.
ADDI x1,x2, #5
ADDx3,x1,x2
ADDI x4,x1,#15
ADD5,x1,x1
(a) What would the final values of registers x3 and x4 be if the above instructions are executed in a pipeline processor that does not handle data hazards (i.e., does not stall the pipeline or use data forwarding for data hazards)?
(b) What would the final values of register x5 be if the above instructions are executed in a pipeline processor that does not handle data hazards (i.e., does not stall the pipeline or use data forwarding for data hazards)? Assume the register file is written at the beginning of the cycle and read at the end of a cycle. Therefore, an ID stage will return the results of a WB state occurring during the same cycle. See Section 4.7 and Figure 4.51 for details.
(c) Suppose you executed the code on a version of the pipeline from Section 4.5 that handles data hazards by simply stalling the pipeline (i.e. inserting NOP instructions where necessary). Show the pipeline timing diagram below when the code is executed.
\table[[ADDIx1,x2,#5,IF,ID,EX,MEM,WB,,,,,,,,,,,,,,,],[ADDx3,x1,x2,,,,,,,,,,,,,,,,,,,,],[ADDIx4,x1,#15,,,,,,,,,,,,,,,,,,,,],[ADD55,x1,x1,,,,,,,,,,,,,,,,,,,,]]
(d) Suppose you executed the code below on a pipeline from Section 4.5 that uses data forwarding for handling data hazards. Show the pipeline timing diagram below:
\table[[ADDIx1,x2,#5,IF,ID,EX,MEM,WB,,,,,,,,,,,,,],[ADDx3,x1,x2,,,,,,,,,,,,,,,,,,],[ADDIx4,x1,#15,,,,,,,,,,,,,,,,,,],[ADD5,x3,x2,,,,,,,,,,,,,,,,,,]]
 Consider the LEGv8 code below. Assume that x1 is initialized to

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!