Skip to content
BetterDL

Lookup table (LUT)

Also called: look-up table, LUTs, lookup tables, function table in memory

A stored table of answers indexed by the inputs: the inputs select an entry and the stored value is the output. MUXes, ROMs and FPGA cells all work this way.

A lookup table skips Boolean algebra entirely. Instead of computing F from its inputs with gates, you store F's value for every input combination and simply look it up.

  • The inputs form an index (a row number).
  • The table holds one answer per index.
  • The output is the answer stored at that index.

It's a truth table turned into hardware. Two ways to build one appear in this course:

FPGAs are built from thousands of small LUTs, typically with 4 to 6 inputs. Each is a tiny memory whose contents are loaded when the chip is configured, so the same silicon can become any circuit.

The cost: a table with k inputs needs 2ᵏ entries. Each extra input doubles its size, whether or not the function is complicated. LUTs are ideal for small, irregular functions and wasteful for wide ones.

F
0000
0011
0101
0111
1001
1011
1101
1110

Worked examples

Example

Configuring a 3-input LUT

F(A, B, C) = 1 when the inputs are not all equal (A is the MSB). Find the 8 stored bits, entry 0 first.

  1. 1.

    Row 0 = 000: all equal → 0. Row 7 = 111: all equal → 0.

  2. 2.

    Rows 1 to 6 each contain both a 0 and a 1 → 1.

  3. 3.

    Contents, entry 0 to 7: 0 1 1 1 1 1 1 0.

  4. 4.

    Looking up 101 reads entry 5, which holds 1.

Example

How big is the table?

A function has 6 inputs and 3 outputs.

  1. 1.

    Entries: 2⁶ = 64, one per input combination.

  2. 2.

    Each entry stores all 3 outputs: 3 bits.

  3. 3.

    Total: 64 × 3 = 192 bits. Add a seventh input and it doubles to 384.

Common mistakes

  • Writing the contents from the wrong end. Entry 0 belongs to input 00…0; check whether a list starts at I0 or at the top.

  • Sizing the table by inputs × outputs. It needs 2ⁿ entries for n inputs, not n.

  • Simplifying before storing. A LUT stores every row as it is; minimization doesn't make it smaller.

Practice Lookup table (LUT)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Lookup table (LUT) is taught in Combinational Logic and Memory.