Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

when (op()) {lw} Lw when (op()) {sw} Sw when (op()) op(1) Msub Start: PCout, MAR

ID: 1831169 • Letter: W

Question

when (op()) {lw} Lw
when (op()) {sw} Sw
when (op()) op(1) Msub

Start:
PCout, MARin, MEMread, Yin
CONST(4), ALUadd, Zin, UNTILmfc
MDRout, IRin
Zout, PCin, JUMPonop
HALT /* Should end here on undecoded op */

Lw:
SELrt, REGout, Yin
IRimmedout, ALUadd, Zin
Zout, MARin, MEMread /* MAR=rt+immed */
UNTILmfc
MDRout, SELrs, REGin, JUMP(Start)

Sw:
SELrs, REGout, MDRin /* MDR=rs */
SELrt, REGout, Yin
IRimmedout, ALUadd, Zin
Zout, MARin, MEMwrite, JUMP(Start) /* MAR=rt+immed*/

Msub:
/* YOUR CODE GOES HERE! */

Explanation / Answer

You aren't likely to get much help for these problems on this board- if I'm not mistaken, the implementation for the processorsimulation used in the class is a custom one (obviously, I'm inyour class). Regardless, here's the answer to this one: Msub: SELrt, REGout, Yin IRimmedout, ALUadd, Zin Zout, MARin, MEMread UNTILmfc, SELrs, REGout, Yin MDRout, ALUadd, Zin Zout, MDRin, MEMwrite, JUMP(Start) If you're having trouble with #3 or #5, feel free to open threadsfor those - I've got the answers to those, too.