74. FPGA Fabric and Resources

Question.1

Two implementations use identical LUT functions and equivalent source and destination loading:

Path A: LUT0 → ROUTE_MUX4 → LUT1
Path B: LUT0 → ROUTE_MUX4 → Inter-Cluster Bus → ROUTE_MUX4 → LUT1

Assume every additional programmable routing stage contributes positive propagation delay, the inter-cluster bus adds nonnegative delay, and all other delay contributions are identical.

Which path has lower combinational delay?

Need Help? Refer to the Quick Guide below

This Quick Guide uses vendor-neutral educational PLD models. It focuses on how logic is configured, mapped, routed, counted, and debugged rather than on a specific FPGA tool or device family.

1. PLD Fundamentals and Configuration Technologies

Fixed Logic and Programmable Logic

  • Fixed logic has a hardware function determined by its manufactured connections.
  • Programmable logic contains configurable logic and routing resources whose function is selected by stored configuration bits.
Fixed Logic and Programmable Logic

Reprogramming changes the configured function without rewiring the external circuit.

The device still has finite resources: logic terms, LUTs, registers, routing, I/O, memory, and arithmetic blocks.

SPLD, CPLD, and FPGA

SPLD, CPLD and FPGA
FamilyMain logic styleTypical strengthMain limit
SPLDProduct terms and macrocellsSmall glue and decode logicLow density
CPLDGroups of macrocells with programmable interconnectPredictable control and medium-density logicProduct-term and macrocell limits
FPGALUTs, DFFs, programmable routing, and hard resourcesLarge configurable digital systemsMapping, routing, and resource complexity

Architecture Is Not Configuration Technology

The architecture defines the available resources and their connections. The configuration technology defines how the programming state is stored.

Configuration technologyVolatile?Reprogrammable?Startup implicationPractical fit
SRAMYesYesConfiguration must be loaded after power-upFrequent updates and high-density FPGA fabrics
FlashNoYesConfiguration is retained without powerFast readiness and field updates
AntifuseNoNoProgrammed function is retainedOne-time programming and permanent configuration
Configuration Technology

Practical Device Selection

RequirementUsually favorsReason
A few SOP equationsSPLDDirect product-term implementation
Moderate control logic and predictable startupCPLDMacrocell structure and nonvolatile options
Many logic functions, registers, memories, or multipliersFPGADense LUT fabric and dedicated resources
Change configuration oftenSRAM or FlashReprogrammable
Retain configuration without reloadFlash or antifuseNonvolatile
Update after deploymentFlash or SRAMAntifuse cannot be reprogrammed

Small example: A board needs six simple active-HIGH control equations and must retain its configuration when power is removed. A small Flash-based SPLD or CPLD is a better starting point than a large SRAM FPGA because the logic density is low and the configuration is nonvolatile. After power is applied, the device still completes its specified internal startup sequence before its logic and I/O are ready; nonvolatile configuration does not mean zero startup time.

Practical rule: Select both an architecture that fits the logic and a configuration technology that fits startup and update requirements.

2. Programmable Arrays and Product-Term Logic

ROM/PROM Logic Realization

A ROM/PROM-style realization uses inputs as an address and a programmed output pattern as a truth table. It can realize any listed combination, but may store many rows that a compact SOP form does not need.

PROM Logic Realization

PAL and PLA Structures

StructureAND planeOR planeMain consequence
PALProgrammableFixedSimple output structure; sharing depends on fixed connections
PLAProgrammableProgrammableProduct terms can be connected to selected outputs

For the educational PAL/PLA matrices, a connection bit of 1 means connected and 0 means open. Unused product terms must be disabled.

How Programmable Connections Are Made

A programmable array selects which signal lines are electrically connected at each crossing point. The physical programming element depends on the device technology.

ImplementationHow the connection is represented
Fuse linkInitially connected; programming can open selected links
Antifuse linkInitially open; programming permanently creates selected links
SRAM-controlled electronic switchA volatile configuration bit turns a pass transistor or multiplexer path on or off
Flash-controlled electronic switchA nonvolatile stored state controls the switch or selection path

