Find Jobs
Hire Freelancers

Write a MIPS assembly language program which prompts for a user to enter eight floating point numbers and calls read_float to read in numbers and store them in an array.

$30-250 USD

Completed
Posted over 8 years ago

$30-250 USD

Paid on delivery
Write a MIPS assembly language program which prompts for a user to enter eight floating point numbers and calls read_float to read in numbers and store them in an array. Then the program should sort the numbers in the array, and display their sorted array content on the console window. (I have attached a more detailed project overview) Consult the green sheet and the chapter 3 for assembly instructions for floating point numbers. Here is one instruction that you might use: c.lt.s $f2, $f4 bc1t Label1 Here if the value in the register $f2 is less than the value in $f4, it jumps to the Label1. If it should jump when the value in the register $f2 is NOT less than the value in $f4, then it should be: c.lt.s $f2, $f4 bc1f Label1 To load a single precision floating point number (instead of lw for an integer), you might use: l.s $f12, 0($t0) To store a single precision floating point number (instead of sw for an integer), you might use: s.s $f12, 0($t0) The following shows the syscall numbers needed for this assignment. System Call System Call System Call Number Operation Description 2 print_float $v0 = 2, $f12 = float number to be printed 4 print_string $v0 = 4, $a0 = address of beginning of ASCIIZ string 6 read_float $v0 = 6; user types a float number at keyboard; value is store in $f0 8 read_string $v0 = 8; user types string at keybd; addr of beginning of string is store in $a0; len in $a1 ------------------------------------------ C program that will ask a user to enter an integer 10 times and store them in an array. The it sorts the content and prints it out. ------------------------------------------- void main( ) { int arraysize = 10; float array[arraysize]; int position, i = 0; float num, key; while (i < arraysize) { printf("Enter a number:\n"); //read an integer from a user input and store it in num1 scanf("%f", &num); array[i] = num; i++; } //sort the content of the array for (i = 1; i 0 && array[position-1] > key) { array[position] = array[position-1]; position = position-1; } array[position] = key; } printf("The array contains the following:\n"); i = 0; while (i < arraysize) { printf("%f\n", array[i]); i++; } return; } Here are sample outputs (user input is in bold): -- note that you might get some rounding errors
Project ID: 9041887

About the project

1 proposal
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
hi i can help you with this and start now. i have 8+ years in mips programming experience. please reply. thanks ,
$66 USD in 1 day
5.0 (44 reviews)
4.8
4.8
1 freelancer is bidding on average $66 USD for this job
User Avatar
Hi,sir. I was interested when I saw your project. I can complete your project. My skills are C, C++, Academic writing,Matlab & Mathematics, Web scraping,Algorithm. I can help you very kindly. Best regards. Thank you.
$155 USD in 3 days
4.4 (5 reviews)
2.8
2.8

About the client

Flag of UNITED STATES
Chandler, United States
5.0
10
Payment method verified
Member since Dec 4, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.