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

After: sra $t0, St6, 12 what number is in $t0? After ror $t0, $t0,8 what number

ID: 3825511 • Letter: A

Question

After: sra $t0, St6, 12 what number is in $t0? After ror $t0, $t0,8 what number is in $t0? After: add $t0, $t7, $t1 what number is in $t0? After sll $t9, $t0, 20 what number is in $t9? After and $t0, $s0, $sp; sw $t0, p: What number is stored in p? What is the real memory address of the location labeled p? After: Iw $t0, 52($al) what is in $t0? After bltz $t0, loop, is the branch to loop taken? (answer yes or no) After: bne $t0, $t8, subr - is the branch to "subr" taken? After: lw $t7, 80($s3); bgtz $t7, go - is the branch to "go" taken? After: ble $v1, 255, goto - is the branch to "goto" taken? After: lb $a0, 6($s3) After li $v0, 11; syscall, What byte is in $a0 what ASCII character is output to the console?

Explanation / Answer

1. After sra $t0, $t6, 12 what number is in $t0?
sra stands for Shift Right Arithmetic.
The value in $t6 in binary format is shifted to the right i.e., the right most 12 bits
will be lost, and all the previous values will be moved to the right by 12 positions.
Obviously the left most 12 bits are filled with sign bit value. If it is negative, the
leading 6 bits are filled with 1's, and 0's otherwise. And this resultant value is
stored in the register $t0.

After ror $t0, $t0, 8.
ror stands for Rotate Right.
This is pretty same as shift right instruction, but the bits on the right here will not
be lost and will be moved into the left most bits. Its as simple as, if 16 people stand
in a circle, and if they moved to the right by 8 bits, the same affect will happen here
for the bits in register $t0.

2. After add $t0, $t7, $t1.
The values in $t7, and $t1, are added and the result is stored in the register $t0.

After sll $t9, $t0, 20.
This is also prettymuch same as SRA but, here SLL stands for Shift Left Logic.
The value in $t0 in binary format is shifted to the left i..e, the left most 20 bits
will be lost, and all the previous values will be moved to the left by 20 positions.
Here the right most 20 bits are filled with 0's.