What is FPGA? A must read for electronics enthusiasts

Introduction to FPGAs: Making Hardware Programmable as Software

Have you ever wondered what it would be like to have hardware as flexible and programmable as software? FPGA (Field-Programmable Gate Array) is just such a magical electronic component, which breaks the limitations of traditional hardware design and brings revolutionary changes to electronic product development.

The core definition of FPGA: FPGA is a kind of integrated circuit that can be reprogrammed and configured by the user on the spot after manufacturing, which allows designers to ‘draw’ the required digital circuits according to the application requirements without having to go through the tedious process of chip manufacturing.

Unlike ordinary processors (CPUs), FPGAs do not execute pre-written programmes, but rather reconfigure their hardware structure to achieve specific circuit functions. This unique feature makes FPGAs excel in many high-performance computing areas and real-time processing applications.

For beginners in electronic engineering, understanding FPGAs may be a bit abstract, but a simple analogy can be used: if the traditional integrated circuit is a printed book, the content of which is fixed; then FPGAs are like an e-book that can be rewritten at any time, and you can change its ‘content’ (circuit structure) at any time according to your needs.

FPGA Internal Structure: Digital Lego Building Blocks

The internal structure of FPGA can be compared to a huge ‘digital Lego’ building system, which contains the following three basic resources:

1. Programmable Logic Function Blocks
These are the basic building blocks of FPGAs, similar to the basic building blocks of Lego. These logic blocks have different names in different vendors’ FPGAs:

Intel (Altera) calls it LE (Logic Element)
Xilinx called Slice or CLB (Configurable Logic Block).
Each logic function block usually contains a look-up table (LUT), several triggers and some multiplexers and other components. The lookup table can implement any combination of logic functions, while the flip-flop is used to store state and implement timing logic.

2. Programmable internal interconnect resources
These are the ‘wires’ and ‘switches’ that connect the logic blocks, similar to the connections between Lego blocks. These interconnect resources can be configured to connect scattered logic blocks into complex circuit systems. These interconnect resources include:

Wire segments of various lengths
Programmable connection switches
Switching matrices

3. programmable input/output (I/O) blocks

These I/O blocks are located at the periphery of the FPGA and are responsible for communicating between the FPGA’s internal logic and the external world. They can be configured to various electrical standards and support different levels and interface protocols.

In addition to the basic resources, modern FPGAs integrate a number of specialised functional modules, such as:

Embedded memory (Block RAM): used to store data
DSP module: for high-speed mathematical calculations
High-speed transceivers: for high-speed data transfer
Clock management unit (PLL, DLL): for clock processing and distribution
Even embedded processors: e.g. ARM core
Difference between FPGA, CPU and GPU: a triad of computing power
The best way to understand the uniqueness of FPGAs is to compare them to other common processor types. Below we compare FPGAs with CPUs and GPUs:

Characteristics FPGA CPU GPU

Architecture Nature Reconfigurable hardware Fixed hardware + general purpose instruction set Fixed hardware + graphics instruction set
Processing Parallel hardware circuit implementation Serial instruction execution Massively parallel computing
Flexibility Hardware level reprogrammable Software level programmable Software level programmable (limited)
Real-time Excellent (nanoseconds) Fair (microseconds) Good (but fluctuating)
Power efficiency High (specific tasks) Fair High (massively parallel tasks)
Development Difficulty High (hardware knowledge required) Low Medium
Typical applications Signal processing, control systems General purpose computing, operating systems Graphics rendering, neural networks

The biggest difference between FPGAs and microcontrollers or CPUs is that FPGAs design circuits, while microcontrollers design programmes. While a microcontroller has only one CPU that executes the programme sequentially driven by the operating clock, FPGAs are designed to be an entire circuit logic system where all the parts can work in parallel at the same time.

A simple example: if you want to implement a simple ‘with the gate’ logic (A AND B = Y), the CPU needs to read the input A, read the input B, the calculation of AND results, the output results Y; and FPGA is directly a with the gate circuit, the output of the input changes in the immediate response, without having to wait for the instruction to be executed.

Advantages and Disadvantages of FPGA

Advantages of FPGA

1. Highly Parallel Processing Capability

