SlideShare a Scribd company logo
1 of 5
Download to read offline
I need help coming up with a MIPS program for this.
1.3. Overview
For this assignment you will be writing a program the asks the user to enter a decimal number
and stores it in IEEE 754 single-precision floating point representation. You will then parse the
IEEE 754 representation to extract the different pieces (sign, exponent, and significand)
You do not have to convert the input to IEEE 754 representation manually. Just use the syscall to
read a float. This will automatically store the value in IEEE 754 format for you. You can then
copy the value to a normal 32-bit register to perform the different bit manipulations to extract
each piece.
After the initial reading in of the floating point value and moving the value to a standard register
you should not use the floating point registers again. Do not use any of the floating point
operations to find the sign, or anything else.
All of the parsing and calculations should be done using various bit manipulations operations
(i.e. bitshifts, maskings, etc). Remember beyond the initial reading of the floating point value
and moving it to a standard register your program should not touch the floating point registers
again.
Your program does not need to handle any of the special cases of floating point numbers like
NaN, infinity, -infinity, 0 or -0.
1.4. Task 1: Main Procedure
Your first task is to collect is to create a loop for your program. Ask user to enter "Do you want
to do it again?" in a Dialog box. Hint: Use syscall 50. If the user answers YES repeat the process.
NO or Cancel, exit the program.
1.5. Task 2: Take User Input Procedure
void read_float()
Next, take user input and store it in memory. Prompt the user to enter a floating point value as a
decimal number. Then, store the input value in a single precision floating point register. In a
DialogBox (syscall 52), Display a string with info about the program ex: "Welcome to the " and
capture a user input. The input should be a floating point number.
You MUST store input into memory space (ieee). To do this, first move your captured input
from the f0 floating point register to a regular temporary register using the following call:
Now, you should be able to store the value into the ieee variable in memory.
The procedure should have the following signature:
1.6. Task 3: Print the sign
void print_sign(ieee)
Your next task is to create a procedure called print_sign that will extract and interpret the sign bit
of the IEEE 754 single precision floating point number. The floating point number is the value
you collected from Task 2.
Your function will take the value as a 32-bit number in a non-floating point register (i.e. $a0).
Remember, this value is stored in your ieee memory space. You should use bit manipulations
(i.e. shifting, masking, etc) to determine the value of the sign bit. If the sign bit is a 1 your
function should print the '-' character. If it is a 0 your function should print the '+' character.
The procedure should have the following signature:
Remember, the sign bit in an IEEE 754 floating point number is the most significant bit.
1.7. Task 4: Print the exponent
void parse_exp(ieee)
Your next task is to create a procedure called parse_exp that will extract and interpret the
exponent bits of the IEEE 754 single precision floating point number. Your function will take the
value as a 32-bit number in a non-floating point register (i.e. $a0). Next it will need to isolate the
bits representing the exponent and interpret those bits as an unsigned integer. Finally, you will
need to subtract the bias to recover the true exponent value as a signed integer. This is the value
that should be returned.
The procedure should have the following signature:
Remember the exponent is the 8 bits immediately following the sign bit.
1.8. Task 5: Print the significand
void print_significand(ieee)
Your next task is to create a procedure called print_significand that will extract the mantissa of
the IEEE 754 single precision floating point number. Your function will take the value as a 32-
bit number in a non-floating point register (i.e. $a0). Next it will need to isolate the bits
representing the mantissa.
The procedure should have the following signature:
Remember the mantissa is the low order 23 bits and you will need to add the implied 1.
1.9. Task 6: Print value store from Task 2
Finally, print the output you captured in Task 2 in IEEE 32 bit form
Here is what i have so far please help
# Author:
# Date: March 2023
# Description: A program that reads an IEEE 754 single-precision floating-point number in
decimal form from the user, and prints its sign, exponent, significand, and hex representation.
.macro print_str (%string)
la $a0, %string
li $v0, 4
syscall
.end_macro
.globl read_float, print_sign, parse_exp, print_exp, print_significand, main
# Data for the program goes here
.data
ieee: .word 0 # store your input here
again: .asciiz "Do you want to do it again?"
prompt: .asciiz "Enter an IEEE 754 floating point number in decimal form: "
res_sign: .asciiz "nThe sign is: "
new_line: .asciiz "n"
expoBias: .asciiz "nExpo with bias: "
expoNoBias: .asciiz "nExpo without bias: "
manti: .asciiz "nMantissa: "
sieee: .asciiz "nIEEE-754 Single Prec: "
.text # Code goes here
main:
loop:
print_str(prompt)
syscall # pop up gui
l.s $f0, 0($v0) # read user input as a float
mfc1 $t0, $f0 # copy register $f0 to $t0
sw $t0, ieee # store value in ieee variable in memory
jal print_sign # call print_sign procedure
jal parse_exp # call parse_exp procedure
jal print_exp # call print_exp procedure
jal print_significand # call print_significand procedure
print_str(sieee) # print IEEE number label
mfc1 $t0, $f0 # copy register $f0 to $t0
print_hex_float: # print IEEE number in hex
print_str(new_line)
li $t1, 8 # 8 nibbles to print
li $t2, 0 # counter
print_hex_digit:
srl $t3, $t0, 28 # shift right 28 bits to get a nibble
andi $t3, $t3, 0xf # mask to get the nibble
addi $t3, $t3, 48 # add offset to get ASCII code
add $t0, $t0, $t0 # shift left 1 bit
addi $t2, $t2, 1 # increment counter
print_str($t3) # print nibble
bne $t2, $t1, print_hex_digit # continue if not done
exit_loop:
print_str(new_line)
print_str(again)
syscall # Dialog box with Yes/No/Cancel options
beqz $v0, exit_main # cancel or no: exit the program
j loop # yes: repeat the loop
exit_main:
li $v0, 10 # 10 is the exit program syscall
syscall # execute call
# Procedure void read_float()
# Functional Description: Reads input from user using a pop-up GUI.
# It stores the captured value in ieee memory space.
# Argument parameters: None
# Return Value: None
read_float
In the tool below, "significand" is another name for the mantissa.
Input Waldo Weber CS2810 Spring2018 Welcome to the IEEE Parser Enter a decimal number:
OK Cancel
Exponent 00000000
Significand
1.9.1. Sample Output Negative sign: 0x00000001 Expo with bias: 0x00000081 Expo without
bias: 0x00000002 Mantissa: Ox00180000 IEEE-754 Single Prec: 0xc0980000
1.9.1.1. If your answer is YES Continue running the program Negative sign: 0x00000001 Expo
with bias: 0x00000081 Expo without bias: 0x00000002 Mantissa: Ox00180000 IEEE-754 Single
Prec: Oxc0980000 Expo without bias: 000000002 Mantissa: 0x00180000 IEEE-754 Single Prec:
Oxc0980000 Positive sign: 000000000 Expo with bias: 0x00000086 Expo without bias:
0x00000007 Mantissa: Ox00484000 IEEE-754 Single Prec: 0x43484000 1.9.1.2. If your answer
is NO Exit the program IEEE-754 Single Prec: 0x43484000 -- program is finished running .-

