FPGAs are great fun, but sometimes you need a few starter projects under your belt. These projects might be something you could just as well do with a CPU, but you have to start somewhere. [LambdaPI] recently shared a 4-bit calculator created using an FPGA, and you can see it in the video below.
The calculator uses a Papilio FPGA board and a LogicStart accessory board for the display and switches. The Papilio normally uses schematic-based entry and Arduino code, but [LambdaPI] used VHDL. You enter the two 4-bit numbers on the 8 switches and then the joystick selects one of four operations (add, subtract, multiply, and divide).
Inside the code, you’ll see that the FPGA does all four calculations at once. The joystick just selects which outputs go to the display. Each module also decodes the LEDs separately which is an interesting design choice. On the negative side, it duplicates a lot of code, but there is no need to change the format with for example division (which shows as a fixed-point decimal number).
We’ve seen Papilio boards doing duty as a 128 MHz Z80 CPU. Or you can use one to create an Ambilight. However, as a first project, this calculator can really fit the bill. If you don’t have any hardware, you could experiment with using EDA Playground.
No comments:
Post a Comment