Question: Need help with this c program, it needs to be on nios cpu lator and be able to read the memory map as show in
Need help with this c program, it needs to be on nios cpu lator and be able to read the memory map as show in the picture. Implement in a program
a Initialize a memory pointer to
b Initialize a variable to the value
c Write the variable value to the next available memory location
d Read in a new input value from the switches and store it in the next memory location using an offset
e Add the two values from c and d and store the sum in the next memory location using an offset
f Write the sum to the LEDs
g Call delay
h Read the last value stored to memory into a new variable
i Repeat steps through except perform subtraction
j Repeat steps c through h except perform multiplication
k Repeat steps through h except perform division
Repeat steps through except perform the remainder operation Repeat this step writing the remainder operator only using the other operators.
Use different unique variables for every input and for every result.
n Rewrite the remainder operator as its separate function, with two input arguments and a single returned value the remainder input input
o Place program in an infinite loop at the end of your program to take snapshots of your switches, registers, memory map, and LEDs.
Below, complete a sample memory table, assuming the initial value is and switch inputs are xB addxsubtractxmultiplyxdivide and xremainder
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