In EWsim, simple switches make each programmed connection easy to inspect and change.

In actual PLD hardware, microscopic programmable elements and electronic switches are controlled by configuration memory or one-time-programmable links; a person does not operate physical toggle switches inside the device.

PAL circuit showing input literals, programmable AND connections, product terms and fixed OR output connections.
PLA circuit showing programmable true and complemented literal connections in the AND plane and programmable product-term connections in the OR plane.

Product-Term Configuration

A product term is an AND of selected literals. A variable may be used as true, complemented, or don't-care. In the table below, V means the input variable assigned to that literal field, such as A, B, C, or D. In a MACROCELL4 product term, each literal field uses:

Literal codeMeaningContribution to product term
00Don't careVariable omitted; contributes logic 1 to the AND term
01True literalUse V
10Complemented literalUse V'
11Reserved/invalidDo not use

Because an AND input must be neutral when a variable is omitted, each 00 literal contributes logic 1 to the product-term AND operation. If every literal field is 00 and PT_EN=1, the enabled product term evaluates to 1. PT_EN=0 overrides the literal fields and forces the product-term output to 0.

Practical rule: Disable an unused product term with PT_EN=0. Leaving an all-don't-care term enabled would contribute 1 to the following OR stage.

Encoding example: For A'·C, program the A field as 10, the B field as 00, the C field as 01, and the D field as 00. Set PT_EN=1.

Worked SOP Mapping

Map:

F = A'·B + A·C

Product termABCDPT_ENResult
PT0100100001A'·B
PT1010001001A·C
PT20000000000
PT30000000000

The OR stage combines the enabled terms: F = PT0 + PT1.

ABCF = A'·B + A·C
0000
0010
0101
0111
1000
1011
1100
1111
EWsim PAL-style circuit implementing F = A'·B + A·C with true and complemented literals, two enabled product terms (PT0_EN, PT1_EN) and a fixed OR output.

Product-Term Sharing

For two outputs:

F = A'·B + A·C

G = A'·B + B·C

The term A'·B is common. A PLA can program it once and connect it to both output OR paths. A PAL can share it only if its fixed OR structure provides that connection; otherwise, the term must be duplicated.

TermUsed by FUsed by GPLA allocation
A'·BYesYesOne shared term
A·CYesNoOne term
B·CNoYesOne term

Product-Term Capacity

A MACROCELL4 has four product terms. Therefore:

H = P0 + P1 + P2 + P3 fits one macrocell.

K = P0 + P1 + P2 + P3 + P4 does not directly fit one macrocell. It must be factored, split across resources, or mapped to a different architecture.

Practical rule: Count the required product terms after simplification and sharing, then compare the count with the destination macrocell and interconnect limits.

3. SPLD/CPLD Macrocells and Architecture

MACROCELL4

MACROCELL4 contains four programmable product terms, an OR stage, optional polarity control, combinational/registered selection, output enable, and selectable internal feedback. Its DFF uses rising-edge CLK_G and synchronous active-HIGH RST.

MACROCELL4 showing four programmable product terms, OR stage, polarity selection, D flip-flop, combinational or registered output selection, output enable and selectable internal feedback

Output and Feedback Modes

Output modePin sourceWhen value can changeTypical use
CombinationalPolarized OR resultAfter input/configuration propagationDecode and immediate control
RegisteredDFF QAfter a rising CLK_G edgeState and clock-aligned control
Feedback selectInternal feedback sourcePin OE effect
CombinationalPolarized OR resultFeedback remains available even if pin is released
RegisteredDFF QFeedback remains available even if pin is released
OEExternal pinInternal logic/feedback
0Released, not drivenStill operates
1Drives selected outputStill operates

The simplified MACROCELL4 has no clock enable. On each rising edge:

RSTActive-edge DFF action
1Q ← 0
0Q ← polarized OR result

