Sw instruction use of B register

Hi,

In 2017 Exan Moed B we were asked to write the new value of various registers after executing the instruction “sw R2 R3 12” which is I-Type instruction.

If I get it right, in terms of the control path, this instruction goes through D5 to COPYGPR2MDR mode in which MDR gets the value that is stored in register B.

I don’t understand how B is related to this I-type instruction. B is suppose to contain RS2 which isn’t encoded in I-type instruction, isn’t it?

If anyone could help me with this I’ll be glad,
Thanks!
Liav

For clarification:

In an I-type instruction the value stored in B is the value stored in RD instead of RS2 for R-type.

So in the official solution they wrote the RTL command for decode mode like this:
A = RS1
B = RS2
PC = PC +1

isn’t it more accurate to write B = RD?
Will you accept such an answer?