More Related Content

Similar to I need help coming up with a MIPS program for this.1.3. Overvi.pdf

Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.comHarrisGeorg21
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsgovendaagoovenda
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsnoahjamessss
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxvrickens
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.comStokesCope20
 
GSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comGSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comagathachristie281
 
GSP 215 RANK Education Counseling--gsp215rank.com
 GSP 215 RANK Education Counseling--gsp215rank.com GSP 215 RANK Education Counseling--gsp215rank.com
GSP 215 RANK Education Counseling--gsp215rank.comwilliamwordsworth40
 
GSP 215 RANK Education Planning--gsp215rank.com
GSP 215 RANK Education Planning--gsp215rank.comGSP 215 RANK Education Planning--gsp215rank.com
GSP 215 RANK Education Planning--gsp215rank.comWindyMiller12
 
GSP 215 Effective Communication - tutorialrank.com
GSP 215  Effective Communication - tutorialrank.comGSP 215  Effective Communication - tutorialrank.com
GSP 215 Effective Communication - tutorialrank.comBartholomew35
 
GSP 215 Enhance teaching/tutorialrank.com
 GSP 215 Enhance teaching/tutorialrank.com GSP 215 Enhance teaching/tutorialrank.com
GSP 215 Enhance teaching/tutorialrank.comjonhson300
 
GSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.comGSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.comjonhson129
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comsholingarjosh136
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.comNorrisMistryzo
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comStephenson101
 
GSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comGSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comthomashard64
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comGSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comRoelofMerwe102
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com KeatonJennings102
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comrobertleew18
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.comBaileya55
 

