程序代写代做 graph Java html assembly AI assembler Requirements

Requirements
CS10 – Lab 3, Introduction to MARS and MIPS
Matrix Multiply
1. Mac, Windows or Linux PC
2. Java standard edition (SE) version 9 or higher.
3. MARS Java program
Introduction
In this lab, you will use MARS (MIPS Assembler and Runtime Simulator) to write and run a program that reads in a 4 x 4 matrix of numbers stored as an Integer array and multiplies them. You will take the program written for Lab 3 and expand it for this lab. The purpose of this lab is to learn to implement matrix multiply which is the foundation of graphics, machine learning, AI and a great example of nested loops.
As before, if you have any problems running MARS refer to the instructions in Lab 1.
There are two different ways to convert the numbers from ASCII to integers, arithmetic and logic, use whichever method you desire.
Exercise 1
1. Make a new version of lab 3 called “Lab 4”
2. Refresh your memory on how matrices are multiplied: https://www.mathsisfun.com/algebra/matrix-
multiplying.html
3. Convert your vector read routine in Lab 3 to a procedure that reads in a 4×4 matrix.
4. Call this procedure twice to read in two 4×4 matrices.
5. In chapter 4 of your textbook there is an example of MIPS assembly for a floating-point matrix multiply.
Take this example and convert to integer multiply, for example “l.d” becomes “lw” and “mul.d” becomes “mul”. The textbook example is a 32×32 matrix, for this lab you must adjust the stride for a 4×4 matrix.
6. Write out the result row by row as shown below.
7. You will continue to build on this program for the rest of the class so be very neat and comment well.
Same as Lab 3, use only whole numbers (0 – 9).
The input on the screen should look like a matrix just as below:
Row 1: 3 4 2 9
Row 2: 4 6 0 1
Row 3: 5 5 3 3
Row 4: 1 2 3 4
Row 1: 3 4 2 9
Row 2: 4 6 0 1
Row 3: 5 5 3 3
Row 4: 1 2 3 4
(with the matrix values input by the user on the console)
Tom Riordan Page 1 of 2 Revised Jan 2020

CS10 – Lab 3, Introduction to MARS and MIPS The results output on the screen should look like a matrix just as below:
Row 1: 3 4 2 9
Row 2: 4 6 0 1
Row 3: 5 5 3 3
Row 4: 1 2 3 4
Upload your properly running, well commented, finished program to Canvas.
Handy References
• This webpage has a good explanation of programming errors a student made: https://stackoverflow.com/questions/42638491/mips-assembly-matrix-multiplication
• There are several example matrix multiply routines on Github, search around Github to find them.
• https://www.cs.drexel.edu/~jjohnson/fa00/cs570/programs/mips/mmult.asm
• Here is a good example of what not to do: https://stackoverflow.com/questions/55266185/how-can-i-
properly-multiply-two-4×4-arrays-in-mips-assembly-in-row-major-order
• Just in case you are thinking assembly language is a waste of time, look here: https://www.indeed.com/q-MIPS-assembly-jobs.html
• A YouTube video with a lot of talking and a little programming on 2D arrays: https://www.youtube.com/watch?v=KGyQmxkRLjw
Tom Riordan Page 2 of 2 Revised Jan 2020