What Is an FPGA? Field-Programmable Gate Arrays, Uses and Applications

Written by Sciotex Engineering
In this article

An FPGA (field-programmable gate array) is a chip made of programmable logic blocks and wiring that you configure after manufacture to become a custom digital circuit. Because the design runs as hardware rather than as instructions on a processor, an FPGA can do many operations in parallel with timing that is exact to the clock cycle. That makes it the right tool for high-speed data acquisition, real-time control and precise triggering, and the wrong tool for general-purpose computing.

This article explains how FPGAs work, how they compare with CPUs, GPUs and PLCs, and where they are used in industrial and scientific systems. If you are planning a system that needs one, see our FPGA software and systems page.

How an FPGA works

A processor reads instructions one after another. An FPGA has no instruction stream: its logic blocks and routing are configured into the circuit you designed, and every part of that circuit runs at the same time on each clock tick. A configuration file, called a bitstream, is loaded at power-up and can be replaced later, so the same chip can take on a new function without new hardware.

Building blockWhat it doesWhy it matters
Look-up tables (LUTs)Implement any small logic function of a few inputsThe basic fabric from which all custom logic is built
Flip-flops (registers)Store one bit per clock cycleCreate pipelines so long calculations still run at full clock rate
DSP slicesHardened multiply-accumulate unitsFast filters, FFTs and control math without using general logic
Block RAMSmall, fast on-chip memoriesBuffers, FIFOs and lookup tables close to the logic that uses them
Clock managementGenerates and aligns internal clocksDeterministic timing and phase-aligned sampling
I/O and transceiversConnect to ADCs, DACs, digital lines and high-speed linksDirect, low-latency access to sensors and actuators

FPGA vs CPU, GPU, PLC and ASIC

Most systems use an FPGA alongside a processor, not instead of one. The FPGA handles the time-critical, high-rate work at the edge of the hardware, and the processor runs the user interface, data storage and higher-level logic.

CPUGPUPLC or microcontrollerFPGAASIC
TimingVaries with the operating systemBatch-oriented, variableScan-cycle based, milliseconds typicalExact to the clock cycleExact to the clock cycle
ParallelismA few coresThousands of threadsLimitedTrue hardware parallelismTrue hardware parallelism
Best atGeneral software, UI, databasesLarge neural networks and image batchesSequencing and machine logicHigh-rate I/O, triggering, control loops, preprocessingVery high volume fixed functions
Development effortLowMediumLowHighVery high
Change after deploymentEasyEasyEasyReload the bitstreamNot possible

For image processing specifically, our comparison of GPU vs CPU vs FPGA for machine vision goes deeper.

Worked examples: why timing and bandwidth matter

A deterministic control loop

At a 100 MHz clock, one cycle is 10 ns. A control calculation pipelined over 40 cycles produces a new output 400 ns after each input sample, every time. A loop running in software on a desktop operating system can be delayed by a millisecond or more when the system is busy, which is thousands of times longer. Where a laser, valve or motor must respond within microseconds, that difference decides whether the system works.

Reducing data at the source

Eight channels sampled at 2 MS/s with 16-bit resolution produce 8 × 2,000,000 × 2 bytes = 32 MB/s of raw data. If the FPGA computes an RMS value for every block of 1,000 samples, it sends only 16,000 values per second, or 64 kB/s at 4 bytes per value: a 500-fold reduction. The host computer stores and displays results instead of struggling to keep up with raw samples. See high-speed data acquisition for the rest of the signal chain.

How FPGAs are programmed

  • Hardware description languages (VHDL and Verilog). The circuit is described in text, then synthesized, placed and routed into a bitstream. This gives the most control and the most efficient designs.
  • High-level synthesis (HLS). Algorithms are written in C or C++ and converted to hardware. Faster for math-heavy blocks, but timing and resource use still need an engineer who understands the hardware.
  • LabVIEW FPGA. Graphical programming for NI hardware such as CompactRIO and FlexRIO. It suits measurement and control systems where the FPGA, the real-time processor and the host application are developed together.

Compiling an FPGA design can take from minutes to hours, so a good project simulates and verifies logic before every build, and keeps as much of the application as possible in software on the host.

FPGA uses and applications

ApplicationWhat the FPGA does
High-speed data acquisitionSamples many channels in lockstep, filters, decimates and timestamps data before it reaches the host
Real-time and closed-loop controlRuns control loops at kilohertz to megahertz rates with fixed latency
Automated test and hardware-in-the-loopGenerates and measures signals at precise times and simulates sensors or plants for the device under test; see hardware-in-the-loop testing
Machine vision preprocessingHandles camera interfaces, triggering, filtering and region extraction before images reach a GPU or CPU
Scientific instrumentationSynchronizes lasers, galvo mirrors, stages and cameras for advanced microscopes; see microscope hardware synchronization
Aerospace and defense testPrecise timing and high channel counts in systems such as gyroscope test stations
Signal processing and communicationsDigital filters, FFTs, modulation and protocol handling at line rate
PrototypingProves a custom digital design in hardware before committing to an ASIC

Sciotex has used FPGAs in gyroscope test stations, fill and test control for ring laser gyros, high-speed laser triggering and galvo mirror control for microscopes, and two-photon and light sheet microscope systems.

When an FPGA is the right choice

  • Response times must be microseconds or less, every time.
  • Many channels must be sampled or controlled in exact synchronization.
  • The raw data rate is too high to send to a computer, so it must be reduced at the source.
  • Custom digital interfaces or triggering are needed that off-the-shelf hardware does not provide.

If none of these apply, a PLC, an industrial PC or a GPU is usually faster to develop, cheaper to maintain and easier to change. Many projects use an FPGA for a small, critical part of the system and keep everything else in software.

Challenges to plan for

  • Development time. FPGA logic takes longer to design and verify than equivalent software, so scope it tightly.
  • Compile times. Long builds slow iteration; simulation and good test benches matter.
  • Power and cost. An FPGA uses more power than a dedicated chip for the same fixed task and costs more than a microcontroller.
  • Long-term support. Tool versions and chip families change, so document the design and the build environment so the system can be maintained for years.

Need an FPGA in your test, measurement or control system?

Sciotex engineers design FPGA software and the systems around it, from high-speed data acquisition and closed-loop control to precision timing for scientific instruments, designed, programmed, built and supported in the US since 1997.

Explore FPGA programming services

Frequently asked questions

What does FPGA stand for?

FPGA stands for field-programmable gate array: a chip whose logic and wiring are configured in the field, after manufacture, to implement a custom digital circuit.

What is an FPGA used for?

FPGAs are used where timing and throughput matter: high-speed data acquisition, real-time control, automated test and hardware-in-the-loop systems, machine vision preprocessing, scientific instruments, communications and prototyping.

Is an FPGA faster than a CPU?

For parallel, time-critical tasks such as filtering many channels or running a control loop with fixed latency, yes. For general-purpose software, a CPU is faster to program and usually the better choice.

How is an FPGA programmed?

With a hardware description language such as VHDL or Verilog, with high-level synthesis from C or C++, or graphically with LabVIEW FPGA on NI hardware. The design is compiled into a bitstream that configures the chip.

Can an FPGA be reprogrammed?

Yes. Loading a new bitstream changes the circuit, so an FPGA-based system can gain features or fixes without new hardware.

Related articles

Written by

Sciotex Engineering

The Sciotex engineering team has designed and built industrial, test and scientific software since 1997.

Have a software project or legacy system?

Talk it through with a Sciotex engineer.

In this article
Need help with industrial software?

Talk it through with a Sciotex engineer.

Next step

See what modern, supportable software could do for your system