码迷,mamicode.com
首页 > 其他好文 > 详细

视图系统

时间:2018-10-21 19:41:47      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:red   dia   struct   MIP   man   ica   Once   cal   mis   

CSCI 2500作业代写、代写C/C++编程作业、代做Matrix Multiplication in MIPS作业
CSCI 2500 — Computer Organization
Homework 3 (document version 1.0)
Matrix Multiplication in MIPS
Overview
This homework is due by 11:59:59 PM on Thursday, October 18, 2018.
This homework is to be completed individually. Do not share your code with anyone else.
You must use MIPS for this homework assignment, and your code must successfully execute
on Submitty to obtain full credit.
Homework Specifications
For this individual homework assignment, you will again implement matrix multiplication, this
time using MIPS. More specifically, you will read in two matrices from the user and multiply them
together. As with Homework 1, if you need a refresher in how matrix multiplication works, look in
a math textbook or check out Wikipedia!
The first matrix is an n × k matrix, while the second matrix is a k × m matrix. Therefore, the
result will be an n × m matrix. Use the read_int system call (syscall) to read in n, k, and m,
as well as each unsigned integer matrix value.
One approach you could take is to store these important values in your .data section as follows
(with sample hard-coded values shown):
.data
n: .word 4
k: .word 3
m: .word 4
Once you have your matrix sizes defined, dynamically allocate memory to store the actual matrices.
This would be equivalent to calling malloc() or calloc() in C to allocate memory on the heap.
And remember that each integer is one word (or four bytes) in size.
Example Program Execution
On the next page is an example MIPS program execution that you can use to better understand
how your program should work, how you can test your code, and what output formatting to use
for Submitty. Also use test cases from Homework 1 to test your MIPS code.
Note that you must input each value on a separate line in MIPS. And you can assume that the
input given to your program is valid.
When displaying a matrix, each line must start with ‘[’ and end with ‘]’ (as with Homework 1),
but in this assignment, left justify the columns by using TAB (‘\t’) characters as follows:
[12\t34\t5567\t]
[8\t9\t123\t]
[45\t67\t8\t]
[9\t10\t11\t]
This will display this 4 × 3 matrix as follows:
[12 34 5567 ]
[8 9 123 ]
[45 67 8 ]
[9 10 11 ]
2
(spim) load "hw3.s"
(spim) run
Please enter values for n, k, and m:
Please enter values for the first matrix (4x3):
Please enter values for the second matrix (3x4):
[10 20 30 ]
[40 50 60 ]
[70 80 90 ]
[100 110 120 ]
multiplied by
[0 10 0 20 ]
[30 0 40 0 ]
[0 50 0 60 ]
equals
[600 1600 800 2000 ]
[1500 3400 2000 4400 ]
[2400 5200 3200 6800 ]
[3300 7000 4400 9200 ]
(spim)
3
Error Checking
Given the complexity of this assignment, you can assume that all input values are valid unsigned
integers. You can also assume that the correct number of values is given for each matrix. In other
words, you do not need to validate the user input.
Submission Instructions
Before you submit your code, be sure that you have clearly commented your code (this should not
be an after-thought). Further, your code should have a clear and logical organization. Use registers
appropriately, and create reusable procedures (just be sure to manage the stack properly).
To submit your assignment (and also perform final testing of your code), please use Submitty.
Note that the test cases for this assignment will be available on Submitty a few days before the
due date and will include hidden test cases.
Also as a reminder, your code must successfully execute on Submitty to obtain credit for this
assignment.
http://www.daixie0.com/contents/13/1878.html

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:99515681@qq.com 

微信:codinghelp

视图系统

标签:red   dia   struct   MIP   man   ica   Once   cal   mis   

原文地址:https://www.cnblogs.com/helpingmips/p/9826190.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!