Question: 1. Write an MSP430 assembly program that multiplies the corresponding elements of two integer arrays and stores the results in a third array. The arrays

1. Write an MSP430 assembly program that multiplies the corresponding elements of two integer arrays and stores the results in a third array. The arrays need to have at least 6 elements of varying numbers. Your program should implement something similar to the loop below: for (k = 0; k < array_size; k++) array_3[k] = array_1[k] * array_2[k]; This program is responsible for initializing both input arrays, calling two subroutines SW_mult, HW_mult, and allocating the space to store the results calculated by the subroutines. This program is also responsible for passing the required input parameters and address of the memory location reserved to store the result to the subroutines using the program stack. 2. Implement the SW_mult subroutine using the Shift-and-Add multiplication algorithm and the HW_mult subroutine using the Hardware Multiplier to multiply the elements. Store the results for each subroutine in a separate memory location. You may use the same input arrays for both subroutines. 3. Determine the number of clock cycles required to evaluate the equation by each subroutine. How many elements can be evaluated using SW_mult and HW_mult in 1 second? Explain which one is more efficient and why. Show your calculations and explain your reasoning for your answer in your report. 4. Bonus (Each technique 8 pts Total 16pts) Write an MSP430 assembly program that passes a base number (other than 0 or 1) to a subroutine which populates an array with the first 5 powers of that base number. For instance, if you pass the number 6 to the subroutine, the result array should be populated with 6^1, 6^2, 6^3, 6^4 and 6^5. Create subroutines to calculate the results using software and hardware. Use the Shift-and-add multiplication algorithm from Part 1 and for the hardware use hardware multiplier. The parameters and results should be passed between subroutines and main program using either registers or the program stack.

Need the bonus please

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!