Similar to I need help coming up with a MIPS program for this.1.3. Overvi.pdf (20)

Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
L03vars
L03varsL03vars
L03vars
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
 
GSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comGSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.com
 
GSP 215 RANK Education Counseling--gsp215rank.com
 GSP 215 RANK Education Counseling--gsp215rank.com GSP 215 RANK Education Counseling--gsp215rank.com
GSP 215 RANK Education Counseling--gsp215rank.com
 
GSP 215 RANK Education Planning--gsp215rank.com
GSP 215 RANK Education Planning--gsp215rank.comGSP 215 RANK Education Planning--gsp215rank.com
GSP 215 RANK Education Planning--gsp215rank.com
 
GSP 215 Effective Communication - tutorialrank.com
GSP 215  Effective Communication - tutorialrank.comGSP 215  Effective Communication - tutorialrank.com
GSP 215 Effective Communication - tutorialrank.com
 
GSP 215 Enhance teaching/tutorialrank.com
 GSP 215 Enhance teaching/tutorialrank.com GSP 215 Enhance teaching/tutorialrank.com
GSP 215 Enhance teaching/tutorialrank.com
 
GSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.comGSP 215 Inspiring Innovation/tutorialrank.com
GSP 215 Inspiring Innovation/tutorialrank.com
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.com
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.com
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.com
 
GSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comGSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.com
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comGSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
 

More from pratyushraj61

helphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfhelphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfpratyushraj61
 
Hello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfHello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfpratyushraj61
 
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdfHenrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdfpratyushraj61
 
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfHi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfpratyushraj61
 
helpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfhelpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfpratyushraj61
 
help on this thanks. Phalaropes are shore birds with brightly col.pdf
help on this thanks.  Phalaropes are shore birds with brightly col.pdfhelp on this thanks.  Phalaropes are shore birds with brightly col.pdf
help on this thanks. Phalaropes are shore birds with brightly col.pdfpratyushraj61
 
I have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfI have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfpratyushraj61
 
i need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfi need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfpratyushraj61
 
I need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfI need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfpratyushraj61
 
I need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfI need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfpratyushraj61
 
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfHewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfpratyushraj61
 
I need an explanation on what the function of the number 1.428 in .pdf
I need an explanation on what the function of the number 1.428 in .pdfI need an explanation on what the function of the number 1.428 in .pdf
I need an explanation on what the function of the number 1.428 in .pdfpratyushraj61
 
I need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfI need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfpratyushraj61
 
I have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfI have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfpratyushraj61
 
How do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfHow do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfpratyushraj61
 
I have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfI have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfpratyushraj61
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfpratyushraj61
 
I have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfI have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfpratyushraj61
 
I concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfI concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfpratyushraj61
 
I am wondering if i can implement these use cases to make a google f.pdf
I am wondering if i can implement these use cases to make a google f.pdfI am wondering if i can implement these use cases to make a google f.pdf
I am wondering if i can implement these use cases to make a google f.pdfpratyushraj61
 

More from pratyushraj61 (20)

helphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdfhelphelp Regarding the numerou.pdf
helphelp Regarding the numerou.pdf
 
Hello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdfHello. Im having trouble trying to set the condition where once the .pdf
Hello. Im having trouble trying to set the condition where once the .pdf
 
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdfHenrich is a single taxpayer.  In 2022, his taxable income is $478,0.pdf
Henrich is a single taxpayer. In 2022, his taxable income is $478,0.pdf
 
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdfHi could you focus on the isohyetal method and thiessen polygon me.pdf
Hi could you focus on the isohyetal method and thiessen polygon me.pdf
 
helpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdfhelpppppp((( The difference between an embedded object and a linked.pdf
helpppppp((( The difference between an embedded object and a linked.pdf
 
help on this thanks. Phalaropes are shore birds with brightly col.pdf
help on this thanks.  Phalaropes are shore birds with brightly col.pdfhelp on this thanks.  Phalaropes are shore birds with brightly col.pdf
help on this thanks. Phalaropes are shore birds with brightly col.pdf
 
I have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdfI have an independent food delivery platform having a lot of differe.pdf
I have an independent food delivery platform having a lot of differe.pdf
 
i need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdfi need programingi need programing ai. Create o Va opplication t.pdf
i need programingi need programing ai. Create o Va opplication t.pdf
 
I need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdfI need help with making a program that can be part of a google forms.pdf
I need help with making a program that can be part of a google forms.pdf
 
I need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdfI need help fixing my assembly program please, I keep getting a segm.pdf
I need help fixing my assembly program please, I keep getting a segm.pdf
 
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdfHewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
Hewitt Packaging Companynin �denmemi 14 kupon faiz oranyla 1.000 A.pdf
 
I need an explanation on what the function of the number 1.428 in .pdf
I need an explanation on what the function of the number 1.428 in .pdfI need an explanation on what the function of the number 1.428 in .pdf
I need an explanation on what the function of the number 1.428 in .pdf
 
I need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdfI need help being able to enable different voting types such as publ.pdf
I need help being able to enable different voting types such as publ.pdf
 
I have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdfI have this Koch Python code but isnt working. Can some please revi.pdf
I have this Koch Python code but isnt working. Can some please revi.pdf
 
How do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdfHow do zoned reserves manage relations with local people1. Zone.pdf
How do zoned reserves manage relations with local people1. Zone.pdf
 
I have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdfI have included the person.h file code. 1-4 In a file called functio.pdf
I have included the person.h file code. 1-4 In a file called functio.pdf
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdf
 
I have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdfI have a question regarding extreme value analysis.I fitted a gene.pdf
I have a question regarding extreme value analysis.I fitted a gene.pdf
 
I concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdfI concur, technology is so engrained in our day-to-day activities (w.pdf
I concur, technology is so engrained in our day-to-day activities (w.pdf
 
I am wondering if i can implement these use cases to make a google f.pdf
I am wondering if i can implement these use cases to make a google f.pdfI am wondering if i can implement these use cases to make a google f.pdf
I am wondering if i can implement these use cases to make a google f.pdf
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Recently uploaded (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

I need help coming up with a MIPS program for this.1.3. Overvi.pdf

  • 1. I need help coming up with a MIPS program for this. 1.3. Overview For this assignment you will be writing a program the asks the user to enter a decimal number and stores it in IEEE 754 single-precision floating point representation. You will then parse the IEEE 754 representation to extract the different pieces (sign, exponent, and significand) You do not have to convert the input to IEEE 754 representation manually. Just use the syscall to read a float. This will automatically store the value in IEEE 754 format for you. You can then copy the value to a normal 32-bit register to perform the different bit manipulations to extract each piece. After the initial reading in of the floating point value and moving the value to a standard register you should not use the floating point registers again. Do not use any of the floating point operations to find the sign, or anything else. All of the parsing and calculations should be done using various bit manipulations operations (i.e. bitshifts, maskings, etc). Remember beyond the initial reading of the floating point value and moving it to a standard register your program should not touch the floating point registers again. Your program does not need to handle any of the special cases of floating point numbers like NaN, infinity, -infinity, 0 or -0. 1.4. Task 1: Main Procedure Your first task is to collect is to create a loop for your program. Ask user to enter "Do you want to do it again?" in a Dialog box. Hint: Use syscall 50. If the user answers YES repeat the process. NO or Cancel, exit the program. 1.5. Task 2: Take User Input Procedure void read_float() Next, take user input and store it in memory. Prompt the user to enter a floating point value as a decimal number. Then, store the input value in a single precision floating point register. In a DialogBox (syscall 52), Display a string with info about the program ex: "Welcome to the " and capture a user input. The input should be a floating point number. You MUST store input into memory space (ieee). To do this, first move your captured input from the f0 floating point register to a regular temporary register using the following call: Now, you should be able to store the value into the ieee variable in memory. The procedure should have the following signature: 1.6. Task 3: Print the sign
  • 2. void print_sign(ieee) Your next task is to create a procedure called print_sign that will extract and interpret the sign bit of the IEEE 754 single precision floating point number. The floating point number is the value you collected from Task 2. Your function will take the value as a 32-bit number in a non-floating point register (i.e. $a0). Remember, this value is stored in your ieee memory space. You should use bit manipulations (i.e. shifting, masking, etc) to determine the value of the sign bit. If the sign bit is a 1 your function should print the '-' character. If it is a 0 your function should print the '+' character. The procedure should have the following signature: Remember, the sign bit in an IEEE 754 floating point number is the most significant bit. 1.7. Task 4: Print the exponent void parse_exp(ieee) Your next task is to create a procedure called parse_exp that will extract and interpret the exponent bits of the IEEE 754 single precision floating point number. Your function will take the value as a 32-bit number in a non-floating point register (i.e. $a0). Next it will need to isolate the bits representing the exponent and interpret those bits as an unsigned integer. Finally, you will need to subtract the bias to recover the true exponent value as a signed integer. This is the value that should be returned. The procedure should have the following signature: Remember the exponent is the 8 bits immediately following the sign bit. 1.8. Task 5: Print the significand void print_significand(ieee) Your next task is to create a procedure called print_significand that will extract the mantissa of the IEEE 754 single precision floating point number. Your function will take the value as a 32- bit number in a non-floating point register (i.e. $a0). Next it will need to isolate the bits representing the mantissa. The procedure should have the following signature: Remember the mantissa is the low order 23 bits and you will need to add the implied 1. 1.9. Task 6: Print value store from Task 2 Finally, print the output you captured in Task 2 in IEEE 32 bit form Here is what i have so far please help # Author: # Date: March 2023 # Description: A program that reads an IEEE 754 single-precision floating-point number in decimal form from the user, and prints its sign, exponent, significand, and hex representation. .macro print_str (%string)
  • 3. la $a0, %string li $v0, 4 syscall .end_macro .globl read_float, print_sign, parse_exp, print_exp, print_significand, main # Data for the program goes here .data ieee: .word 0 # store your input here again: .asciiz "Do you want to do it again?" prompt: .asciiz "Enter an IEEE 754 floating point number in decimal form: " res_sign: .asciiz "nThe sign is: " new_line: .asciiz "n" expoBias: .asciiz "nExpo with bias: " expoNoBias: .asciiz "nExpo without bias: " manti: .asciiz "nMantissa: " sieee: .asciiz "nIEEE-754 Single Prec: " .text # Code goes here main: loop: print_str(prompt) syscall # pop up gui l.s $f0, 0($v0) # read user input as a float mfc1 $t0, $f0 # copy register $f0 to $t0 sw $t0, ieee # store value in ieee variable in memory jal print_sign # call print_sign procedure jal parse_exp # call parse_exp procedure jal print_exp # call print_exp procedure jal print_significand # call print_significand procedure print_str(sieee) # print IEEE number label mfc1 $t0, $f0 # copy register $f0 to $t0 print_hex_float: # print IEEE number in hex print_str(new_line) li $t1, 8 # 8 nibbles to print li $t2, 0 # counter print_hex_digit: srl $t3, $t0, 28 # shift right 28 bits to get a nibble
  • 4. andi $t3, $t3, 0xf # mask to get the nibble addi $t3, $t3, 48 # add offset to get ASCII code add $t0, $t0, $t0 # shift left 1 bit addi $t2, $t2, 1 # increment counter print_str($t3) # print nibble bne $t2, $t1, print_hex_digit # continue if not done exit_loop: print_str(new_line) print_str(again) syscall # Dialog box with Yes/No/Cancel options beqz $v0, exit_main # cancel or no: exit the program j loop # yes: repeat the loop exit_main: li $v0, 10 # 10 is the exit program syscall syscall # execute call # Procedure void read_float() # Functional Description: Reads input from user using a pop-up GUI. # It stores the captured value in ieee memory space. # Argument parameters: None # Return Value: None read_float In the tool below, "significand" is another name for the mantissa. Input Waldo Weber CS2810 Spring2018 Welcome to the IEEE Parser Enter a decimal number: OK Cancel Exponent 00000000 Significand 1.9.1. Sample Output Negative sign: 0x00000001 Expo with bias: 0x00000081 Expo without bias: 0x00000002 Mantissa: Ox00180000 IEEE-754 Single Prec: 0xc0980000 1.9.1.1. If your answer is YES Continue running the program Negative sign: 0x00000001 Expo with bias: 0x00000081 Expo without bias: 0x00000002 Mantissa: Ox00180000 IEEE-754 Single Prec: Oxc0980000 Expo without bias: 000000002 Mantissa: 0x00180000 IEEE-754 Single Prec:
  • 5. Oxc0980000 Positive sign: 000000000 Expo with bias: 0x00000086 Expo without bias: 0x00000007 Mantissa: Ox00484000 IEEE-754 Single Prec: 0x43484000 1.9.1.2. If your answer is NO Exit the program IEEE-754 Single Prec: 0x43484000 -- program is finished running .-