It all starts in undergraduate studies. You are introduced Java or C++. You are using these programming languages on a high performance general purpose processor. The first few programs you write are performing basic arithmetic which isn’t computationally demanding. Next, you enter your senior year or your first job where you are interested in developing embedded applications. Now you have to do is decide what processing platform you want to use.
To decide between an FPGA or microcontroller you need to consider what you want to do with it. If you are interested in processing a lot of data then maybe a Field Programmable Gate Array (FPGA) is for you.
What does it mean to be processing a lot of data? The data rate of a system is simply defined as the number of bits per second the system can process. Getting an understanding of the algorithms and capability of the processing platform are required to maximize the data rate of the platform while minimizing cost.
To fully understand the capabilities and advantages of an FPGA we will look at alternatives to the FPGA as a programming platform. We can actually develop a very small microprocessor on the FPGA. A small microprocessor is a great introduction to a Hardware Description Language (HDL). The small microprocessor will also demonstrate how the architecture of a microprocessor will limit the data rate of the platform.
HDL for FPGAs
Backing up for a minute, there are two HDLs that are used to program FPGAs, Verilog and the Very High Speed Integrated Circuit (VHSIC) HDL, or VHDL for short. Verilog is very popular for software programmers that still want the feel of a C like programming language. I personally do not recommend this approach because developing code for an FPGA is fundamentally different than writing C code. For this reason, I think VHDL offers a significantly different feel which reminds you that you are not programming in C or any high level sequential language.
Once we have examples of VHDL in the small microprocessor example we will look at the architecture of the Arduino microcontroller. The Arduino microcontroller is a great alternative to an FPGA, it is low cost and quite the capable embedded processor and there are a lot of applications that the Arduino microcontroller is the better cost effective solution.
After considering the architecture of a small microprocessor and the processor on the Arduino microcontroller. We will switch gears and look at the architecture of the FPGA. To do this we need to look at vendor specific FPGAs since each company, Altera, Xilinx, Microsemi, and Lattice will all make their FPGAs in a different way.
We can then look at how different algorithms map to the FPGA architecture. For example, something as simple as summing a vector of 10 numbers. For the software programmer the solution is obvious, a for loop will do the trick. In VHDL there are many more parameters required to consider before determining the best solution.
What is the best solution or how do we define the best solution? For a small example like summing a vector of 10 numbers we need to make up some scenarios that we would need to sum 10 numbers. Maybe we are performing an image processing technique where a series of video frames are averaged pixel by pixel. Or maybe we are reading the temperature from a sensor and averaging the last 10 readings. Already we have two examples with very different data rates. How does this affect how we design our summation of 10 numbers algorithm?
We can also look at how microprocessor design effects data rate. ARM has opened their cores up for Xilinx so you can experiment with the design; Free ARM Cores. The core could be optimized for summing 10 numbers but for other algorithms the architecture could be limited.
Balance Is Key
The best solution again balances cost and processing power. A small 8-bit microprocessor can average the last 10 temperature readings taken ever second but may have a hard time keeping up with even standard definition streaming video. What if we have High Definition (HD) or 4k video. We will need a processing platform that is capable of significantly higher data rates. The FPGA would be needed for these applications.