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

Consider two registers Ss0 and Ssl holding the values 0x00000002 and 0x80000003

ID: 3723360 • Letter: C

Question

Consider two registers Ss0 and Ssl holding the values 0x00000002 and 0x80000003 Multiplication of two 32 bit values result in a 64-bit product a. Write a MIPS code using"mult, to multiply the above given values and to hold b. Write a MIPS code using multu' to multiply the above given values and to hold c. Write a MIPS code using shift instructions to multiply the contents of Ss2 with 4, the upper 32 bits of the product in Ss2 and the lower 32 bits of the product in Ss3. the upper 32 bits of the product in Sa0 and the lower 32 bits of the product in Sa storing the result in Sv0 and divide the contents of Ss3 with 2 and store the results in Sv1 Write down the contents of registers $s2, Ss3, Sa0, Sa, Sv0 and Svl.

Explanation / Answer

ANSWER:

-> The 32 most significant bits will be held in HI special register (accessible by mfhi instruction)

and the 32 least significant bits will be held in LO special register (accessible by mflo instruction):

ANSWER A :

li $s0, 0x00000002  

li $s1, 0x80000003

mult $s0, $s1

mfhi $s2 # 32 most significant bits of multiplication to $s2

mflo $s3 # 32 least significant bits of multiplication to $s3

ANSWER B:

li $s0, 0x00000002

li $s1, 0x80000003

multu $s0, $s1

mfhi $a0 # 32 most significant bits of multiplication to $10

mflo $a1 # 32 least significant bits of multiplication to $a1

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