Show the execution stages of the following instructions Assu
Show the execution stages of the following instructions. Assume forwarding.
0
1
2
3
4
5
6
7
8
9
10
11
12
ADD $t2, $s1, $s2
IF
ID
EX
MEM
WB
ADDI $t3, $t2, 1
SW $t3, 0($s0)
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
| ADD $t2, $s1, $s2 | IF | ID | EX | MEM | WB | ||||||||
| ADDI $t3, $t2, 1 | |||||||||||||
| SW $t3, 0($s0) |
Solution
Answer
Below is the complete execution stage considering normal forwarding without pipeline:
0
1
2
3
4
5
6
7
8
9
10
11
12
ADD $t2, $s1, $s2
IF
ID
EX
MEM
WB
ADDI $t3, $t2, 1
IF
ID
stall
EX
MEM
WB
SW $t3, 0($s0)
IF
stall
ID
EX
MEM
WB
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
| ADD $t2, $s1, $s2 | IF | ID | EX | MEM | WB | ||||||||
| ADDI $t3, $t2, 1 | IF | ID | stall | EX | MEM | WB | |||||||
| SW $t3, 0($s0) | IF | stall | ID | EX | MEM | WB |

