Question: Design a mixed assembler / C program with the following functionality. The assembler code starts the application and allocates an array of floating point numbers

Design a mixed assembler/C program with the following functionality. The assembler code starts the application and allocates an array of floating point numbers x1, x2,..., xn in ROM (your choice of at least 5 numbers). This array and its length must be passed to a C function deviation() that returns the standard deviation s of the numbers computed by the following formula
where x is the average of x1, x2,..., xn. The return value of the function must be copied by the assembly code into a variable s allocated in RAM and displayed in terminal window.
Do not use any C library for the square root. Compute it by using Newton-Raphson algorithm.
The algorithm takes a positive real number a and accuracy e from the user's terminal input and computes the square root of a according to the following pseudocode:
1. Initialize x_new = a 2. do x_old = x_new; x_new =(x_old + a / x_old)/2; while |x_old - x_new|/x_new > e
Note that floating point values are returned from C functions in the S0 register.

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 Programming Questions!