Question: Part 1 : Coding Task you need to write two subroutines The project is about finding the mean ( i . e . , E
Part : Coding Task you need to write two subroutines
The project is about finding the mean ie Ecosx and mean square ie Ecosx of the
cosine function.
You are asked to write two subroutines called arrayaverage and arraysquareQm whose
contracts are given in the file projectasm posted to Carmen. Download this file and add your
code to it as indicated. This asm file comes with the test code and three subroutines that you will
use when computing the average and do the squaring. You are not allowed to modify any of the
code that is already provided in the file project.asm.
The subroutine arrayaverage takes a pointer to an array of bit signed numbers and the
number of elements in the array of length and returns the average of the values in the array.
This subroutine will call the two subroutines xdivpowerP and logxbase that are
provided in the asm file on Carmen.
The subroutine arraysquareQm takes two pointers to wordarrays of the same length n
One of the pointers points to an input array with elements x x xn and the other one points
to an output array with elements y y yn Each of the elements x x xn in the input
array is assumed to be a signed bit number with Qvalue m The subroutine
arraysquareQm will compute the square of each of these elements, correct for the Qvalue,
and write the result to the output array. In particular,
#
Recall that if both factors of a multiplication have Qvalue m the product will have Qvalue m If
we want to have the product have Qvalue m we must adjust the product value and divide by m
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
