Answered step by step
Verified Expert Solution
Link Copied!

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 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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions