Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 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.
step:get C inputint in CPU
step:CPU to FPU Convert int to float
step:Convert to F
step:Output
Notes with the code that is allowed is shown in the notes below
Formula:F C
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
mfc $t $f $t$f
mtc $t $f $t$f
Data conversion
cvtws $f $f
cvtsw $f $f
float to int
cvtws $f $f
mfc $t$f
int to float
mtc $t $f
cvtsw $f $f
cvtsw Fd Rs convert integer to float
cvtws Rd Fs convert float to integer
add.s
add.d
sub d $f $f $f # subtraction on double floating
point values
sub s $f $f $f # subtraction on single floating
point values
div.d $f $f $f # division on double floating
point values
div.s $f $f $f # division on single floating
point values
mul.s $f $f $f # multiplication on single floating
point values
mul.d $f $f $f # multiplication on double floating
point values
mov.s $f $f # move the single float from $f to $f
mov.d $f$f # move the single float from $f to $f
Sample Output:
Please input a temperature in Celsius
The temperature in Fahrenheit is:
What i have:Pls use what i have
data
msg:asciiz "Enter the temparature in celsius:
msg: asciiz "The farenheit temparature is:
num: float
num: float
num: float
text
ls $fnum
ls $fnum
ls $fnum
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started