SlideShare a Scribd company logo
1 of 7
Download to read offline
I need help getting my mips program completed this are the full instructions with the sample
output (code is at the bottom)
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: Your name
# Date: The date
# Description: Program description
.macro print_str (%string)
la $a0, %string
li $v0, 4
syscall
.end_macro
.globl read_float, print_sign, parse_exp, print_exp, parse_mantissa, print_significand, main,
ieee_to_hex
# Data for the program goes here
.data
ieee: .word 0
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
main:
j loop # jump to the loop
exit_main:
li $v0, 10 # exit program
syscall
loop:
# Task 2: Call read_float()
jal read_float # jump and link to read_float
# Task 3: Call print_sign(ieee)
lw $a0, ieee # load the ieee number
jal print_sign # jump and link to print_sign
# Task 4: Call print_exp(ieee)
lw $a0, ieee # load the ieee number
jal print_exp # jump and link to print_exp
# Task 5: Call print_significand(ieee)
lw $a0, ieee # load the ieee number
jal print_significand # jump and link to print_significand
# Task 6: Print IEEE number in hex
lw $a0, ieee # load the ieee number
jal print_hex # jump and link to print_hex
# Task 1: Try again pop-up
print_str(again) # print the "Do you want to do it again?" message
li $v0, 8 # call the syscall for dialog box (syscall 8)
syscall # execute the call
beq $v0, 6, loop # if yes, repeat the loop
j exit_main # if no, exit the program
# Task 2: Take User Input Procedure
################################################################
# Procedure void read_float()
# Functional Description: Reads input from user using a pop up
# gui. It stores the capture value in ieee memory space
# Argument parameters: None
# Return Value: None
################################################################
# Register Usage:
# $f0: Input float value
# $t0: Temp storage for input value
# $a0: Prompt string address
read_float:
li $v0, 52
la $a0, prompt
syscall
li $v0, 5
syscall
mfc1 $f0, $f0
mfc1 $t0, $f0
sw $t0, ieee
jr $ra
# Task
# Task 3: Print the sign
################################################################
# Procedure void print_sign(ieee)
print_sign:
lw $t0, ieee
srl $t0, $t0, 31
beqz $t0, print_sign_positive
print_str res_sign
li $v0, 1
li $a0, '-'
syscall
j print_sign_end
print_sign_positive:
print_str res_sign
li $v0, 1
li $a0, '+'
syscall
print_sign_end:
jr $ra
# Task 4: Print the exponent
################################################################
# Procedure void print_exp(ieee)
print_exp:
print_str(expoBias)
lw $t1, ieee
andi $t0, $t1, 0x7f800000 # mask out the sign bit and mantissa
srl $t0, $t0, 23 # shift the exponent to the rightmost bit
addi $t0, $t0, -127 # subtract the exponent bias
li $v0, 34 # syscall to print a 32-bit hex number
move $a0, $t0
syscall
print_str(expoNoBias)
lw $t1, ieee
andi $t0, $t1, 0x7f800000 # mask out the sign bit and mantissa
srl $t0, $t0, 23 # shift the exponent to the rightmost bit
li $v0, 34 # syscall to print a 32-bit hex number
move $a0, $t0
syscall
print_str(new_line)
jr $ra
# Task 5: Print the significand
################################################################
# Procedure void print_significand(ieee)
parse_mantissa:
lw $t0, ieee
li $t1, 0x007fffff
and $t0, $t0, $t1
sll $t0, $t0, 1
or $t0, $t0, 0x80000000
mtc1 $t0, $f0
jr $ra
print_significand:
la $a0, manti
print_str($a0)
li $v0, 2
syscall
li $v0, 4
la $a0, new_line
syscall
jr $ra
# Task 6: print value store from task 2
#print output you captured in task 2 in IEEE 32 bit form
print_str sieee
li $v0, 34
lw $a0, ieee
syscall
li $v0, 16
syscall
exit_main:
li $v0, 10 # 10 is the exit program syscall
syscall # execute call 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: 000000081 Expo without bias:
000000002 Mantissa: 0x00180000 IEEE-754 Single Prec: 0xc0980000
1.9.1.1. If your answer is YES Continue running the program Negative sign: 0x00000001 Expo
with bias: 000000081 Expo without bias: 0x00000002 Mantissa: 0x00180000 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:
000000007 Mantissa: 000484000 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 getting my mips program completed this are the full inst.pdf

Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.comHarrisGeorg21
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichWillem van Ketwich
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12Rabia Khalid
 
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 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 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
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...DRVaibhavmeshram1
 
