Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an algorithm to sort a list of up to 5 numbers. ( Note that you can use brute force to search for the smallest

Create an algorithm to sort a list of up to 5 numbers. (Note that you can use brute force to search for the
smallest number in the list each time through the loop or implement a sorting algorithm.)
Implement the program in a high level language like C, C++, or Java.
Implement the program in MIPSzy Assembly language. Use the high level code as comments to the right
of the Assembly code as the textbook does.
Input works by placing the value to be read in from the input box in memory location 8196 and a 1 in
memory location 8192. If there is no more input a 0 will be placed in memory location 8192. as a space
delimited list.
Results should be written to memory location 8200 which will cause them to be written to the output
window.
Include a comment at the top of the program with your name and Panther id.
Export the file by clicking the "More Options" button and then Export on the right side. That will paste
your program into a small box on the right. Copy and paste that into a text document. Call that document
FirstnameLastnameA3.txt.
Submit FirstnameLastnameA3.txt.
I will show how to work with the input output simulation window during the live Zoom session which can be
watched in the recording if you miss the live class.
Here is a sample of the input and output:
Input: 527831994
Output: 431527899
A sample program to show how to manage input and output is as follows. Type a single digit integer number in
the Input box and run the program.
addi $t0, $zero, 8200 # Output loc
BegLoop:
addi $t6, $zero, 8192 # Input ready?
Iw $t5,0($t6)
beq $t5, $zero, Nolnput
addi $t6, $zero, 8196 # Input loc
Iw $t1,0($t6)
addi $t2, $zero, 1
sw $t2, O($t0) # Output to screen
mul $t2, $t2, $t1 # Times Input
sw $t2,0($t0) # Output to screen
mul $t2, $t2, $t1 # Times Input
sw $t2, O($t0) # Output to screen
mul $t2, $t2, $t1 # Times Input
sw $t2, O($t0) # Output to screen
j BegLoop
Nolnput:
image text in transcribed

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago