= Solution
Again use independent externally initialized <MIPS instruction> tests. First preset `$t0=7`, `$t1=5`, and execute
``
add $t2, $t0, $t1
``
The normal result, also obtained with `ALUSrc` stuck at zero, is 12. If the line is stuck at one, the second <ALU> operand is the sign-extended low 16 instruction <bits>. For this exact instruction they encode `rd=10`, shift amount zero and function $\mathtt{0x20}$, giving $\mathtt{0x5020}=20512$. The erroneous result is therefore $7+20512=20519$.
For the second test, preset `$s0=L`, `$t3=4`, memory at $L$ to 37 and memory at $L+4$ to 99, with both words valid and aligned. Execute
``
lw $t3, 0($s0)
``
Normally, and with `ALUSrc` stuck at one, the address is $L+0$ and the result is 37. With the line stuck at zero, the second <ALU> operand is the old `$t3=4`, so the load reads 99 from $L+4$. Thus
$$
\boxed{\begin{array}{c|c}
\text{ALUSrc state}&(t2\text{ after add},t3\text{ after load})\\\hline
\text{normal}&(12,37)\\
\text{stuck at 0}&(12,99)\\
\text{stuck at 1}&(20519,37)
\end{array}}
$$
Back to article page