go to previous page   go to home page   go to next page hear noise highlighting

About how many significant bits do you expect in this product:

01001010 ×  00010101

Answer:

About 12 significant bits.


The mfhi and mflo Instructions

Two instructions move the result of a multiplication into a general purpose register:

mfhi    d        #  d   hi.  Move From Hi
mflo    d        #  d   lo.  Move From Lo

The hi and lo registers cannot be used with any of the other arithmetic or logic instructions. If you want to do something with a product, it must first be moved to a general purpose register.

However there is a further complication on MIPS hardware:

Rule: The next two instructions after a mflo or mfhi must not be a multiply or a divide instruction. The reason for this involves the way the MIPS pipeline works.

On the SPIM simulator this rule does not matter (but on actual hardware it does.)


QUESTION 5:

Must you move the result of a multiplication into a general purpose register before you start another multiply operation?


go to previous page   go to home page   go to next page