The hardware parallelism of FPGAs allows them to process multiple signals and perform multiple operations at the same time without being limited by CPU instruction cycles. In scenarios where massively parallel processing is required, the performance of FPGAs can far exceed that of general-purpose processors.

2. Low Latency and Deterministic Timing

FPGAs provide nanosecond processing latency and precise timing control, which is especially suitable for applications with very high real-time requirements, such as industrial control and radar systems.

3. Flexible and reconfigurable

The core advantage of FPGA is its programmable feature, which allows you to change the hardware function at any time without replacing the physical chip. This makes the product iteration and function update become more flexible.

4. High energy efficiency

For specific algorithms, FPGAs enable customised hardware acceleration and lower energy consumption compared to general-purpose processors. In some applications, FPGAs can be 10-30 times more energy efficient than CPUs.

5. Long Life Cycle

FPGA products typically have 10-15 years of lifecycle support, far more than most CPUs and GPUs, making them particularly suitable for long-running industrial and military systems.

Disadvantages of FPGAs

1. High development threshold

FPGA development requires knowledge of hardware description languages (e.g., Verilog or VHDL) and digital circuit design, with a steeper learning curve. Compared to software programming, hardware circuit design thinking requires a longer adaptation period.

2. Long development cycle

The FPGA design process includes multiple steps such as coding, synthesis, implementation and burn-in, and each modification requires recompilation, making development efficiency lower than software development. For complex designs, the synthesis and implementation process can take hours.

3. Higher cost

High-end FPGAs can cost thousands of dollars, and development tools and IP core licences require additional investment. Often ASICs are a more economical choice if the volume of production is large enough.

FPGA Application Areas: Ubiquitous Hardware Accelerators

FPGAs have demonstrated strong application value in several areas due to their unique characteristics. The following are a few major application scenarios:

1. Communication system
FPGAs are widely used in the communication field, especially in wireless base stations, network equipment and optical fibre communication. They can efficiently implement functions such as digital signal processing, protocol conversion and interface adaptation.

Specific applications: baseband processing, channel coding and decoding, wireless base stations, network switches, high-speed serial interfaces and so on.

2. Digital Signal Processing
FPGA’s parallel processing capability makes it an ideal platform for digital signal processing, especially for the need for high-speed real-time processing scenarios.

Specific applications: high-speed filters, audio/video processing, radar signal processing, software-defined radio and so on.

3. Video Image Processing
With the growth of high-definition video and image demand, the high-speed parallel processing capabilities of FPGAs play an important role in video codecs and image processing.

Specific applications: video codec, image enhancement, surveillance systems, medical imaging, etc.

4. Artificial Intelligence and Machine Learning
FPGA can provide efficient hardware acceleration for AI inference and specific machine learning algorithms, especially in edge computing scenarios.

Specific applications: neural network accelerators, intelligent surveillance, autonomous driving systems, edge AI, etc.

5. Industrial control and automation
Industrial automation equipment requires high-precision timing control and real-time response, which is the strong point of FPGA.

Specific applications: robot control, factory automation, motor drive, precision instruments, etc.

6. Prototyping and Verification
FPGAs are commonly used in ASIC (Application Specific Integrated Circuit) prototyping and function verification, which can find and fix problems before production.

Specific applications: chip prototyping, system proof-of-concept, algorithm acceleration, etc.

FPGA Development Board Selection

For beginners, choosing a suitable development board is the first step in learning FPGA. Here are a few FPGA development boards that are suitable for getting started:

1. Digilent Basys 3

  • FPGA: Xilinx Artix-7 (XC7A35T)
  • Best for: Students and hobbyists
  • Features: USB programming, switches, buttons, LEDs, VGA, Pmod connectors
  • Software: Free use of Xilinx Vivado WebPACK
  • Price: ~$150
  • Why it’s good: Great documentation and designed for learning.

2. Terasic DE10-Lite

  • FPGA: Intel MAX 10 (10M50DAF484C6GES)
  • Best for: Learning Intel/Altera FPGAs
  • Features: LEDs, switches, 7-segment displays, Arduino headers
  • Software: Free Quartus Prime Lite
  • Price: ~$100
  • Why it’s good: Good starter for Intel FPGAs with solid community support.

Considerations for choosing a development board

