Question: Use Mips to solve Problem 3: Vector Matrix Multiplication (20 Marks) Given a MxN matrix A and an N dimensional vector x. Matrix Vector product

Use Mips to solve Use Mips to solve Problem 3: Vector Matrix Multiplication (20 Marks) Givena MxN matrix A and an N dimensional vector x. Matrix Vector

Problem 3: Vector Matrix Multiplication (20 Marks) Given a MxN matrix A and an N dimensional vector x. Matrix Vector product of Ax=B is shown below: For example: A = AI A12 Aiz A23 ; X = (*., *2 , *3) A21 A22 A12 All .XI + Arz.X + A13 X3 AX Aiz A23 S Azi A22 Xi X2 X3 A21. Xi + A22. X2 + A23. ; for A= 1 - 1 2 1 and X = (2, 4,0) 0 -3 1 2 11.2 1 2 11 - Ax 5 + (-1). 1 t 2.0 + (-3), 1 + 1.0 0.2 0 1 -3 o Perform the matrix vector multiplication by assuming the following: 1. Size of the matrix (M, N) is written in the memory at address 0x10010000 and Ox 10010004. 2. Starting the from the very next location 0x10010008, matrix A is written in row-major order in contiguous memory location. 3. After the matrix A, the vector X is written in contiguous memory locations. 4. Store the result vector B from the very next location after the Input vector X ends. You can test your program using given Matrix A and vector x below. A= 1 2 3 6 4 5 x=(1, 2, 3) Output vector B = (14, 32) Problem 3: Vector Matrix Multiplication (20 Marks) Given a MxN matrix A and an N dimensional vector x. Matrix Vector product of Ax=B is shown below: For example: A = AI A12 Aiz A23 ; X = (*., *2 , *3) A21 A22 A12 All .XI + Arz.X + A13 X3 AX Aiz A23 S Azi A22 Xi X2 X3 A21. Xi + A22. X2 + A23. ; for A= 1 - 1 2 1 and X = (2, 4,0) 0 -3 1 2 11.2 1 2 11 - Ax 5 + (-1). 1 t 2.0 + (-3), 1 + 1.0 0.2 0 1 -3 o Perform the matrix vector multiplication by assuming the following: 1. Size of the matrix (M, N) is written in the memory at address 0x10010000 and Ox 10010004. 2. Starting the from the very next location 0x10010008, matrix A is written in row-major order in contiguous memory location. 3. After the matrix A, the vector X is written in contiguous memory locations. 4. Store the result vector B from the very next location after the Input vector X ends. You can test your program using given Matrix A and vector x below. A= 1 2 3 6 4 5 x=(1, 2, 3) Output vector B = (14, 32)

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!