TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Glue Logic: Definition, Examples and a 6502 Address Decoder

The Editor's Desk
by
1
Share Facebook X LinkedIn WhatsApp Email

Glue logic is the small amount of custom circuitry needed to make two or more off-the-shelf integrated circuits work together: address decoders, chip selects, read and write strobes, wait-state generators and similar interface logic. It was once built from 74-series TTL chips, then from PALs and CPLDs, and today it usually lives inside an FPGA or as small blocks of RTL between IP cores on an SoC.

Key takeaways

  • Glue logic adapts interfaces; it does not add the product's main function.
  • The classic example is the address decoder that divides a processor's address space into RAM, ROM and I/O.
  • Implementation moved from discrete 74xx logic to programmable logic (PAL, GAL, CPLD, FPGA) and then into the chips themselves, giving "glueless" interfaces.
  • In SoC RTL, "glue logic" means the small random logic that connects IP blocks at the top level.

What glue logic is

Glue logic is the circuitry needed to achieve compatible interfaces between two (or more) different off-the-shelf integrated circuits.

An example of glue logic is the address decoder, which with older processors like the 6502 or Z80 had to be added externally to divide up the addressing space of the processor into RAM, ROM and I/O. Newer versions of the same processors (such as the WDC 65816 or Zilog eZ80) instead have internal address decoders, so glueless interfacing to the most common external devices becomes possible.

Editor's note (2026): the Zilog eZ80 family includes programmable chip-select outputs, which removes much of the external decoder. The WDC 65C816 multiplexes its bank address on the data bus, which usually needs an external latch, so check the data sheet of the specific part before assuming a glueless design.

Sometimes vendors also use glue logic to hide proprietary circuitry and to make the product harder to counterfeit. Programmable devices such as PALs and CPLDs have a security fuse or bit that, once set, blocks reading back the programmed logic, which makes the board harder to copy.

Common kinds of glue logic

FunctionWhat it doesTypical example
Address decodingTurns high address bits into chip-select signalsSelecting RAM, ROM or a UART from a CPU bus
Strobe generationCombines clock, read/write and select into write-enable and output-enableQualifying a RAM write with the CPU clock phase
Wait-state generationStretches a bus cycle for a slow deviceDriving a READY or WAIT input for slow EPROM
Bus and level adaptationMatches bus widths, polarities or voltage levelsInverting an active-high interrupt into an active-low input
Interrupt combiningMerges several interrupt sources into one CPU inputWired-OR of open-drain interrupt lines
Reset handlingSynchronizes and stretches resetPower-on reset with a synchronized release

The interrupt case has its own story: see why interrupts are active low.

How glue logic is implemented over time

  1. Discrete logic: 74-series gates, decoders and flip-flops on the board.
  2. Simple programmable logic: PALs and GALs replaced several 74xx chips with one programmable sum-of-products device.
  3. CPLDs and FPGAs: larger interfaces, bus bridges and state machines in one device, reprogrammable after the board is built. The trade-offs between logic block sizes are explained in coarse and fine grained architectures.
  4. Integration: microcontrollers and SoCs absorbed chip selects, wait states and bus interfaces, giving glueless connections to common memories and peripherals.

Quick answers

What is glue logic in simple terms? It is the extra logic that lets chips that were not designed for each other talk to each other.

What does "glueless" mean? A glueless interface connects two devices directly, with no external logic, because one of them already includes the decoder, strobes or bus adaptation needed.

Is glue logic still used today? Yes. It lives in small CPLDs and FPGAs on boards and in top-level RTL on SoCs.

Why use a CPLD for glue logic? CPLDs have predictable pin-to-pin delays, are often ready immediately after power-up because their configuration is non-volatile, and can be reprogrammed to fix an interface without a board respin.

Deep dive: the numbers and details

This part holds the worked decoder in Verilog, its timing budget, chip counts and the SoC view. Skip it if the overview is all you need.

Worked example: a 6502 address decoder

