1. Homepage
  2. Programming
  3. ECS50 Computer Organization & Machine-Dependent Programming - HW3.1: Matrix multiplication in assembly

ECS50 Computer Organization & Machine-Dependent Programming - HW3.1: Matrix multiplication in assembly

Engage in a Conversation
UC DavisECS50Computer Organization & Machine-Dependent ProgrammingMatrix multiplicationAssembly

Matthew's Stats CourseNana.COM

Time it took Matthew to complete: 3.5 hours (you'll likely be much faster. I tried using macros here and ran into a lot of problems with them) CourseNana.COM

What to Submit CourseNana.COM

matmult.s CourseNana.COM

Starter Code CourseNana.COM

Download StarterCode.zip for the starter code. It should contain CourseNana.COM

main.c
matmult.s (intentionally left empty) Makefile
Tests
CourseNana.COM

Prompt CourseNana.COM

Write a function that implements matrix multiplication in assembly. The function should have the following signature: int** matMult(int **a, int num_rows_a, int num_cols_a, int** b, int num_rows_b, int num_cols_b); CourseNana.COM

If you don't know how to do matrix multiplication, you can find a tutorial at https://www.mathsisfun.com/algebra/matrix- multiplying.html CourseNana.COM

You have been given a C file called main.c that accepts as command line arguments the names of two files that contain the matrices to be multiplied. main.c will read in these matrices, call your function, and then display the result. After it has displayed the result, it will then free the space that has been dynamically allocated. You may NOT edit main.c CourseNana.COM

You have also been given a Makefile that should compile your program. CourseNana.COM

Program Requirements And Restrictions CourseNana.COM

You may NOT use the data section in your solution. Doing so will result in a SCORE OF ZERO You MUST dynamically allocate space for your resulting matrix
Your program
MUST be compilable by the given Makefile. CourseNana.COM

Compiling To A 32-Bit Program On A 64-Bit Machine CourseNana.COM

If you are on a 64-bit machine, you will need to install gcc-multilib to be able to compile to a 32 bit binary. If you are on Ubuntu (or running Ubuntu inside WSL), you can do this by running the following command: sudo apt-get -y install gcc- multilib. CourseNana.COM

Examples Example 1 CourseNana.COM

cat mata/0-test.txt
3
3
470 -192 -539
235 -814 -538
-503 -418 541

https://us.prairielearn.com/pl/course_instance/147529/instance_question/362524469/ CourseNana.COM

CourseNana.COM

2/29/24, 4:52 PM HW3.1 - ECS 50 | PrairieLearn CourseNana.COM

matmult.s CourseNana.COM

not uploaded CourseNana.COM

./matmult.out mata/0-test.txt matb/0-test.txt
-150559 -384480 81146
-239743 -1043315 370572
125456 -155903 361902

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
UC Davis代写,ECS50代写,Computer Organization & Machine-Dependent Programming代写,Matrix multiplication代写,Assembly代写,UC Davis代编,ECS50代编,Computer Organization & Machine-Dependent Programming代编,Matrix multiplication代编,Assembly代编,UC Davis代考,ECS50代考,Computer Organization & Machine-Dependent Programming代考,Matrix multiplication代考,Assembly代考,UC Davishelp,ECS50help,Computer Organization & Machine-Dependent Programminghelp,Matrix multiplicationhelp,Assemblyhelp,UC Davis作业代写,ECS50作业代写,Computer Organization & Machine-Dependent Programming作业代写,Matrix multiplication作业代写,Assembly作业代写,UC Davis编程代写,ECS50编程代写,Computer Organization & Machine-Dependent Programming编程代写,Matrix multiplication编程代写,Assembly编程代写,UC Davisprogramming help,ECS50programming help,Computer Organization & Machine-Dependent Programmingprogramming help,Matrix multiplicationprogramming help,Assemblyprogramming help,UC Davisassignment help,ECS50assignment help,Computer Organization & Machine-Dependent Programmingassignment help,Matrix multiplicationassignment help,Assemblyassignment help,UC Davissolution,ECS50solution,Computer Organization & Machine-Dependent Programmingsolution,Matrix multiplicationsolution,Assemblysolution,