Foundations · Lesson 1 of 4
What is an FPGA? Programmable hardware explained
What an FPGA is, how it differs from a microcontroller, an ASIC and a GPU, where FPGAs are used, the main vendors, and how the configuration is stored.
What you will learn
- Explain what a field-programmable gate array is and how it differs from a processor running software
- Compare FPGAs with microcontrollers, ASICs and GPUs for a given application
- Name the main FPGA vendors and the kind of devices each one sells
- Describe the difference between SRAM, flash and antifuse configuration
Before you start
- Basic digital logic: gates, flip-flops, binary numbers
By the end of this lesson you will be able to say what an FPGA is, decide when one is a better choice than a microcontroller, an ASIC or a GPU, and recognise the main vendors and configuration technologies you will meet in datasheets and job adverts.
Hardware you can rewrite
FPGA stands for field-programmable gate array. It is a chip that contains a large grid of small, identical logic blocks, a network of programmable wires between them, and input/output (I/O) blocks around the edge. None of these parts has a fixed function when the chip leaves the factory. You decide what they do, and you can change your mind later “in the field”, after the board has been built.
Each logic block contains look-up tables (LUTs), which can implement any Boolean function of a few inputs, and flip-flops, which store one bit each. The routing network connects the output of any block to the inputs of other blocks through programmable switches. Most modern FPGAs also include columns of dedicated blocks that would be wasteful to build from LUTs: block RAM for memory and DSP blocks for multiplication.
The setting of every LUT and every routing switch is held in configuration memory. A file called a bitstream fills that memory. Load a different bitstream and the same chip becomes a different circuit. Lesson 2 opens up each of these blocks in detail.
Programmable hardware versus a processor
A microcontroller is also “programmable”, but in a different sense. Its hardware is fixed: a processor core fetches instructions from memory and executes them one after another on a fixed datapath. Your program changes the sequence of instructions, not the circuit.
On an FPGA you do not write instructions. You describe a circuit in a hardware description language (HDL) such as Verilog, SystemVerilog or VHDL, and the tools turn that description into a configuration for the fabric. Every part of the circuit runs at the same time, because it is separate hardware.
Worked example: counting bits
Counting the number of 1 bits in a byte (a “population count”) shows the difference. In software you would loop over the bits:
count = 0;
for (i = 0; i < 8; i++)
count += (data >> i) & 1;
The processor executes this loop step by step, so the time it takes grows with the number of bits. On an FPGA you build an adder tree instead. Four small adders sum pairs of bits, two adders sum those results, and one final adder produces the count. All seven adders exist as hardware and work in parallel.
module popcount8 (
input logic [7:0] data,
output logic [3:0] count
);
logic [1:0] s0, s1, s2, s3; // pair sums, 0..2
logic [2:0] t0, t1; // sums of pairs, 0..4
assign s0 = {1'b0, data[0]} + {1'b0, data[1]};
assign s1 = {1'b0, data[2]} + {1'b0, data[3]};
assign s2 = {1'b0, data[4]} + {1'b0, data[5]};
assign s3 = {1'b0, data[6]} + {1'b0, data[7]};
assign t0 = {1'b0, s0} + {1'b0, s1};
assign t1 = {1'b0, s2} + {1'b0, s3};
assign count = {1'b0, t0} + {1'b0, t1}; // 0..8
endmodule
The result is ready a few gate delays after data changes, and a new byte can be processed every clock cycle. If you need sixteen of these counters, you instantiate sixteen copies and they all run at once. A processor would have to share its single datapath between them.
The download includes a testbench that checks all 256 input values against a software-style reference model. You will learn the language in lesson 4 and testbenches in lesson 9; for now, notice that the code describes structure, not a sequence of steps.
Downloadpopcount8.sv
Download tb_popcount8.sv
FPGA, microcontroller, ASIC or GPU
Four kinds of chip compete for most digital processing jobs. The table compares them in general terms. Exact figures depend heavily on the specific device and process node, so the table gives directions rather than numbers.
| Microcontroller | FPGA | ASIC | GPU | |
|---|---|---|---|---|
| What you change | Software instructions | The circuit (configuration bits) | Nothing after fabrication | Software kernels |
| Parallelism | One or a few cores | As much as fits in the fabric | Designed in, fixed | Thousands of identical threads |
| Timing | Depends on code paths and interrupts | Cycle-exact and deterministic | Cycle-exact and deterministic | Throughput-oriented; latency varies |
| I/O | Fixed peripherals | Almost any pin can be any interface | Designed in | Through a host bus |
| Up-front cost | Very low | Low (tools often free) | Very high (masks, verification) | Low |
| Cost per unit | Lowest | Moderate to high | Lowest at high volume | High |
| Speed and power for a given function | Lowest performance | Between MCU and ASIC | Best | High throughput, high power |
| Typical use | Control, user interfaces, sensors | Custom datapaths, low latency, unusual I/O | Mass-market products | Large data-parallel maths, graphics, neural networks |
A few points from the table deserve more explanation.
FPGA versus ASIC. An application-specific integrated circuit (ASIC) is a chip fabricated for one design. Because it contains only the gates it needs, with fixed wires between them, it is faster, smaller and lower in power than the same design on an FPGA. The price is a large one-time cost for masks and verification, and months between tape-out and first silicon. A bug found after fabrication means a new set of masks. FPGAs win when volumes are low to moderate, when the design must change after shipping, or when time to market matters. Kuon and Rose measured the area, speed and power gap between the two for a set of benchmark circuits; their paper is listed under further reading.
FPGA versus microcontroller. If a task fits comfortably in software on a microcontroller, use the microcontroller. It is cheaper, easier to debug, and there are more engineers who can maintain the code. Choose an FPGA when you need many things to happen in the same clock cycle, timing that is exact to the nanosecond, or I/O that no microcontroller peripheral provides. Many systems combine both, and some FPGAs include hard processor cores on the same die (AMD Zynq, Altera SoC FPGAs, Microchip PolarFire SoC).
FPGA versus GPU. A GPU runs the same instruction on many data elements at once. It suits large, regular, floating-point workloads such as training neural networks. It sits behind a host bus and works on batches in memory, so latency for a single small input is high and not exactly predictable. An FPGA can process a stream sample by sample as it arrives on its pins, with fixed latency and custom number formats.
Where FPGAs are used
FPGAs show up wherever one of these properties matters: low to medium volume, the need to update hardware after shipping, very high I/O bandwidth, or deterministic low latency.
- Communications. Wireless base stations, network switches and optical transport equipment use FPGAs for packet processing and digital signal processing at line rate. Standards change often, and reprogrammable hardware can follow them.
- Test and measurement. Oscilloscopes, logic analysers and protocol analysers capture data from fast converters and must process every sample in real time. The FPGA sits directly between the converters and memory.
- ASIC prototyping. Before a large chip is fabricated, its RTL is often mapped onto one or more FPGAs so that firmware teams can run real software on a hardware model months before silicon exists.
- Video and imaging. Broadcast equipment, machine vision cameras and medical imaging systems use FPGAs for format conversion, scaling and image processing pipelines with many parallel pixel streams.
- Data centre acceleration. Cloud providers offer servers with FPGA accelerator cards, and FPGAs appear in network interface cards that offload packet processing from the server CPUs.
- Aerospace and defence. Satellites, radar and avionics use FPGAs because volumes are low and designs have long lifetimes. Radiation-tolerant FPGA families exist for space.
You will also find FPGAs in industrial motor control, automotive driver-assistance systems, scientific instruments such as particle detectors, and in many university research projects.
Vendors and device families
A handful of companies make almost all FPGAs. Each sells several families aimed at different points on the cost and performance scale. Product lines change often, so check the vendor website for current parts.
| Vendor | Example families | Positioning |
|---|---|---|
| AMD (formerly Xilinx) | Spartan, Artix, Kintex, Virtex, Zynq, Versal | Full range, from low-cost devices to the largest FPGAs and adaptive SoCs with Arm cores |
| Altera | MAX 10, Cyclone, Arria, Stratix, Agilex | Full range; owned by Intel for several years and now operating as a separate company again |
| Lattice Semiconductor | iCE40, MachXO, ECP5, CrossLink-NX, Certus-NX | Small, low-power and low-cost devices; strong open-source toolchain support for iCE40 and ECP5 |
| Microchip (Microsemi, formerly Actel) | PolarFire, PolarFire SoC, IGLOO 2, SmartFusion 2, RTG4 | Non-volatile, low-power devices and radiation-tolerant families for space |
| Efinix | Trion, Titanium | Low- to mid-range devices built on its own fabric architecture |
| Gowin Semiconductor | LittleBee, Arora | Low-cost devices; open-source support through Project Apicula |
AMD and Altera dominate the high end. Lattice, Microchip, Efinix and Gowin focus on lower cost, lower power or specific markets. The concepts in this course apply to all of them. Where a step depends on the tool, lessons show AMD Vivado and Altera Quartus Prime, and the open-source Yosys and nextpnr flow where it applies.
How the configuration is stored
The configuration memory can be built from three kinds of cell. The choice affects power-up behaviour, security, radiation tolerance and whether you can reprogram the part.
SRAM-based
Most FPGAs, including the large AMD and Altera families, Lattice iCE40 and ECP5, and Efinix devices, store their configuration in SRAM cells. SRAM is fast and uses the same manufacturing process as the logic, so these devices get the newest process nodes first. SRAM is volatile: the configuration disappears when power is removed. At every power-up the FPGA loads its bitstream from an external flash chip or from a host processor, which takes a short time before the design starts. A charged particle can occasionally flip a configuration bit and change the circuit, an effect called a single-event upset. Designs for harsh environments add error detection and periodic rewriting of the configuration (“scrubbing”).
Flash-based
Microchip’s PolarFire and IGLOO families build their configuration switches from non-volatile flash cells. The device is live as soon as power is stable, needs no external configuration memory, and its configuration cells are far less susceptible to radiation-induced upsets than SRAM. Flash cells take longer to program and the process technology tends to lag behind SRAM-based parts.
Some devices take a middle path. Altera MAX 10, Lattice MachXO and several Gowin LittleBee devices keep SRAM configuration cells but add on-chip flash that loads them at power-up. From the board designer’s point of view they are single-chip, non-volatile parts.
Antifuse
An antifuse is the opposite of a fuse: it starts as an open circuit and programming forms a permanent conductive link. Antifuse FPGAs are one-time programmable. They cannot be read back or altered, they are very resistant to radiation, and they are live at power-up. These properties suit space and defence systems, where antifuse parts from Microchip (originally Actel) have been used. For most other work their one-time nature makes development slow and costly.
| SRAM | Flash | Antifuse | |
|---|---|---|---|
| Reprogrammable | Yes, unlimited | Yes, limited write cycles | No, once only |
| Keeps configuration without power | No | Yes | Yes |
| Needs external configuration memory | Usually | No | No |
| Live at power-up | After loading | Yes | Yes |
| Configuration upsets from radiation | Possible | Rare | Very rare |
What this course covers
The course follows the path a design takes from idea to working hardware.
- Foundations. How the fabric is built (FPGA architecture) and the steps from source code to programmed chip (the design flow).
- HDL for synthesis. Verilog and SystemVerilog, VHDL, combinational logic, sequential logic and state machines.
- Verification. Self-checking testbenches that catch bugs before hardware does.
- Timing and clocks. Static timing analysis and clock domain crossing.
- Building systems. Memory and DSP blocks, a complete UART project, and implementation and hardware debug.
Every lesson can be completed in a free simulator. A board is only needed if you want to see the designs run in hardware.
Choose a platform
For each project, pick a microcontroller, an FPGA, an ASIC or a GPU, and give one sentence of justification.
- A thermostat that reads a temperature sensor once a second and drives a relay. Expected sales: 500,000 units a year for five years.
- A test fixture that must generate 32 independent pulse trains, each with edges placed to within 10 ns, for a production line that will build 15 fixtures.
- A wireless earbud chip expected to sell tens of millions of units, where battery life is the main selling point.
- Training a large image-classification neural network in floating point on a server.
- A camera interface for a research instrument where the sensor vendor may change the data format in the next hardware revision.
Show solution
- Microcontroller. The task is slow and simple, and a low-cost microcontroller handles it in software. At this volume a cheap standard part beats an FPGA on cost.
- FPGA. Thirty-two parallel outputs with 10 ns edge placement need dedicated hardware counters; 15 units could never pay for an ASIC.
- ASIC. At tens of millions of units the mask cost is spread thin, and only a custom chip gives the lowest power per function.
- GPU. Training is large, regular, floating-point, data-parallel work, which is what GPUs are built for.
- FPGA. The interface logic must run at sensor speed and may need to change after the board is built; an FPGA can be reprogrammed to follow the new format.
Summary
- An FPGA is a grid of LUT-based logic blocks, flip-flops, block RAM and DSP blocks joined by programmable routing and surrounded by configurable I/O. A bitstream sets all of it.
- On an FPGA you describe a circuit, not a sequence of instructions, so independent parts of the design run in parallel with cycle-exact timing.
- Microcontrollers win on cost and ease for software-sized tasks, ASICs win on speed, power and unit cost at high volume, GPUs win on large data-parallel floating-point work. FPGAs fill the gap: custom hardware at low volume, changeable after shipping.
- The main vendors are AMD (Xilinx), Altera, Lattice, Microchip, Efinix and Gowin, each with families from low-cost to high-end.
- Configuration memory is SRAM (volatile, reloaded at power-up), flash (non-volatile, live at power-up) or antifuse (one-time programmable, used mainly in space and defence).
Check your understanding
Pick an answer for each question, then check. Answers stay hidden until you submit.
Further reading
- Paper
- Paper
- Paper
Found a mistake or something unclear?Report a correction.
Follow this course
Get an email when new lessons and projects are added to this course.