Answered step by step
Verified Expert Solution
Link Copied!

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.
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago