During my engineering college days, I was often captivated by the power of FPGA when I was doing some research work using Verilog/VHDL code on things like Fast Multipliers on Xilinx FPGA boards one of which I still possess in my hobby electronics cardboard boxes lying in peace for few years now since I left doing that.
Often I think about the differences of FPGA vs a CPU and a GPU. In this post, let me put forward my understanding on this in the form of differences.
One of the FPGA Development Board |
FPGA:
- Can compute faster with Low Latency of up to 1 microsecond.
- They can be directly connected to Inputs. Data sources like sensors, network interfaces, etc can be directly connected to FPGA pins. Thus, this provides very high bandwidth and is utilized in Radio Astronomy, Aeroplanes and Rocket science, Military applications where a large volume of sensor data need to be processed before sending it to downstream application for summary analysis.
- Much Harder to program, hence much higher engineering cost compared to Instruction based architecture CPU or GPUs.
- Verilog or VHDL is used to program FPGA. Even though High Level Synthesis allows usage of common programming languages like OpenCL and C++, still it is much difficult and time consuming due to complexity.
- Very Long Compilation time.
- Doesn’t require a Host to run since it has its own input and output pins.
- Most suitable for special purpose computing needs. Due to specialized computing needs, design is optimized and hence gives good performance.
- Capable of having higher level of parallelism compared to CPUs.
CPU or GPU
- With CPU, Latency around 50 microseconds is considered as Good. However latency of GPU vs FPGA is debatable depending of the type of usage being programmed into it.
- These cannot be connected directly to any data source like Sensors, Network interfaces, Storage devices, etc. It has to be connected via a Bus like USB/PCIe, etc.
- Easy to program compared to FPGAs.
- Can be programmed via any standard programming languages like C, C++, Java, Python, etc.
- Faster compilation time.
- Need a Host computer to run.
- Most suitable for General Purpose Computing.
- Comparatively lesser level of parallelism can be obtained compared to FPGAs.
- GPUs are sometimes claimed to be much faster than FPGAs, This is a good topic of debate in the industry depending of the application for which GPUs are being used for. This is because, for a specialized set of tasks or algorithms, FPGAs can do computations more faster and economically.
I hope you found this post interesting. Let me know your thoughts.