FPGARelated.com
Fundamentals

Look-Up Tables (LUTs)

How FPGAs implement any logic function

Here's the secret of how FPGAs work: instead of wiring up individual AND, OR, and NOT gates, they store the complete truth table of your logic function in a tiny memory. When the inputs arrive, the FPGA simply looks up the answer. That tiny memory is called a Look-Up Table, and it's the fundamental building block of every FPGA.

Interactive LUT Programmer

Click output cells to program the truth table. Toggle the inputs to see the LUT look up the answer. Use presets to load common gate functions:

Presets:

How LUTs Work

A 3-input LUT has 3 input wires and 1 output. Internally, it's a tiny 8-bit memory, one bit for each possible input combination (23 = 8). The inputs act as a 3-bit address that selects which stored bit appears at the output.

This means a 3-input LUT can implement any Boolean function of 3 variables. AND gate? Program the table. OR gate? Just change the stored bits. XOR? Same hardware, different data. The LUT doesn't care; it's just looking up a pre-stored answer.

Real FPGAs use 4-input LUTs (16 bits of storage) or 6-input LUTs (64 bits). Larger LUTs implement more complex functions in a single lookup, reducing the need to chain multiple LUTs together.

When you compile your HDL, the synthesis tool figures out what truth tables your logic needs and programs each LUT accordingly. The programmable routing fabric then connects the LUT outputs to other LUT inputs to build your complete circuit.

Key Insight: A LUT is a small memory that stores a complete truth table. Any logic function can be implemented by loading the right data, no gate rewiring needed. This is what makes FPGAs reconfigurable: change the LUT contents and you change the logic.
Try it: Click "Full Adder Sum" to load the sum function for a full adder. Then toggle inputs A, B, and C (carry) to verify: the sum output is 1 when an odd number of inputs are 1. Notice this is the same as 3-input XOR.

Why This Matters for FPGA Design

  • Universal building block - LUTs can implement any Boolean function, making FPGAs completely general-purpose
  • Resource counting - FPGA size is measured in LUTs; understanding LUT utilization helps you size your chip
  • Timing - a function that fits in one LUT is faster than one that requires chaining multiple LUTs
  • Distributed memory - LUTs can also be configured as small RAMs (distributed RAM)

Frequently Asked Questions

What is a look-up table in an FPGA?

A look-up table (LUT) is a small memory that stores the truth table of a logic function. Instead of building a circuit from AND, OR, and NOT gates, the FPGA stores all possible outputs for all possible input combinations. When inputs arrive, the LUT simply looks up the answer, like checking a pre-computed table. A 4-input LUT stores 16 output bits and can implement any Boolean function of 4 variables.

How does an FPGA implement logic?

An FPGA implements logic by programming its LUTs. During configuration, the bitstream loads each LUT with the truth table of the desired function. The inputs act as an address, and the stored bit at that address is the output. For functions with more inputs than a single LUT can handle, the FPGA chains multiple LUTs together using its routing fabric. This approach is what makes FPGAs programmable: the same hardware can implement any logic.

Quick Check

Test your understanding of the key concepts from this lesson.