Question: Write a MIPS assembly code program compatible with MARS for a NxN matrix and VECTOR multiplication that has one inputted matrix and one inputted vector

Write a MIPS assembly code program compatible with MARS for a NxN matrix and VECTOR multiplication that has one inputted matrix and one inputted vector and output is stored to vector_out. write a code below .

Write a MIPS assembly code program compatible with MARS for a NxN

vector in: word 133,134,135,136,137,138,139,140,141,142,143,144 matrix: word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1l, 12 word 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 word 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 word 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 word 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 word 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 word 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84 word 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 word 97, 98, 99,100,101,102,103,104,105,106,107,108 word 109,110,111,112,113,114,115,116,117,118,119,120 word 121,122,123,124,125,126,127,128,129,130,131,132 word 133,134,135,136,137,138,139,140,141,142,143,144 vector out: word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, N: word 12 # Define new line string nline: space: .asciiz"" msga: asC11z msgb:.asciiz msgc:.asciiz . asciiz # Define space string "Input Matrix is: n" "Input Vector is: n" "Output Vector is: " . text .globl main Ma12. Ss0, 0 (s0) $sl, matrix $s2, vector_in s3, vectorout # Get address of variable N # Get value of N # Get address of input matrix # Get address of input vector # Get address of output vector $a0, msga Sal, matrix PRINT_MAT jal # Call PRINTFUNC with two arguments, msga and matrix - al, vector_in PRINT VEC jal # Call PRIN FUNC with two arguments, msgb and input vector vector in: word 133,134,135,136,137,138,139,140,141,142,143,144 matrix: word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1l, 12 word 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 word 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 word 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 word 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 word 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 word 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84 word 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 word 97, 98, 99,100,101,102,103,104,105,106,107,108 word 109,110,111,112,113,114,115,116,117,118,119,120 word 121,122,123,124,125,126,127,128,129,130,131,132 word 133,134,135,136,137,138,139,140,141,142,143,144 vector out: word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, N: word 12 # Define new line string nline: space: .asciiz"" msga: asC11z msgb:.asciiz msgc:.asciiz . asciiz # Define space string "Input Matrix is: n" "Input Vector is: n" "Output Vector is: " . text .globl main Ma12. Ss0, 0 (s0) $sl, matrix $s2, vector_in s3, vectorout # Get address of variable N # Get value of N # Get address of input matrix # Get address of input vector # Get address of output vector $a0, msga Sal, matrix PRINT_MAT jal # Call PRINTFUNC with two arguments, msga and matrix - al, vector_in PRINT VEC jal # Call PRIN FUNC with two arguments, msgb and input vector

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!