Question: Consider the following MIPS code. Assume the instructions before and after are all NOP ( i . e . no operations ) . The code

Consider the following MIPS code. Assume the instructions before and after are all NOP (i.e. no operations). The code is executed in a pipeline where there is NO forwarding and branch outcome is known at the end of EX stage. There is no branch prediction (i.e. the pipeline has to stall for each beq instruction).
List all the cycle numbers from least to largest in which an instruction is finished. Separate them by commas.
Specify the instructions in the pipeline at the end of 16-th cycle by showing the instruction number in each stage starting with IF. The first instruction has index 1. If the pipeline has been stalled, some stages may have "NOP". Separate the answers with commas. An answer for this part would look like "1,2,3,4,5"(no stall/brach/jump) or "2,3,NOP,4,5"(a stall occured) or "5,6,9,19,11"(a branch or jump occured).
Separate the two answer parts by a semicolon.
1: and $t2, $t5, $t1
2: sw $t1,-16($t4)
3: sw $t4,32($t2)
4: sub $t4, $t2, $t3
5: beq $t3, $t4,3 # This branch is taken.
6: sw $t4,-8($t1)
7: sub $t2, $t2, $t4
8: and $t4, $t2, $t2
9: add $t2, $t2, $t1
10: and $t4, $t5, $t4
11: sw $t5,-56($t2)
12: and $t4, $t2, $t2
13: sw $t2,68($t1)
14: slt $t3, $t3, $t4
15: or $t1, $t3, $t3
Consider the following MIPS code. Assume the

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!