MIPS decode i-type instruction
rs = $22
rt = $21
immediate = -50
Why is there a problem?
We attempt to read from rt, register $21, however it does not contain any value.
The write register is tagged to 15:0 where the immediate value resides as well.
Instead, we want to read from
Switch between 20-16 and 15-11, for writing values.
Use ato perform the switching.
As you can see above, we also need to performwhen we use an intermediate 16-bit value.