BitFlow

What is an FPGA?

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?

MicrocontrollerFPGAASIC
What you writeA program that a processor runsA hardware description that becomes a circuitA hardware description, made into a custom chip
ParallelismMostly one thing at a time per coreEverything you described runs at onceSame
Changing itReflash the programReload the configurationNot possible once manufactured
Cost to startLowLow 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

  1. Write the design in a hardware description language such as Verilog.
  2. Simulate it with a testbench to check the behaviour.
  3. Synthesise it: a tool turns the code into a netlist of LUTs and flip-flops.
  4. Place and route: the tool chooses which physical blocks to use and how to wire them.
  5. Generate a bitstream: the configuration file for your specific chip.
  6. 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.
Board Lab →Write Verilog and watch it run on a 3D FPGA board in your browser, then put it on a real board.Flash an FPGA board →Program a supported board straight from the browser over USB.

Questions

Is an FPGA a processor?

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.

Was this article helpful?

Keep going