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

Please show work, 1) After the following instructions, what will be the value in

ID: 668889 • Letter: P

Question

Please show work,

1) After the following instructions, what will be the value in $t0?

ori $t0, $0, 21

xori $t0, $t0, 3

2) Assume the current values in $t0 and $t1 are 0 and 1, respectively. What will be the content in $t0 after the following instructions?

xori $t0, $t1, 6

srl $t0, $t0, 2

3) Suppose $t0 is storing 10. After the following instructions, what will be the value in $t0?

addi $t0, $t0, 10

andi $t0, $t0, 7

      srl $t0, $t0, 2

4) Assume the current values in $t0 and $t1 are 0 and 1, respectively. What will the content in $t0 be after the following instructions?

sll $t1, $t1, 4

xor $t0, $t0, $t1

5) Suppose $t0 is storing 10, $t1 is storing 20. After the following instructions, what will be the value in $t2?

sub $t2, $t0, $t1

ori $t2, $t0, 3

      xor $t2, $t2, $t1

Explanation / Answer

1.

ori $t0, $0, 21

xori $t0, $t0, 3

STEP 1 : In first step value stored in $t0 will be

0x00000015

STEP 2 : In Second step, $t0 will be having 0x00000016

2.

xori $t0, $t1, 6

srl $t0, $t0, 2

STEP 1: In first step, $t0 = 0x00000006

STEP 2: In second step, $t0= 0x00000001

3.

addi $t0, $t0, 10

andi $t0, $t0, 7

srl $t0, $t0, 2

STEP 1 : Value in $t0 = 0x0000000a

STEP 2 : Value in $t0 = 0x00000002

STEP 3 : Value in $t0 = 0x00000000

4.

sll $t1, $t1, 4

xor $t0, $t0, $t1

STEP 1 : Value in $t0=0x00000000

STEP 2: Value in $t0=0x00000000

5.

sub $t2, $t0, $t1

ori $t2, $t0, 3

xor $t2, $t2, $t1

STEP 1: Value in $t2=0x00000000

STEP 2: Value in $t2=0x00000003

STEP 1 : In first step value stored in $t0 will be

0x00000015