Lesson 9. Pattern 1. Magic numbers
Lesson 9. Pattern 1. Magic numbersLesson 9. Pattern 1. Magic numbers
Lesson 9. Pattern 1. Magic numbersPVS-Studio
 
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
 
C programming language
C programming languageC programming language
C programming languageAbin Rimal
 
GSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comGSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comkopiko85
 

Similar to I need help getting my mips program completed this are the full inst.pdf (20)

Cc code cards
Cc code cardsCc code cards
Cc code cards
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
 
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van KetwichCreating a Fibonacci Generator in Assembly - by Willem van Ketwich
Creating a Fibonacci Generator in Assembly - by Willem van Ketwich
 
keyword
keywordkeyword
keyword
 
keyword
keywordkeyword
keyword
 
17 Jo P May 08
17 Jo P May 0817 Jo P May 08
17 Jo P May 08
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
 
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 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 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
 
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...
 
Lesson 9. Pattern 1. Magic numbers
Lesson 9. Pattern 1. Magic numbersLesson 9. Pattern 1. Magic numbers
Lesson 9. Pattern 1. Magic numbers
 
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
 
Interesting facts on c
Interesting facts on cInteresting facts on c
Interesting facts on c
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
 
C programming language
C programming languageC programming language
C programming language
 
GSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comGSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.com
 

More from allurafashions98

Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf
 Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf
Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdfallurafashions98
 
Current Attempt in Progress Waterway Company uses a periodic inventor.pdf
 Current Attempt in Progress Waterway Company uses a periodic inventor.pdf Current Attempt in Progress Waterway Company uses a periodic inventor.pdf
Current Attempt in Progress Waterway Company uses a periodic inventor.pdfallurafashions98
 
Current Attempt in Progress The comparative balance.pdf
 Current Attempt in Progress The comparative balance.pdf Current Attempt in Progress The comparative balance.pdf
Current Attempt in Progress The comparative balance.pdfallurafashions98
 
Current Attempt in Progress Novaks Market recorded the following eve.pdf
 Current Attempt in Progress Novaks Market recorded the following eve.pdf Current Attempt in Progress Novaks Market recorded the following eve.pdf
Current Attempt in Progress Novaks Market recorded the following eve.pdfallurafashions98
 
Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf
 Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf
Current Attempt in Progress Ivanhoe Corporation reported the followin.pdfallurafashions98
 
Define a class called Disk with two member variables, an int called.pdf
 Define a class called Disk with two member variables, an int called.pdf Define a class called Disk with two member variables, an int called.pdf
Define a class called Disk with two member variables, an int called.pdfallurafashions98
 
Define to be the median of the Exponential () distribution. That is,.pdf
 Define  to be the median of the Exponential () distribution. That is,.pdf Define  to be the median of the Exponential () distribution. That is,.pdf
Define to be the median of the Exponential () distribution. That is,.pdfallurafashions98
 
Dedewine the bridthenes tar this test Choose the conist answet below .pdf
 Dedewine the bridthenes tar this test Choose the conist answet below .pdf Dedewine the bridthenes tar this test Choose the conist answet below .pdf
Dedewine the bridthenes tar this test Choose the conist answet below .pdfallurafashions98
 
Davenport Incorporated has two divisions, Howard and Jones. The f.pdf
 Davenport Incorporated has two divisions, Howard and Jones. The f.pdf Davenport Incorporated has two divisions, Howard and Jones. The f.pdf
Davenport Incorporated has two divisions, Howard and Jones. The f.pdfallurafashions98
 
