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

Using only MIPS integer instructions , write a function that will make x = (y <

ID: 3686769 • Letter: U

Question

Using only MIPS integer instructions, write a function that will make x = (y < z) where x is an integer and y and z are positive floating-point numbers. The resulting value of x should be the integer 0 or 1. Your function only needs to handle positive normal float values correctly, not negative values, NaN, etc. (Hint: the weightings of bit positions are different for floats and integers, but bits have less significance as you move to lower positions in both integers and floats.)

####
#
# Positive float less than
#
# x = (y < z)
#

.text
.globl myflt

myflt:

#
#   Your code here
#

   jr   $ra       # return

Explanation / Answer

####
#
# Positive float less than
#
# x = (y < z)
#

.text
.globl myflt

myflt:

la   $t0, y # t0 = y

   lw   $t0, 0($t0)
   la   $t1, z # t1 = z
   lw   $t1, 0($t1)
blt $t2, $t0, $t1 # t2 = y < z
   la   $t0, x # x = t2
   sw   $t2, 0($t0)

   jr   $ra # return

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