Because RST is synchronous, asserting it between edges does not immediately clear Q.

Feedback example: Configure the macrocell D input as:

D = A + B'·Q

Here, Q is the registered feedback signal.

ConditionResulting DBehavior at the next rising CLK_G edge when RST=0
A=11Set Q to 1
A=0, B=0QHold the current state through feedback
A=0, B=10Clear Q
EWsim macrocell-style circuit implementing D equals A OR B complement AND Q using registered Q feedback, product terms, an OR stage and a rising-edge D flip-flop.

Practical Configurations

GoalProduct termsPolarityOutput modeOEFeedback
Combinational active-HIGH FSOP for FNormalCombinational1Combinational
Registered FSOP for next FNormalRegistered1Registered Q
Active-LOW pinSOP for active-HIGH internal resultInvertSelected as needed1As required
Internal-only state bitNext-state SOPNormalRegistered0Registered Q

CPLD-8 Architecture

CPLD-8 has two function blocks, each containing four MACROCELL4 resources, with eight user I/O, programmable interconnect, global CLK_G, and active-HIGH RST.

CPLD-8 Architecture

A design can fail even with unused macrocells if one output needs more than four product terms or if the required interconnect path is unavailable.

Practical rule: Check product terms per macrocell, total macrocells, I/O, and interconnect—not only the total equation count.

4. FPGA LUT Logic and Logic Elements

LUT Principle and Capacity

An N-input LUT stores 2^N configuration bits and implements any Boolean function whose required input set has at most N variables. LUT4 stores 16 bits in CFG_INIT[15:0].

ADDR = {I3, I2, I1, I0}

Y = CFG_INIT[ADDR]

I0 is the least-significant address bit. CFG_INIT[0] corresponds to address 0000; CFG_INIT[15] corresponds to 1111.

Four-input LUT showing I3 through I0 as a 4-bit address selecting one of sixteen CFG_INIT bits to drive Y.

Truth Table to CFG_INIT

Use I0=A, I1=B, I2=C, and leave I3 functionally unused for:

F = A'·B + A·C

AddressI3I2=CI1=BI0=ACFG_INIT[address]
000000
100010
200101
300110
401000
501011
601101
701111
810000
910010
1010101
1110110
1211000
1311011
1411101
1511111

Read bits from 15 down to 0 when writing the hexadecimal value:

CFG_INIT[15:0] = 1110_0100_1110_0100 = 16'hE4E4

The upper and lower bytes match because I3 is unused.

Decoding an INIT Value

For CFG_INIT = 16'h8000, only bit 15 is 1. Therefore Y=1 only for address 1111, so:

Y = I3·I2·I1·I0

To decode any INIT value, expand it to 16 bits, label the rightmost bit as address 0, and identify the addresses containing 1.

Multi-LUT Decomposition

A function with five required inputs cannot fit one LUT4. Decompose it, for example:

F = A·B·C·D + E

Multi-LUT Decomposition

This mapping uses two LUTs and has LOGIC_LEVELS = 2 on the A-to-D paths. A register would terminate the current combinational path.

The behavior can be verified with three conditions. X means either 0 or 1.

ConditionEA·B·C·DF
E is HIGH1X1
E is LOW and all four product inputs are HIGH011
E is LOW and at least one product input is LOW000

LE4 Architecture and Sequential Behavior

LE4 combines one LUT4, one DFF, CE, synchronous active-HIGH RST, and combinational/registered output selection.

LE4 showing a LUT4 feeding a D flip-flop with CE and synchronous active-HIGH RST plus a multiplexer selecting combinational LUT output or registered Q.

On a rising edge of CLK_G, the priority is RST > CE > Hold.

RSTCEDFF action at rising CLK_GQ after edge
1XReset0
01CaptureLUT_OUT
00HoldPrevious Q
Output selectLE_OUT
CombinationalLUT_OUT
RegisteredQ

Packing and Logic Depth

Report LUT_USED, DFF_USED, and LE_OCCUPIED separately.

