Question: Write a MIPS program that accepts 2 numbers as input. The first is a signed integer such as -3,+567,-452 etc. Since -0 is basically meaningless
Write a MIPS program that accepts 2 numbers as input. The first is a signed integer such as -3,+567,-452 etc. Since -0 is basically meaningless a +/- 0 will exit the program. (this means the program will not work for numbers between -1 and +1.) The second number is a decimal number in binary such as .11,.1010110 etc. example .7510 = .112
you will convert these 2 numbers to a single floating point single precision number using logic instructions such as and, or, shift
code to print floating point number that is "created" in register $s0 mtc1 $s0,$f12 #move to coprocessor 1 (floating point unit) li $v0,2 syscall
PLEASE WRITE A MIPS CODE THAT WILL RUN IN QtSpim. No other languages of assembly needed. Just MIPS32
sample run
Enter signed integer part. -3 Enter fraction as a binary string. .101 sign bit = 1 Exponent in decimal = 128 All bits of the floating point number are: 1100 0000 0110 1000 0000 0000 0000 0000 The floating point number is: -3.625 Enter signed integer part. 237 Enter fraction as a binary string. .0011011 sign bit = 0 Exponent in decimal = 134 All bits of the floating point number are: 0100 0011 0110 1101 0011 0110 0000 0000 The floating point number is: 237.21094 Enter signed integer part. 0 -- program is finished running --
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
