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 C program
a. Initialize a memory pointer to 02200
b. Initialize a variable to the value 00D.
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 c through h, except perform subtraction
j. Repeat steps c through h, except perform multiplication
k. Repeat steps c through h, except perform division
Repeat steps c through h, except perform the remainder operation (Repeat this step writing the remainder operator only using the other 4 operators.)
m. 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 = input1% input2).
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 00D and switch inputs are 0x0B (add),0x9(subtract),0x7(multiply),0x6(divide), and 0x5(remainder)
 Need help with this c program, it needs to be on

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!