MappingLUT_USEDDFF_USEDLE_OCCUPIED
LUT result registered by the same LE DFF111
Standalone LUT plus unrelated standalone DFF112
Two standalone LUT functions202

LOGIC_LEVELS is the maximum number of LUT4 stages on a combinational input-to-output path, not the total LUT count.

5. Programmable Routing, I/O and Clock Resources

Routing Classes

Routing Classes

Local routing is suited to nearby logic, general routing connects broader fabric regions, and global routing distributes CLK_G to many sequential resources. Exact physical timing is outside the educational model.

ROUTE_MUX4 and ROUTE_HOPS

A ROUTE_MUX4 selects one of four candidate sources.

SEL[1:0]Selected source
00S0
01S1
10S2
11S3
S0–S3, SEL[1:0], and ROUTE_OUT

ROUTE_HOPS counts programmable routing stages:

RouteCount
Direct connection within the same LE0
One ROUTE_MUX41
ROUTE_MUX4 then inter-cluster stage2

Important: ROUTE_HOPS is an abstract structural cost metric, not physical delay. Two routes with the same hop count can have different real timing.

Digital I/O

Digital IO
IO_OEPin modeIO_OUT effectIO_IN role
0Input/releasedPin is not drivenSamples the pin
1OutputDrives the pinMay still observe the pin in the abstraction

Electrical voltage standards and analog pin behavior are outside scope.

Small example: If IO_OUT=1, then IO_OE=1 drives the external pin HIGH. Changing IO_OE to 0 releases the pin; IO_OUT may remain 1 internally, but it no longer drives the external connection. IO_IN observes the external pin level.

EWsim digital I/O circuit with IO_OUT feeding a tri-state output buffer, IO_OE controlling pin drive, an external bidirectional pin and an IO_IN observation path.

Clock Resources

Clock Resources

Use CLK_G for sequential fabric. A fabric-generated clock can introduce uncontrolled skew, glitches, and routing uncertainty; use clock enable when the goal is conditional updating.

PLL/MMCM/DLL resources manage clock frequency and phase, but their analog implementation is outside scope.

Clock Enable Circuit

A clock enable keeps the DFF on the global clock and controls the value presented to D through a feedback multiplexer:

D_next = CE·Data + CE'·Q

CEMUX selectionRising-edge action
0Current QHold Q
1New DataQ ← Data

Small example: If Q=1, Data=0, and CE=0, then D_next=1 and the next clock edge preserves Q=1. If CE changes to 1, D_next=0 and the next edge loads Q=0.

EWsim circuit showing a D flip-flop clocked by CLK_G and a feedback multiplexer in which CE selects either new Data or the current Q value for conditional updates.

High fan-out signals consume routing resources and may affect implementation timing.

Treat fan-out, congestion, and placement as implementation-awareness issues even when Boolean behavior is correct.

6. Embedded Memory and DSP Resources

Heterogeneous PLD-16 Fabric

PLD-16 contains 16 LE4 resources arranged as four clusters of four, 16 digital I/O, two BRAM16x8, two DSP8_MADD, CLK_G, and programmable route-mux resources.

Heterogeneous PLD-16 Fabric

BRAM16x8

BRAM16x8 stores 16 words of 8 bits. Write and output capture occur on a rising CLK_G edge.

BRAM16x8
Edge conditionMemory actionDOUT after edge
WE=0No writeCaptures current MEM[ADDR]
WE=1MEM[ADDR] ← DINCaptures old MEM[ADDR]

The same-address write behavior is read-first: the old value appears at DOUT on the write edge, and the new stored value is observed on a later read edge.

Read-first example: Assume MEM[3]=8'h2A. At a rising edge, apply ADDR=3, WE=1, and DIN=8'hC5. After that edge, DOUT=8'h2A while MEM[3] stores 8'hC5. A later read edge at address 3 captures 8'hC5.

Small memories may use distributed logic in some architectures, but a larger array usually favors BRAM so LUTs and DFFs remain available for logic.

DSP8_MADD

