An FPGA is a chip whose logic you rewire after it is made. What is inside one, how it differs from a microcontroller, and how a design gets onto it.
By BitFlow · · 6 min read
The short answer
An FPGA (field-programmable gate array) is a chip full of small logic blocks and wiring that you can reconfigure after it has been made. Instead of running a program, you load a configuration that connects those blocks into the digital circuit you designed. Load a different one and the same chip becomes a different circuit.
What is inside
Look-up tables (LUTs). A LUT with k inputs is a tiny memory of 2^k bits. Fill it with a truth table and it can implement any function of its k inputs.
Flip-flops. Each logic block can store a bit, so a LUT followed by a flip-flop makes registered logic.
Routing. Programmable switches connect the blocks to each other.
Extras. Many FPGAs also have blocks of RAM, multipliers (DSP blocks), clock-management circuits and I/O pins that talk to the outside world.
Try the look-up table below: change what it stores and see which function it becomes.
> Loading the animation…
An FPGA is many of these look-up tables, each with a flip-flop, in a grid with programmable wiring. Lift one block out in the 3D view and follow its result along the wiring.
> Loading the animation…
FPGA, microcontroller or ASIC?
Microcontroller
FPGA
ASIC
What you write
A program that a processor runs
A hardware description that becomes a circuit
A hardware description, made into a custom chip
Parallelism
Mostly one thing at a time per core
Everything you described runs at once
Same
Changing it
Reflash the program
Reload the configuration
Not possible once manufactured
Cost to start
Low
Low to moderate (a board)
Very high (manufacturing)
An FPGA is good when you need many things to happen in parallel with exact timing, or when you want to try a hardware design before committing to a chip. A microcontroller is simpler and cheaper when a program is enough.
How a design gets onto an FPGA
Write the design in a hardware description language such as Verilog.
Simulate it with a testbench to check the behaviour.
Synthesise it: a tool turns the code into a netlist of LUTs and flip-flops.
Place and route: the tool chooses which physical blocks to use and how to wire them.
Generate a bitstream: the configuration file for your specific chip.
Program the board over USB. Many FPGAs lose their configuration when power is removed and load it again from a flash chip at start-up.
No. It has no fixed instruction set. You can build a processor inside one, but by default it is a blank array of logic that becomes whatever circuit you configure.
Can I learn FPGA design without buying a board?+
Yes. Write and simulate your designs first, and use a browser-based board model to see them drive LEDs and displays. A real board is a good step when you want to see it run in hardware.
What language do I use to program an FPGA?+
Usually a hardware description language: Verilog, SystemVerilog or VHDL. Some tools can also start from higher-level descriptions, but the HDLs are the common starting point.