CS计算机代考程序代写 mips CSCI 2500 — Computer Organization

CSCI 2500 — Computer Organization
Homework 03 (document version 1.0) — Due October 14, 2021

“A déjà vu is usually a glitch in the Matrix. It happens when they change
something.”

� This homework is due by the Midnight EDT on the above date via a Submitty gradeable.

� This homework is to be completed individually. Do not share your code with anyone else.

� Homework assignments are available approximately ten calendar days before they are due.
Plan to start each homework early. You can ask questions during office hours, in the Submitty
forum, and during your lab session.

1 MIPS NxM Matrix Multiplication

This homework will be a repeat of Homework 1, except this time, you’ll be coding it up in MIPS. As
with Homework 1, the input will be two non-square matrices. You’ll read these in from standard
input, dynamically allocate space for these matrices, multiply them, and store them in a new
matrix. Both input matrices as well as the result matrix will also be printed out. For ease of
formatting your matrices, print a single tab character between values in a row and tab+newline
characters at the end of each row.

All inputs (and outputs) will be integers. You don’t need to do any error handling. You can assume
every input is formatted correctly. A code template is provided with functions that you will fill in.
You can’t modify main, but you can otherwise add any additional helper functions that you might
need.

Note that for ease of processing with the autograder, the input format for the matrices is slightly
different. Instead of both N and M dimensions being on the first line of an input file, they will be
separated onto two lines. In addition, two matrices will be stored in a single input file, one listed
right after the other. If we consider the below matrices:

matrix 1 =

[
1 2 3
4 5 6

]
, matrix 2 =


1 23 4

5 6


They would be stored in the input file input1.txt as given on the next page, with the output of
their multiplication via the MIPS program given beneath that.

bash$ cat input1.txt

2

3

1

2

3

4

5

6

3

2

1

2

3

4

5

6

bash$ spim -f hw03.s < input1.txt SPIM Version 8.0 of January 8, 2010 Copyright 1990-2010, James R. Larus. All Rights Reserved. See the file README for a full copyright notice. Loaded: /usr/lib/spim/exceptions.s 1 2 3 4 5 6 1 2 3 4 5 6 22 28 49 64 2 Submission and Grading Criteria For this assignment, you will submit your code to the Submitty gradeable. A code template hw03.s is provided for your convenience. Note: you must submit your code with this filename for the autograding to work. You can not modify the main function. However, you can include any helper functions if you deem them necessary. The below will be the grading criteria for the assignment. 1. Autograding: 80% � Standard visible and hidden test cases 2. TA grading: 20% � Appropriate use of stack, heap, saved registers, calling conventions. � Code is properly formatted, commented (see hw03.s as an example), and consistently follows some MIPS style guidelines (see https://cs233.github.io/mipsstyle.html as an example). � No modifications to main, no abuse of autograder (gratuitous abuse gets a zero). 2 https://cs233.github.io/mipsstyle.html MIPS NxM Matrix Multiplication Submission and Grading Criteria