CSCI 2500 — Computer OrganizationHomework 3 (document version 1.0)Matrix Multiplication in MIPSOverview 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 executeon Submitty to obtain full credit.Homework SpecificationsFor this individual homework assignment, you will again implement matrix multiplication, thistime using MIPS. More specifically, you will read in two matrices from the user and multiply themtogether. As with Homework 1, if you need a refresher in how matrix multiplication works, look ina math textbook or check out Wikipedia!The first matrix is an n × k matrix, while the second matrix is a k × m matrix. Therefore, theresult 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):.datan: .word 4k: .word 3m: .word 4Once 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 ExecutionOn the next page is an example MIPS program execution that you can use to better understandhow your program should work, how you can test your code, and what output formatting to usefor 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 MIPSCSCI 2500作业代写、代写C/C++编程作业、代做Matrix Multiplication in MIPS作业 . And you can assume that theinput 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) runPlease 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)3Error CheckingGiven the complexity of this assignment, you can assume that all input values are valid unsignedintegers. You can also assume that the correct number of values is given for each matrix. In otherwords, you do not need to validate the user input.Submission InstructionsBefore you submit your code, be sure that you have clearly commented your code (this should notbe an after-thought). Further, your code should have a clear and logical organization. Use registersappropriately, 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 thedue date and will include hidden test cases.Also as a reminder, your code must successfully execute on Submitty to obtain credit for thisassignment.转自:http://ass.3daixie.com/2018101830920040.html
讲解:CSCI 2500、C/C++、Matrix Multiplication in MIPSMatlab|Java
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- By clicking to agree to this Schedule 2, which is hereby ...
- 原文链接:machinethink.net/blog/tensorflow-on-ios/ Before you ...
- 学期工作总结 岁月不居,时节如流。一学期就这么走完了,蓦然回首却只能感叹如此的快,以至于现在仍然无法接受就这么的走...
- 了解到,开发微信平台,要对于xml格式有所了解,开始齐头并进吧。 XML, 对于只有html基础来说,Xml数据接...