FPGA chip resources: for beginners, do not need too high-end chip, entry-level small capacity FPGA is enough to learn the basics
Peripherals and interfaces: it is recommended to choose a development board with LEDs, buttons, switches, displays and other basic peripherals, easy to do simple projects
Learning resources: see whether the development board has enough learning materials, sample projects and community support
Cost-effective: FPGA development boards vary greatly in price, the initial stage can choose 300-1000 yuan of entry-level products

For learning purposes, the board should also cover as many of the following basic elements as possible:

Simple input devices (e.g. buttons, switches)
Simple output devices (such as LEDs, digital tubes)
Clock source (e.g. crystal)
Memory devices (e.g. RAM, Flash)
Communication interfaces (e.g. UART, USB)

FPGA Learning Path

If you decide to learn FPGA, here is a suggested learning path:

1. Build a good foundation
Basic digital circuits: learn the basic concepts of logic gates, flip-flops, state machines, etc.
Hardware description language: choose Verilog or VHDL to learn (recommended that beginners learn Verilog first)
Tool chain familiar: learning to use Xilinx Vivado or Intel Quartus and other development tools

2. Hands-on
Basic projects: LED blinking, key control, counters and other simple projects.
Intermediate projects: UART communication, VGA display, simple processor design.
Advanced projects: SoC design, high-speed interface implementation, special accelerator, etc.

3. In-depth study
Timing analysis: learning the concepts of clock domain, build time, hold time, etc.
Advanced design techniques: pipelining, state machine optimisation, resource sharing, etc.
IP core development and use: learning how to integrate and develop IP cores
Learning advice: FPGA learning is a step-by-step process, do not try to do complex projects at the beginning. Start with simple LED control and gradually increase the complexity of the project so as to build a solid foundation and really understand the essence of FPGA design.

Summary: Plastic material for the digital world

FPGA, as a kind of programmable hardware, provides unprecedented flexibility for digital circuit design. It has both the high-performance characteristics of hardware and software-like configurability, making it a bridge between the hardware and software worlds.

With the booming development of artificial intelligence, 5G communication, IoT and other technologies, FPGA is playing an important role in more fields due to its parallel computing capability, low-latency characteristics and energy efficiency advantages. Especially in edge computing and real-time control systems, FPGA is becoming an indispensable hardware acceleration platform.

Although there is a certain learning threshold for FPGA development compared to traditional software development, FPGA development is becoming more accessible with the development of advanced synthesis tools and high-level design methodologies. For electronic engineering enthusiasts and professionals, mastering FPGA technology is certainly a skill worth investing in.

Hopefully, this article will open the door to FPGAs and help you take your first steps in learning FPGAs. Remember, in the world of digital design, FPGAs give us the magic of ‘hardware-as-code’, giving us the freedom to shape the way the digital world works.

Frequently Asked Questions (FAQ)

What is the difference between FPGA and CPLD?

FPGAs and CPLDs are both programmable logic devices, but FPGAs usually have more logic resources and more complex architectures. CPLDs are based on EEPROM technology internally, do not lose configuration when power is lost, and have fast startup speeds, while FPGAs are based on SRAM technology, which requires external configuration but has a larger logic scale, making it more suitable for complex system design.

What preparatory knowledge is needed to learn FPGA?

It is best to learn FPGA with basic digital circuits, basic computer composition principles, and certain programming experience. Understanding basic logic gates, flip-flops, state machines and other concepts will make the learning process smoother.

Is FPGA suitable for individual hobbyists?

FPGAs have become more and more suitable for individual hobbyists as the prices of entry-level development boards have come down and learning resources have become more plentiful. There are many reasonably priced starter kits and free development tools available.

Which is better to learn, Verilog or VHDL?

For beginners, Verilog is usually easier to get started with a syntax similar to C, while VHDL is more rigorous but has a steeper learning curve. Verilog is more widely used in China and the U.S., while VHDL is preferred in Europe, and it is recommended that beginners learn Verilog first.

What is the job outlook for FPGA development?

With the development of AI, 5G, autonomous driving and other technologies, the demand for FPGA talents is growing. Engineers who master FPGA technology have good employment opportunities in fields such as communications, aerospace, medical devices, and high-performance computing, and salary levels are generally higher than those of general software development positions.

Related Resources

To learn more about FPGAs, please visit the following links: FPGA Product Catalogue – JAK Electronics