Question: ( Only use whats in the notes provided below ) In Mips Write a program that prompt the user for a temperature in Celsius and

(Only use whats in the notes provided below) In Mips Write a program that prompt the user for a temperature in Celsius and then display the result in Fahrenheit.
step1:get C input(int) in CPU
step2:CPU to FPU ..... Convert int to float
step3:Convert to F
step4:Output
Notes with the code that is allowed is shown in the notes below
Formula:F=9.0/5.0* C +32.0
Notes:
Convert instructions for floating points to
integer and vice versa
After the content of registers are transferred between the processor,
their value needs to get converted from integer to single or double
floating point and vice versa.
Data Movement between registers
mfc1 $t1, $f2 $t1$f2
mtc1 $t1, $f2 $t1-->$f2
Data conversion
cvt.w.s $f2, $f4
cvt.s.w $f2, $f4
float to int
=======
cvt.w.s $f4, $f4
mfc1 $t0,$f4
int to float
=======
mtc1 $t0, $f0
cvt.s.w $f0, $f0
cvt.s.w Fd, Rs convert integer to float
cvt.w.s Rd, Fs convert float to integer
------------------------------
.add.s
.add.d
sub .d $f2, $f4, $f6 # subtraction on double floating
point values
sub .s $f1, $f2, $f3 # subtraction on single floating
point values
div.d $f2, $f4, $f6 # division on double floating
point values
div.s $f1, $f2, $f3 # division on single floating
point values
mul.s $f1, $f2, $f3 # multiplication on single floating
point values
mul.d $f2, $f4, $f6 # multiplication on double floating
point values
mov.s $f1, $f2 # move the single float from $f2 to $f1
mov.d $f2,$f4 # move the single float from $f2 to $f1
-------------------------------------------------
Sample Output:
Please input a temperature in Celsius
=>39
The temperature in Fahrenheit is: =>
102.2
What i have:Pls use what i have
.data
msg1:.asciiz "Enter the temparature in celsius: "
msg2: .asciiz "The farenheit temparature is: "
num1: .float 9.0
num2: .float 5.0
num3: .float 32.0
.text
l.s $f.num1
l.s $f.num2
l.s $f.num3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!