Getting Started With FPGA Programming

259

FPGA boards are interesting pieces of computer equipment. They have high processing power like a video card but can be focused to do extremely well on certain projects. This is because they have a unique ability to be reprogrammed with relative ease. Altera FPGA programming is one way to get started using these versatile computer boards.

The program called Quartus Prime Lite Edition will be used to begin programming your Altera FPGA board. Before downloading this, the first step to get started is to have your own computer up to speed. You may use Windows or Linux devices if your equipment supports the minimum system requirements. Having at least 15 gigabytes of unused space on your hard drive is recommended for this tutorial. Windows 7, 64-bit will work fine as will Red Hat, Suse and Ubuntu versions of Linux. You will need to agree with the license agreements.

Once you have Quartus Prime Lite Edition installed the fun can begin. The programming language to be learned first is called Hardware Description Language. There are two variants of this. One is called Verilog DHL and the other is VHDL. What is the difference? The Verilog model is for low-level hardware modeling. The VHDL model is for high-level hardware modeling. Since this is for beginners, you will probably want Verilog DHL. Please keep in mind that Altera FPGA programming can be considered a configuration. That is, there is more than one way to program one of these FPGA computers.

For the first project, open up the Quartus Prime program and open the new project wizard. You can find this by selecting “file” and then “New Project Wizard”. This opens up the first window. Click “NEXT” to begin naming your project. Type in the name you desire. There are no spaces allowed. Many people use underscores between words to make it look a bit more humanly readable. When naming the folder to put this project in, the folder should be one word. Again, no spaces, just to be safe. There is no need to click “NEXT” at this time. Click “FINISH” and you now have your new project started. Quartus Prime will ask you if you want to create your folder. Click “yes” and the project has now officially begun.

What is that you want your FPGA board to do? It is smart to try a simple project first. The first project that some try is to make their board flash an LED. A small step towards the ultimate goal is always a worthy goal to undertake. Once you decide what it is you want to do with your FPGA board, be sure to check if someone else has already done it. Take a look online and you will probably find that image processing is a natural project for FPGAs. As mentioned earlier, an FPGA has power similar to that of a video card. An image processing program is therefore a natural first program to learn.

Getting started with processing an image requires brightness, inversion and threshold operations. What is cool about this is that simulations of a real camera can be done using only code. Using the Verilog DHL code that we mentioned earlier, a model of a camera sensor can be created digitally. The image format to emulate will be “.bmp”. But the .bmp format must be converted first before we can get to the next step. This is because Verilog can not read .bmp images on its own. Therefore a more basic hexadecimal file format will need to be created. Matlab examples can be used to complete this step. You can also find your own bmp to hex converter if you like. The complete code to do this will not be posted here, but suffice it say, this is a great first project. The FPGA board will be able to make adjustments to the image based on the normal parameters. Brightness, inversion, threshold operations and more can be done after learning the right coding sequences.

Digital modeling is a great strength of FPGA boards. Synthetic, that is, “virtual” representations of hardware can be emulated on a FPGA. A second programming project that can emulate other hardware via your FPGA would be nice to learn. What about Verilog coding to create a virtual microcontroller? This is another cool project that you can implement that will teach you the nuts and bolts of how a microcontroller works without having to take one apart. At the same time, learning the binary instructions, which is the most basic part of computation, will be a side benefit of this project. The Verilog code for a microcontroller is divided into two parts. The first is to learn the instruction set architecture of the microcontroller. The second is to learn the design of the microcontroller. In other words, the digital comes first and afterward the physical aspects.

Basic altera FPGA programming is not limited to making an LED flash or emulating a microcontroller. There are myriad other places to start a journey in FPGA programming. Games can be emulated. Believe it or not, license plate recognition can be considered a beginner’s lesson as well. Constructing a pulse width modulator is a useful project for those who have an interest in radio or robotics. As stated, the FPGA board is a powerful device, capable of being transformed into many useful digital or physical objects. The idea of programmable hardware is a real thing thanks to the unique abilities of FPGA boards.

Here are some more tips while starting your first project in FPGA programming. Stay focused. What are the reasons why you want to learn to program FPGA boards? Why did you start learning this particular job or project? Whatever it was that got you started, stick with it. The second tip is to choose the best FPGA board for you. Some will cost a pretty penny while some are not that expensive. The Cyclone IV development board is reasonably priced and a good starter board. It all depends on if a person wants to do this for fun or as a career. If it is just for fun, getting a cheaper board will do to learn the basics mentioned here.

Comments

comments