Digital logic & computing · tree view
An FPGA fabric is an array of look-up tables (small memories that compute any function of their inputs) plus flip-flops you wire by writing a hardware description language instead of soldering — Kuphaldt's ROM-as-look-up-table is the exact principle inside every LUT.
Suppose we had a ROM memory circuit written, or programmed, with certain data, such that the address lines of the ROM served as inputs and the data lines of the ROM served as outputs, generating the characteristic response of a particular logic function.
Such a simple application, with definite outputs for every input, is called a look-up table, because the memory device simply "looks up" what the output(s) should to be for any given combination of inputs states.
Whereas the half-adder built from gates or relays processes the input bits to arrive at a specific output, the ROM simply remembers what the outputs should be for any given combination of inputs.
the data stored at each address becomes the next storage location that the ROM gets addressed to
Software is much easier to change than hardware.
We could even use an EPROM chip which could be re-written at will, giving the ultimate flexibility in function.
Software such as the logic function example can be designed to perform functions that would be extremely difficult to emulate with discrete logic gates (or relays!)
Having 16 addressable memory locations in the ROM, this Finite State Machine would have 16 different stable "states" in which it could latch.
A 3-input LUT is nothing but an 8 x 1 memory: the three inputs are the address, and the 8 stored configuration bits are the function's truth table. Reprogram the cells and the same silicon computes a different function — no gates touched. Below, the identical LUT is first programmed as XOR-3, then as a majority vote.
To predict the outcome:
| inputs_a_b_c | lut_as_xor3 | lut_as_majority | note |
|---|---|---|---|
| 000 | 0 | 0 | same hardware, different programming |
| 001 | 1 | 0 | odd parity vs vote |
| 010 | 1 | 0 | |
| 011 | 0 | 1 | two 1s — majority fires |
| 100 | 1 | 0 | |
| 101 | 0 | 1 | |
| 110 | 0 | 1 | |
| 111 | 1 | 1 | both functions active |
Because a LUT is a memory, its cost grows as 2^N configuration cells for N inputs. FPGA vendors therefore build 4–6 input LUTs and let the fabric combine several of them for wider functions — the direct descendant of Kuphaldt's "4 x 2 bit ROM (a very small memory!)" half-adder.
To predict the outcome:
| lut_inputs_n | configuration_cells | example |
|---|---|---|
| 2 | 4 | Kuphaldt's ROM half-adder stores a 2-output table |
| 3 | 8 | XOR-3 or majority as in the table above |
| 4 | 16 | classic FPGA-4 LUT |
| 6 | 64 | modern 6-input LUT fabric |
| 8 | 256 | Kuphaldt's 256-location 4-bit adder ROM |
Kuphaldt programs a 4 x 2 bit ROM with the half-adder's truth table: address lines A and B are the addend inputs, data lines carry Σ (sum) and C_out. Prediction: drive each address, read the stored pair, and compare against gate-computed a+b.
To predict the outcome:
| address_a_b | stored_sum | stored_cout | gate_check |
|---|---|---|---|
| 00 | 0 | 0 | 0 ⊕ 0 = 0, 0 ∧ 0 = 0 |
| 01 | 1 | 0 | 0 ⊕ 1 = 1, 0 ∧ 1 = 0 |
| 10 | 1 | 0 | 1 ⊕ 0 = 1, 1 ∧ 0 = 0 |
| 11 | 0 | 1 | 1 ⊕ 1 = 0, 1 ∧ 1 = 1 — carry |
Neither Kuphaldt nor NEETS covers FPGA fabrics or HDL synthesis — this table is conceptual, flagged as such, and limited to verdicts that follow from the LUT principle above plus the MCU material of the previous lesson.
To predict the outcome:
| aspect | fpga | mcu | asic |
|---|---|---|---|
| what defines it | reconfigurable LUT/flip-flop fabric | fixed CPU + on-chip memory running software | function etched into silicon at fab |
| change a design | reprogram bitstream in seconds | reflash software | new mask set — weeks and $$$ |
| per-unit cost at volume | highest | low | lowest |
| parallelism | true hardware concurrency — everything runs at once | sequential instruction stream | as parallel as designed |
| best use | prototypes, glue logic, custom protocols | embedded control, consumer devices | high-volume frozen products |
Books are thin here: HDL is modern synthesis practice with no coverage in either source, so this table is flagged conceptual. The rule a beginner needs: every Verilog/VHDL statement either describes combinational wiring (a LUT) or a clocked register (a flip-flop).
To predict the outcome:
| hdl_construct | synthesizes_to | output_updates | analogous_to |
|---|---|---|---|
| assign y = a & b; (or concurrent signal assignment) | one LUT — combinational AND | as soon as inputs change (gate delay) | wired gate |
| always @(posedge clk) q <= d; (or clocked process) | D flip-flop register | only on the clock edge | edge-triggered D flip-flop |
| if/else chains on current state + inputs | next-state logic into a register — an FSM | on clock edges, per transition table | FSM design from the counters lesson |
| case (addr) ... endcase selecting stored values | ROM / LUT contents | address change → data out (combinational read) | look-up table (this lesson's quotes) |