Data tableRequirements 1. Prepare the income statement for the mon.pdf
 Data tableRequirements 1. Prepare the income statement for the mon.pdf Data tableRequirements 1. Prepare the income statement for the mon.pdf
Data tableRequirements 1. Prepare the income statement for the mon.pdfallurafashions98
 
Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf
 Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf
Current Attempt in Progress Items from Oriole Companys budget for Ma.pdfallurafashions98
 
Data tableAfter researching the competitors of EJH Enterprises, yo.pdf
 Data tableAfter researching the competitors of EJH Enterprises, yo.pdf Data tableAfter researching the competitors of EJH Enterprises, yo.pdf
Data tableAfter researching the competitors of EJH Enterprises, yo.pdfallurafashions98
 
Current Attempt in Progress If a qualitative variable has c categ.pdf
 Current Attempt in Progress If a qualitative variable has  c  categ.pdf Current Attempt in Progress If a qualitative variable has  c  categ.pdf
Current Attempt in Progress If a qualitative variable has c categ.pdfallurafashions98
 
Data tableData tableThe figures to the right show the BOMs for .pdf
 Data tableData tableThe figures to the right show the BOMs for .pdf Data tableData tableThe figures to the right show the BOMs for .pdf
Data tableData tableThe figures to the right show the BOMs for .pdfallurafashions98
 
Data table Requirements 1. Compute the product cost per meal produced.pdf
 Data table Requirements 1. Compute the product cost per meal produced.pdf Data table Requirements 1. Compute the product cost per meal produced.pdf
Data table Requirements 1. Compute the product cost per meal produced.pdfallurafashions98
 
Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf
 Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf
Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdfallurafashions98
 
Daniel, age 38 , is single and has the following income and exnencac .pdf
 Daniel, age 38 , is single and has the following income and exnencac .pdf Daniel, age 38 , is single and has the following income and exnencac .pdf
Daniel, age 38 , is single and has the following income and exnencac .pdfallurafashions98
 
Danny Anderson admired his wifes success at selling scarves at local.pdf
 Danny Anderson admired his wifes success at selling scarves at local.pdf Danny Anderson admired his wifes success at selling scarves at local.pdf
Danny Anderson admired his wifes success at selling scarves at local.pdfallurafashions98
 
CX Enterprises has the following expected dividends $1.05 in one yea.pdf
 CX Enterprises has the following expected dividends $1.05 in one yea.pdf CX Enterprises has the following expected dividends $1.05 in one yea.pdf
CX Enterprises has the following expected dividends $1.05 in one yea.pdfallurafashions98
 
Daring the financial crisis an the end of the firs decade of the 2000.pdf
 Daring the financial crisis an the end of the firs decade of the 2000.pdf Daring the financial crisis an the end of the firs decade of the 2000.pdf
Daring the financial crisis an the end of the firs decade of the 2000.pdfallurafashions98
 

More from allurafashions98 (20)

Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf
 Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf
Current Attempt in Progress. At December 31, 2024, Culiumber Imports .pdf
 
Current Attempt in Progress Waterway Company uses a periodic inventor.pdf
 Current Attempt in Progress Waterway Company uses a periodic inventor.pdf Current Attempt in Progress Waterway Company uses a periodic inventor.pdf
Current Attempt in Progress Waterway Company uses a periodic inventor.pdf
 
Current Attempt in Progress The comparative balance.pdf
 Current Attempt in Progress The comparative balance.pdf Current Attempt in Progress The comparative balance.pdf
Current Attempt in Progress The comparative balance.pdf
 
Current Attempt in Progress Novaks Market recorded the following eve.pdf
 Current Attempt in Progress Novaks Market recorded the following eve.pdf Current Attempt in Progress Novaks Market recorded the following eve.pdf
Current Attempt in Progress Novaks Market recorded the following eve.pdf
 
Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf
 Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf
Current Attempt in Progress Ivanhoe Corporation reported the followin.pdf
 
Define a class called Disk with two member variables, an int called.pdf
 Define a class called Disk with two member variables, an int called.pdf Define a class called Disk with two member variables, an int called.pdf
