Question: 1 . LW $t 0 , 0 ( $s 0 ) ; load a [ 0 ] 2 . ADDI $s 1 , zero, 2

1. LW $t0,0($s0) ; load a[0]
2. ADDI $s1, zero, 2 ; $s1=5
3. ADDI $s0, $s0,4 ; increment memory address
4. LOOP: ADDI $t1, $t0,0 ; a[i]= a[i-1]
5. BEQ $t2, $s3, JMARK ; Branch b1 ; if $t2==2 goto JMARK
6. ADDI $t1, $t1,1 ; a[i]=a[i]+1
7. JMARK: SW $t1,0($s0) ; store a[i]
8. ADDI $t2, $t2,1 ; increment loop counter
9. ADDI $s0, $s0,4 ; increment memory address
10. ADDI $t0, $t1,0 ; a[i-1]= a[i]
11. BNEQ $t1, $s1, Loop ; Branch b2 ; if $t1!= $s1 goto Loop
with this code,
c) Assuming there is no forwarding, fill the table below. (add as many rows as needed)
d) Assuming there is forwarding, fill the table below. (add as many rows as needed \begin{tabular}{|c|l|l|l|l|l|l|}
\begin{tabular}{c}
Instruction \\
Number
\end{tabular} & IF & ID & EX & MEM & WB & \\
\hline 1 & & & & & & \\
\hline 2 & & & & & & \\
\hline\(\ldots \) & & & & & & \\
\hline\(\ldots \) & & & & & & \\
\hline
\end{tabular}
1 . LW $t 0 , 0 ( $s 0 ) ; load a [ 0 ] 2 . ADDI

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!