
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Page 1 of 1
switches, and LEDs.
Note 1: Use Lab 4’s sof and ptf files.
Note 2: KEY0 is processor’s reset. KEY1 (called button1 in Nios II) is level-sensitive button. KEY2 is rising-edge sensitive button. KEY3 is rising-edge with interrupt button.
Note 3: Create a Hello World C/C++ Nios II Application project, compile this project to obtain the system.h. system.h is in your_project_name_syslib debug system_description system.h. Then, add your sources to the project. Remember, you can’t have more than one main in a project!
Debug ( Use Debug As Nios II Instruction Set Simulator ) the following source files. Document your understanding of the given source files by commenting everything. You will/might need references in this page: http://coen.boisestate.edu/smloo/ece332fall2007/tutorial.htm. In the debugger, use “ Step Into ” and/or “ Step Over ”. Observe the assembly code in the Disassembly window and memory usage in the Memory Monitor.
Example of a commented line:
typedef unsigned char byte; // make our own data types
Question: There is a main in our source code. Why is there an alt_main in debug session?
The sources files you need to comment are: a. types.c b. suspect.c c. main.c, sub1.h, sub1.c, sub2.h, and sub2.c.
This segment of code use pointer to read from switches and display the read value to red (led_switches.c).
Assignment: You need to convert the value from the switches to BCD and display this value to seven-segment LEDs.