Define a class called Disk with two member variables, an int called.pdf
 
Define to be the median of the Exponential () distribution. That is,.pdf
 Define  to be the median of the Exponential () distribution. That is,.pdf Define  to be the median of the Exponential () distribution. That is,.pdf
Define to be the median of the Exponential () distribution. That is,.pdf
 
Dedewine the bridthenes tar this test Choose the conist answet below .pdf
 Dedewine the bridthenes tar this test Choose the conist answet below .pdf Dedewine the bridthenes tar this test Choose the conist answet below .pdf
Dedewine the bridthenes tar this test Choose the conist answet below .pdf
 
Davenport Incorporated has two divisions, Howard and Jones. The f.pdf
 Davenport Incorporated has two divisions, Howard and Jones. The f.pdf Davenport Incorporated has two divisions, Howard and Jones. The f.pdf
Davenport Incorporated has two divisions, Howard and Jones. The f.pdf
 
Data tableRequirements 1. Prepare the income statement for the mon.pdf
 Data tableRequirements 1. Prepare the income statement for the mon.pdf Data tableRequirements 1. Prepare the income statement for the mon.pdf
Data tableRequirements 1. Prepare the income statement for the mon.pdf
 
Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf
 Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf
Current Attempt in Progress Items from Oriole Companys budget for Ma.pdf
 
Data tableAfter researching the competitors of EJH Enterprises, yo.pdf
 Data tableAfter researching the competitors of EJH Enterprises, yo.pdf Data tableAfter researching the competitors of EJH Enterprises, yo.pdf
Data tableAfter researching the competitors of EJH Enterprises, yo.pdf
 
Current Attempt in Progress If a qualitative variable has c categ.pdf
 Current Attempt in Progress If a qualitative variable has  c  categ.pdf Current Attempt in Progress If a qualitative variable has  c  categ.pdf
Current Attempt in Progress If a qualitative variable has c categ.pdf
 
Data tableData tableThe figures to the right show the BOMs for .pdf
 Data tableData tableThe figures to the right show the BOMs for .pdf Data tableData tableThe figures to the right show the BOMs for .pdf
Data tableData tableThe figures to the right show the BOMs for .pdf
 
Data table Requirements 1. Compute the product cost per meal produced.pdf
 Data table Requirements 1. Compute the product cost per meal produced.pdf Data table Requirements 1. Compute the product cost per meal produced.pdf
Data table Requirements 1. Compute the product cost per meal produced.pdf
 
Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf
 Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf
Darla, Ellen, and Frank have capital balances of $30,000,$40,000 and .pdf
 
Daniel, age 38 , is single and has the following income and exnencac .pdf
 Daniel, age 38 , is single and has the following income and exnencac .pdf Daniel, age 38 , is single and has the following income and exnencac .pdf
Daniel, age 38 , is single and has the following income and exnencac .pdf
 
Danny Anderson admired his wifes success at selling scarves at local.pdf
 Danny Anderson admired his wifes success at selling scarves at local.pdf Danny Anderson admired his wifes success at selling scarves at local.pdf
Danny Anderson admired his wifes success at selling scarves at local.pdf
 
CX Enterprises has the following expected dividends $1.05 in one yea.pdf
 CX Enterprises has the following expected dividends $1.05 in one yea.pdf CX Enterprises has the following expected dividends $1.05 in one yea.pdf
CX Enterprises has the following expected dividends $1.05 in one yea.pdf
 
Daring the financial crisis an the end of the firs decade of the 2000.pdf
 Daring the financial crisis an the end of the firs decade of the 2000.pdf Daring the financial crisis an the end of the firs decade of the 2000.pdf
Daring the financial crisis an the end of the firs decade of the 2000.pdf
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

