In this lab, we will program the FPGA on the Nexys2 board to function as a simple hexadecimal calculator capable of adding and subtracting four-digit hexadecimal numbers. We will use a 16- buttom keypad to input hex numbers and the push-buttons on the Nexys2 board to act as operation buttons (+, –, = and clear). The results will be displayed on the four 7-segment displays on the Nexys2 board. The reason we build a hex calculator (rather than a decimal one) is that it makes the 7-segment display operation much simpler. Converting the output to decimal format would require a large amount of additional VHDL code.
Gif of the keyboard working. Addition worked as well, and the result was shown in
hexadecimal format.
hexcalc.vhd
hexcalc.ucf
keypad.vhd
leddec.vhd