Fill This Form To Receive Instant Help
Homework answers / question archive / Assume that register $12 contains an unsigned integer X
Assume that register $12 contains an unsigned integer X. a) Show how X/4 (i.e., X divided by 4) can be computed and placed into register $10 using no more than two instructions, both of which are logical shift instructions.
b) Show how X MOD 4 (i.e., X modulo 4) can be computed and placed into register $10 using no more than two instructions, both of which are logical shift instructions.
c) If instead register $12 contains the 32-bit IEEE 754 floating point negative number -3.56E-4, what floating point value would register $10 contain after the following instructions are executed?
lui $10,0xFF80
xor $10,$10,$12
Answer:
Shift right logical (srl), shift right logical (sll), load upper immediate (lui), and xor can be calculated in the attachment below: