The Digital Electronics FPGA Board for ELVIS alows students to program a Xilinx Spartan-III FPGA from LabVIEW, Xilinx ISE or a digital Multisim schematic. This example takes advantage of some of the built in I/O, namely a bank of four push buttons and a two digit seven segment display.
The code (written in LabVIEW) allows you to push button 1 to add 1, push button 2 to add 5 or push button 3 to add 10 to a counter. Holding down button 4 while pressing any of these subtracts the appropriate value. The current value of the counter is displayed on the seven segment display.
The code achieves this by first waiting on a button press. Once it detects this it adds the appropriate value to the internal counter (this exists as a shift register in LabVIEW). Then we use a remainder and quotient function to divide by ten and give us the correct values for the first and second digit of the seven segment display. We then select the correct LED combinations from a look up table (Stored as a 1D array in this code). Finally we must wait for the button to be released to make sure we don't get multiple counts.
The code is attached in LabVIEW 2010 (the latest version that supports this board).
Future Challenges
There are a couple of things that could be done to extend this:
If you do have a chance to take on these challenges do post your code, I would be very interested in seeing it.