The 6502 has a 16-bit address bus (64 KB) with memory-mapped I/O. Its reset and interrupt vectors sit at the top of memory (FFFA to FFFF), and its zero page and stack sit at the bottom (0000 to 01FF), so ROM must cover the top and RAM the bottom. A simple map using only address lines A15 and A14:

Range (hex)SizeDeviceA15A14
0000 to 7FFF32 KBRAM0x
8000 to BFFF16 KBI/O10
C000 to FFFF16 KBROM11

With active-low chip selects, the logic is three equations. The RAM write enable is also qualified by the PHI2 clock, because the 6502 address and R/W lines are only guaranteed stable during the PHI2 high phase. On the 6502, R/W is high for a read and low for a write.

module addr_decode_6502 (
  input  wire a15,
  input  wire a14,
  input  wire phi2,
  input  wire rw,        // 1 = read, 0 = write
  output wire ram_cs_n,
  output wire io_cs_n,
  output wire rom_cs_n,
  output wire ram_we_n
);
  assign ram_cs_n = a15;               // 0000 to 7FFF
  assign io_cs_n  = ~(a15 & ~a14);     // 8000 to BFFF
  assign rom_cs_n = ~(a15 &  a14);     // C000 to FFFF
  assign ram_we_n = ~(phi2 & ~rw);     // write only in PHI2 high
endmodule

In a 1980s design this would be one or two 74-series chips (for example a 74HC139 dual 2-to-4 decoder) or a single small PAL. The I/O block is very large here; a real design would decode more address lines to give each peripheral a small window, which is exactly where glue logic tends to grow.

Timing budget for the decoder

Glue logic sits in the path between the address bus and the memory, so its delay eats into the memory's access time. Texas Instruments gives these figures for the SN74HC139 dual 2-to-4 decoder at 4.5 V with a 50 pF load:

ParameterTypical at 25 CMaximum at 25 CMaximum, full SN74 temperature range
Propagation delay, A or B input to Y output14 ns35 ns44 ns
Propagation delay, enable G to Y output11 ns35 ns44 ns

Worked budget, with illustrative numbers: suppose a 1 MHz system (1,000 ns cycle) where the address is stable 300 ns before the processor samples the data, and the processor needs the data 100 ns before that sampling edge. The path from address to valid data then has 300 - 100 = 200 ns. Take away the decoder's worst-case 44 ns and the RAM has 156 ns from chip select to data. A RAM with a 150 ns chip-select access time just fits; a 200 ns part would need a wait state. Real numbers come from the processor and memory data sheets. The lesson holds regardless: budget with the decoder's maximum delay, not its typical delay.

Counting the chips: discrete versus programmable

In the decoder above, RAM_CS_n is simply A15, so it needs no gate. One half of a 74HC139 decodes A15 and A14 into four active-low outputs; the outputs for 10 and 11 become IO_CS_n and ROM_CS_n. The write strobe needs an inverter and a NAND gate, for example from one 74HC00 quad NAND package. That is two packages for the whole map. A finer I/O decode (say, eight 1 KB windows inside the I/O block) adds a 3-to-8 decoder such as a 74HC138, and each extra package adds board area, power and one more delay in series. A single PAL or small CPLD can hold all of these equations in one package with one pin-to-pin delay, which is the saving that made programmable logic attractive for glue functions.

Glue logic inside an SoC RTL

In ASIC and SoC design the term now describes the small, unstructured logic at the top level: muxes for test and functional modes, register bits that drive enables, simple handshakes between IP blocks and reset sequencing. Good practice is to keep this logic in its own clearly named RTL modules rather than scattered through the top level, because it is easy to overlook in verification, timing constraints and clock domain crossing checks.

Mistakes to avoid

  • Decoding too few address bits, so a device appears at many aliased addresses and later expansion collides with it.
  • Generating write strobes without qualifying them by the right clock phase, which causes spurious writes.
  • Letting glue logic gather at the SoC top level with no owner, no tests and no timing constraints.
  • Crossing clock domains in glue logic without a synchronizer.

Related reading

The Editor's Desk
About the Author
The Editor's Desk
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

1 Comments

Your comments will be moderated before it appears here.

Post a Comment

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!