1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
How does MIPS handle subtraction?
It uses addition, which means that instead of doing 7 - 6, it does 7 + -6 (this uses no additional opcode)
What is overflow?
A carry past the highest bit. This doesn’t happen adding operands of different signs or subtracting operands of the same sign.
How can you tell there’s been an overflow?
The sign bit is set with the value of the result instead of the correct sign.
Which instructions do you use if overflow detection is not needed?
addu, addui, and subu
Which instructions do you use if there’s a chance of an overflow?
add, addi, sub
What are examples that signal there was an overflow?
Adding two positive numbers give a negative number
Adding two negative numbers give a positive number
Subtracting a positive number from a negative number gives a positive number
Subtracting a negative number from a positive number gives a negative number
How many bits are needed for binary integer multiplication?
64 bits
How many bits are needed for binary integer division?
31 bits
What registers are used for integer multiplication and division in MIPS?
mult, div, hi, lo, mfhi, mflo
What does ‘hi’ used for in MIPS?
With multiplication, it stores the resultant (because it’s able to store a 64 bit integer). With division, it stores the remainder
What is ‘lo’ used for in MIPS?
It’s used with ‘hi’ in multiplication to store 64 bits integers. In division, it stores the quotient.
What does ‘mfhi’ and ‘mflo’ mean in MIPS?
Move the contents from hi/lo into rd