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

We have the MIPS instruction: sw $7, 20($6). The question asks us to label regis

ID: 3699605 • Letter: W

Question

We have the MIPS instruction: sw $7, 20($6). The question asks us to label register $6 and register $7 as either "read register 1", "read register 2", or "write register". There is a little explenation of sw at bottom of the image. Thanks!!

Looking at the block diagram match $6 and $7 with "Read register 1," "Read register 2" or "Write register." $6 Write register $7 Read register 1 This diagram is the simple 1 cycle-per-instruction 32-bit MIPS architecture we discussed in class. IMI Add Add result Shift left 2 RegDst Branch MemRead MemtoRe AL Instruction 131-2 Control emWri ALUSrc ReqWrite Instruction [25-2 Read Read PCI. address register 1 Read nstruction [20 Readdata 1 register 2 Write Read 31-0] ALU ALU InstructionInstruction [15register resultAddressHead memory data Registers Write Data data Instruction [15-0 16 Sign- 32 ALU control extend Instruction [5-0 For the following questions, assume that PC-0x12343210, where the encoding for the MIPS instruction sw $7,20($6) is stored As a review, the MIPS sw $ra, D($rd) instruction stores the contents of register ra to memory location D(Srd); like x86-64, the value of D(Srd) is determined by adding the displacement value D to the contents of register rd

Explanation / Answer

Answer is as follows :

We have sw $7,20($6)

Which means the contents of register $7 are stored at the offset i.e. generated by (20 + $6).

So here no any value is write to register but on memory location specified by offset.

First data is read from $7.

and than data is read from $6 and add that to 20 and than generate offset or memory location.

And than write the contents of $7 at generated memory location.

So

$7 = Read Register 1

$6 = Read Register 2

No write operation is perfomed on any of register.

if there is any query please ask in comments...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote