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

Question 7. (12 points) You are given the following information about the MIPS m

ID: 2266477 • Letter: Q

Question

Question 7. (12 points) You are given the following information about the MIPS microarchitecture: Register Register Register Number Name Content 19 18 17 16 SS3 SS2 $Si $So 0x18 0x16 0xA 0x26 R-Type Instructions Function 100000(32) Add 100010(34) Sub Description I-Type Instructions Op 001000 Description Add Immediate Add instruction is written as add rd, rs, rt Sub instruction is written as sub rd, rs, rt Add immediate instruction is written as addi rt, rs, imm R-Type op rs rt rd shamt funct 6 bits 5 bits 5 bits 5 bits 5 bits 6bits I-Type op rs rt 6 bits 5 bits5 bits imm 16 bits

Explanation / Answer

Registers binary format representation:

S3 = (19)10 = (10011)2

S2 = (18)10 = (10010)2

S1 = (17)10 = (10001)2

S0 = (16)10 = (10000)2

R- Instruction:

Add = (32)10 = (100000)2 = (20)16

Sub = (34)10 = (100010)2 = (22)16

I type instruction:

Add immediate = (001000)2 = (8)10 =(8)16

op = 001000        rs=S3 = 10011     rt = s3 = 10011   imm = 4 = 0000000000000100

Hence in binary, machine code = 0010 0010 0111 0011 0000 0000 0000 0100

In hexadecimal = 0x22730004

2. 0x02128822

In binary its 000000 10000 10010 10001 00000 100010

Refer MIPS architecture instruction format, here op = 000000, 10000 = S0, 10010 = S2,

10001 = S1, shamt = 00000, opcode variant = 100010

sub S0 S2 S1

3. Here S0, S1, S2, S3 are initialized to S0 = 0x26, S1 = 0xA, S2 = 0x16, S3 = 0x18

addi $S3, $S3, 4 => S3 = 0x18 + 4 = 0x1C

sub S0 S2 S1 => S0 = S2 – S1 = 0x16 – 0xA = 2210 – 1010 = 1210 = 0xC

Hence S3 = 0X1C,             S2=0x16,              S1=0xA,                S0=0xC

4. sw $S3, $t2, 0x18

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