Computer Laboratory

ECAD and Architecture Practical Classes

Exercise 2* (Optional)

Behaviour

Add three procedures to hello_world.c: the first prints the hexadecimal value of the current count to the left-most group of 7-segment displays, the second prints the decimal value to the middle group and the third the octal value to the right-most group.

Implementation Advice

Add three output PIOs to your Qsys SoC, one for each of the three groups of 7-segment displays. You will need to select System | Assign Base Addresses after connecting the new PIO slave interfaces to the NIOS data master.

Update toplevel.sv to connect the exported conduits to the appropriate outputs (recall the HDL Example tab in Qsys). An example concatenation of two interfaces (wires) is { HEX7, HEX6 }.

In Eclipse (following Qsys generation), you will need to right click on the BSP project and select NIOS II | Generate BSP, updating the HAL to reflect any changes.

The following array maps each index to the corresponding bit pattern to display that index on one of the 7-segment displays:

Previous  |  Contents  |  Next