DSP8_MADD implements unsigned multiply-add:

P[16:0] = A[7:0] × B[7:0] + C[15:0]

DSP8_MADD Block Diagram

Example: A=25, B=10, and C=1000.

P = 25 × 10 + 1000 = 1250

The maximum result is 255 × 255 + 65535 = 130560, which fits 17 bits because the 17-bit unsigned maximum is 131071.

Selecting Hard Resources

RequirementPreferred mappingReason
16 × 8 table with clocked accessOne BRAM16x8Preserves LUT/DFF fabric
Two independent 16 × 8 arraysTwo BRAM16x8 blocksExact hard-resource fit
Three independent 16 × 8 arraysDoes not fit BRAM budget directlyOnly two BRAM blocks exist
Two simultaneous multiply-addsTwo DSP8_MADD blocksParallel arithmetic
Three simultaneous multiply-addsFails DSP budget or needs a redesignOnly two DSP blocks exist

Practical rule: A design fails to fit when any required resource is exhausted, even if many other resources remain unused.

7. Resource Mapping and Optimization

Technology Mapping

Synthesis transforms the logic description into a generic logical network. Technology mapping selects target resources such as product terms, LUTs, DFFs, BRAMs, DSPs, I/O, and routing.

Technology Mapping

Equivalent Mapping Trade-offs

Consider the five-input function:

F = (A + B)·(C + D)·E

Both mappings below use only valid LUT4 input counts.

Equivalent Mapping Trade-off
MeasureMapping AMapping B
LUT_USED24
LOGIC_LEVELS23
Intermediate routed signalsTP, Q, and R
Routing implicationOne LUT-to-LUT connectionMore internal connections and placement dependence

Mapping A is the more compact direct implementation. Mapping B is still functionally correct and may become useful if P=A+B and Q=C+D already exist for other outputs; otherwise, it consumes more LUT and routing resources and adds one logic level.

MINI_FABRIC-8 Architecture

MINI_FABRIC-8 is a small educational FPGA fabric with eight LE4 resources arranged as two clusters of four. It has four external inputs, four outputs, fixed ROUTE_MUX4 resources, one inter-cluster route bus, and shared CLK_G and RST. It contains no hard BRAM or DSP blocks.

Mini Fabric 8 Architecture

The fabric is intended for LUT, register, packing, and routing exercises under explicit resource limits. Memory arrays and multiply-add operations must use the available LE4 fabric or be excluded from a task because no dedicated BRAM or DSP resources exist.

Packing Example

Suppose a design contains 12 LUT functions and 6 DFFs:

  • Five DFFs register the output of five corresponding LUTs and pack with them.
  • Seven LUTs remain LUT-only.
  • One DFF is unrelated and occupies a standalone LE.

Therefore:

LUT_USED = 12

DFF_USED = 6

LE_OCCUPIED = 5 paired + 7 LUT-only + 1 DFF-only = 13

Small packing example: Two LUT outputs each feed their own local DFF. This uses LUT_USED=2, DFF_USED=2, and LE_OCCUPIED=2, because each LUT/DFF pair packs into one LE4.

PLD-16 Utilization Report

Utilization (%) = Used / Available × 100%

ResourceUsedAvailableUtilization
LUT4121675%
DFF61637.5%
LE4 occupied131681.25%
BRAM16x822100%
DSP8_MADD1250%
Digital I/O101662.5%

Each resource is reported separately. Here, BRAM is the immediate bottleneck: another required BRAM prevents fit even though LUT, DFF, LE, DSP, and I/O capacity remains.

Reusable Logic and Resource Sharing

A common subfunction can reduce LUT count when its result can be routed to every consumer. Sharing a time-multiplexed hard resource reduces area but usually increases latency and lowers throughput.

Reusable Logic and Resource Sharing
ChoiceResource useThroughput/latency consequence
Parallel resourcesHigherMore simultaneous work
Shared resourceLowerOperations are scheduled across cycles

Routing-Aware Optimization

