Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started