Question: [15] 1. Consider the following MIPS Assembly code 16 lw $20, 7($10) 220 sub $11, $20, $16 24 beg $12, $21, 4 428 add $24,

 [15] 1. Consider the following MIPS Assembly code 16 lw $20,

[15] 1. Consider the following MIPS Assembly code 16 lw $20, 7($10) 220 sub $11, $20, $16 24 beg $12, $21, 4 428 add $24, 80, 82 532 sub $10, $4, $8 636 sub $3, $10, $1 40 and $22, $2 $5 | 44 beq $24, $20, -4 48 add $4, $24, $12 1052 or $26, $5$16 1156 add $4, $14, $12 12 60 lt $5, $26, $7 (a) Identify all the data dependencies in the above code. (Write instruction numbers and register number) [3] (b) Which dependencies are data hazards that will be resolved by forwarding and which dependencies are data hazards that will cause a stall? [3] (c) Write the values of ForwardA and ForwardB for each forwarding. [2] (d) Find the branch targets for both branch instructions. [2] (e) If the branch execution is still in the MEM stage, how many instructions (total) will be flushed, if the branch is taken? Also, write the instruction numbers which will be flushed. [2] (f) If the branch execution is in the ID stage, how many instructions (total) will be flushed, if the branch is taken? Also, write the instruction numbers which will be flushed. [2] (g) Identify error(s) in the preceding code, if any. [1] [15] 1. Consider the following MIPS Assembly code 16 lw $20, 7($10) 220 sub $11, $20, $16 24 beg $12, $21, 4 428 add $24, 80, 82 532 sub $10, $4, $8 636 sub $3, $10, $1 40 and $22, $2 $5 | 44 beq $24, $20, -4 48 add $4, $24, $12 1052 or $26, $5$16 1156 add $4, $14, $12 12 60 lt $5, $26, $7 (a) Identify all the data dependencies in the above code. (Write instruction numbers and register number) [3] (b) Which dependencies are data hazards that will be resolved by forwarding and which dependencies are data hazards that will cause a stall? [3] (c) Write the values of ForwardA and ForwardB for each forwarding. [2] (d) Find the branch targets for both branch instructions. [2] (e) If the branch execution is still in the MEM stage, how many instructions (total) will be flushed, if the branch is taken? Also, write the instruction numbers which will be flushed. [2] (f) If the branch execution is in the ID stage, how many instructions (total) will be flushed, if the branch is taken? Also, write the instruction numbers which will be flushed. [2] (g) Identify error(s) in the preceding code, if any. [1]

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!