When two mappings use the same number of LUTs, prefer the one that meets all constraints with acceptable LOGIC_LEVELS, fan-out, and ROUTE_HOPS. Remember that ROUTE_HOPS compares structural route cost only; it is not a delay value.

Practical rule: Optimize for a design that fits every resource budget and behavior requirement, not merely the smallest LUT count.

8. PLD Implementation Flow and Debugging

Conceptual Implementation Flow

Conceptual Implementation Flow

Placement chooses resource locations; routing selects programmable paths. A correct logical mapping can still fail to route or fail timing.

For SRAM-configured devices, startup includes loading configuration. Flash and antifuse retain configuration, but device readiness still follows the specified startup behavior.

Wrong LUT INIT Example

For F = A'·B + A·C with I0=A, I1=B, I2=C, and unused I3, the correct value is 16'hE4E4. Reversing bit significance produces 16'h2727, which implements the wrong rows.

CheckCorrect configurationFaulty configuration
Address 2 (0010)Bit 2 = 1Bit 2 = 1
Address 5 (0101)Bit 5 = 1Bit 5 = 1
Address 6 (0110)Bit 6 = 1Bit 6 = 0
Address 7 (0111)Bit 7 = 1Bit 7 = 0
Hex value16'hE4E416'h2727

Debug by checking ADDR = {I3,I2,I1,I0}, then reading CFG_INIT[ADDR] with bit 0 at the rightmost end of the hexadecimal value.

One-bit check example: With CFG_INIT=16'hE4E4 and address 0110 (decimal 6), Y=CFG_INIT[6]=1. Checking a single known row is a fast way to detect an address-order or bit-order mistake.

Product-Term Programming Fault

Required term: A'·B.

FieldCorrectFaultyEffect
A literal1001Uses A instead of A'
B literal0101Uses B
PT_EN11Term is active
Implemented termA'·BA·BWrong minterms become active

Also check PT_EN, polarity, combinational/registered mode, and OE. Correct internal logic with OE=0 still leaves the external pin undriven.

Routing Fault

Routing Fault

Trace from the failing destination backward through every programmed mux and inter-cluster stage. Change the minimum route controls and recheck that no unintended cross-connection or contention was introduced.

Systematic Debugging Flow

Systematic Debugging Flow

Symptom, Cause, and Correction

SymptomLikely classCheck and correction
Output wrong for selected input rowsLogic/configurationVerify LUT address order or product-term literals
Output changes immediately but should be clockedMacrocell/LE modeSelect registered output
Register does not clear until a clock edgeExpected synchronous reset behaviorApply RST=1 at a rising CLK_G edge
Internal result is correct but pin is inactiveI/O or OEAssert the correct output-enable control
Mapping report exceeds one resource typeResource-fit failureFactor, pack, share, or choose an available hard resource
Correct source does not reach destinationRoutingVerify each ROUTE_MUX4 and inter-cluster select
Intermittent or unsafe sequential behaviorClockingReplace fabric-generated clocks with CLK_G plus CE
Simulation/function passes but implementation timing failsTimingReduce LOGIC_LEVELS, fan-out, or route burden
Failure appears only after power-upStartup/configurationVerify configuration loading and readiness sequence
Failure occurs between clock domainsCDCApply the previously learned CDC structure; do not treat it as ordinary routing

Debugging Checklist

  1. Reproduce the smallest failing input, address, or clock sequence.
  2. Classify the fault as startup, logic/configuration, resource mapping, routing, clocking/CDC, timing, or I/O.
  3. Compare programmed values with the locked bit ordering and signal polarity.
  4. Check utilization by resource type and verify packing assumptions.
  5. Trace the exact route and count ROUTE_HOPS only as a structural metric.
  6. Verify rising-edge behavior and synchronous reset priority.
  7. Correct one fault class at a time and repeat the focused test.

Practical rule: Do not change Boolean logic first when the failure is caused by mode, enable, routing, clocking, startup, or exhausted resources.

Select Answer

Restart quiz!