I need help getting my mips program completed this are the full inst.pdf

  • 1. I need help getting my mips program completed this are the full instructions with the sample output (code is at the bottom) 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:
  • 2. 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: Your name # Date: The date # Description: Program description .macro print_str (%string)
  • 3. la $a0, %string li $v0, 4 syscall .end_macro .globl read_float, print_sign, parse_exp, print_exp, parse_mantissa, print_significand, main, ieee_to_hex # Data for the program goes here .data ieee: .word 0 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 main: j loop # jump to the loop exit_main: li $v0, 10 # exit program syscall loop: # Task 2: Call read_float() jal read_float # jump and link to read_float # Task 3: Call print_sign(ieee) lw $a0, ieee # load the ieee number jal print_sign # jump and link to print_sign # Task 4: Call print_exp(ieee) lw $a0, ieee # load the ieee number jal print_exp # jump and link to print_exp # Task 5: Call print_significand(ieee) lw $a0, ieee # load the ieee number jal print_significand # jump and link to print_significand # Task 6: Print IEEE number in hex
  • 4. lw $a0, ieee # load the ieee number jal print_hex # jump and link to print_hex # Task 1: Try again pop-up print_str(again) # print the "Do you want to do it again?" message li $v0, 8 # call the syscall for dialog box (syscall 8) syscall # execute the call beq $v0, 6, loop # if yes, repeat the loop j exit_main # if no, exit the program # Task 2: Take User Input Procedure ################################################################ # Procedure void read_float() # Functional Description: Reads input from user using a pop up # gui. It stores the capture value in ieee memory space # Argument parameters: None # Return Value: None ################################################################ # Register Usage: # $f0: Input float value # $t0: Temp storage for input value # $a0: Prompt string address read_float: li $v0, 52 la $a0, prompt syscall li $v0, 5 syscall mfc1 $f0, $f0 mfc1 $t0, $f0 sw $t0, ieee jr $ra # Task # Task 3: Print the sign ################################################################ # Procedure void print_sign(ieee) print_sign:
  • 5. lw $t0, ieee srl $t0, $t0, 31 beqz $t0, print_sign_positive print_str res_sign li $v0, 1 li $a0, '-' syscall j print_sign_end print_sign_positive: print_str res_sign li $v0, 1 li $a0, '+' syscall print_sign_end: jr $ra # Task 4: Print the exponent ################################################################ # Procedure void print_exp(ieee) print_exp: print_str(expoBias) lw $t1, ieee andi $t0, $t1, 0x7f800000 # mask out the sign bit and mantissa srl $t0, $t0, 23 # shift the exponent to the rightmost bit addi $t0, $t0, -127 # subtract the exponent bias li $v0, 34 # syscall to print a 32-bit hex number move $a0, $t0 syscall print_str(expoNoBias) lw $t1, ieee andi $t0, $t1, 0x7f800000 # mask out the sign bit and mantissa srl $t0, $t0, 23 # shift the exponent to the rightmost bit li $v0, 34 # syscall to print a 32-bit hex number move $a0, $t0 syscall print_str(new_line) jr $ra
  • 6. # Task 5: Print the significand ################################################################ # Procedure void print_significand(ieee) parse_mantissa: lw $t0, ieee li $t1, 0x007fffff and $t0, $t0, $t1 sll $t0, $t0, 1 or $t0, $t0, 0x80000000 mtc1 $t0, $f0 jr $ra print_significand: la $a0, manti print_str($a0) li $v0, 2 syscall li $v0, 4 la $a0, new_line syscall jr $ra # Task 6: print value store from task 2 #print output you captured in task 2 in IEEE 32 bit form print_str sieee li $v0, 34 lw $a0, ieee syscall li $v0, 16 syscall exit_main: li $v0, 10 # 10 is the exit program syscall syscall # execute call 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
  • 7. Exponent 00000000 Significand 1.9.1. Sample Output Negative sign: 0x00000001 Expo with bias: 000000081 Expo without bias: 000000002 Mantissa: 0x00180000 IEEE-754 Single Prec: 0xc0980000 1.9.1.1. If your answer is YES Continue running the program Negative sign: 0x00000001 Expo with bias: 000000081 Expo without bias: 0x00000002 Mantissa: 0x00180000 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: 000000007 Mantissa: 000484000 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 .-