Decoder

A digital decoder is a logic circuit that takes a compact binary code as input and activates exactly one of many output lines corresponding to that code — the direct inverse of an encoder, which compresses many inputs down into one compact code in the first place. A standard 3-to-8 decoder takes a 3-bit binary input and activates exactly one of 8 output lines, since three bits can represent exactly eight distinct codes, each one uniquely mapped to a single output. How a decoder actually expands a compact binary code back out into one specific activated line looks like this:

Compact binary code presented as input
Far fewer wires than the number of possible outputs
Decoding logic evaluates every possible codeEach output has its own dedicated AND-gate-style detector
Input code compared against every output's address
Each output line checks for one specific, unique code
Exactly one match found
Only one output's assigned code matches the current input
Matching output line activated
All other output lines stay inactive
↻ next input code change
One specific output line selected
Used to address memory, select a device, or drive a display

A few things are worth knowing about why a decoder's one-of-many output activation turns out to be exactly the mechanism chip memory addressing relies on:

A decoder's core job — turning a compact binary address into one specific activated line — is precisely the mechanism memory addressing depends on, which is why a decoder sits directly inside the address path of essentially every memory chip ever built. A memory array storing millions or billions of individual bits can't practically have one dedicated address wire running to every single storage location; instead, a binary address is presented to a decoder, which activates exactly one word line or row out of the entire array, and only the storage cells along that single activated line are read or written during that access. This is why decoder size scales directly with memory capacity — a memory array with twice as many rows needs exactly one additional address bit and a correspondingly larger decoder, following the same logarithmic address-to-capacity relationship that makes it practical to address even enormous memory arrays with a comparatively small number of address pins.

3-to-8 Decoder one 3-bit code selects exactly one of eight output lines Input code 101 DECODER checks input against every output's address Out 0 Out 1 Out 2 Out 3 Out 4 Out 5 ✓ Out 6 Out 7 binary 101 = decimal 5 — only Output 5 activates every other output stays off this is exactly how a memory chip picks one row out of millions from a single binary address

Seven-segment display driving is one of the most visually familiar applications of decoding logic, converting a compact 4-bit binary-coded-decimal value into exactly the right combination of segment signals needed to display that digit as readable text. A seven-segment display shows a single decimal digit using seven individually controllable light segments arranged in a figure-eight pattern, and a BCD-to-seven-segment decoder takes a 4-bit code representing a digit from 0 through 9 and activates precisely the right subset of those seven segments to form that digit's recognizable shape — the digit 8 requires every segment lit, while the digit 1 requires only two. This is a slightly more elaborate decoder than the simple one-of-many type, since multiple output segments activate together for most digits rather than exactly one output per input code, but the underlying principle is identical: a compact binary code maps deterministically to a specific, predictable output pattern.

A decoder with an added enable input lets external control logic turn the entire decoder on or off as a single unit, without needing to change the address code itself, which turns out to be essential for building larger systems out of smaller decoder blocks. Adding a single enable line to a decoder means every one of its outputs stays inactive whenever that enable signal is off, regardless of what address code is present at the input — a simple addition that becomes critical when a system needs to select among several different decoder blocks, say choosing between different memory banks or different device address ranges, since higher-level control logic can enable exactly one decoder block at a time using the enable inputs, effectively building a larger decoding hierarchy out of smaller decoder building blocks rather than needing one impossibly large monolithic decoder for the whole system.

Bus and device selection in a larger digital system relies on decoding logic to translate an address into exactly which single device on a shared bus should respond, the same core mechanism as memory row selection but applied to picking among entire peripheral devices rather than individual memory rows. When a processor wants to communicate with one specific device among several sharing a common address and data bus — a particular memory chip, a particular peripheral controller — an address decoder examines the relevant address bits and asserts a chip-select signal to exactly the one device that address was meant for, leaving every other device on the same shared bus inactive and ignoring the transaction entirely. This address-decoding pattern is what allows many independent devices to coexist safely on one shared electrical bus without constantly interfering with each other's communications.

Read a decoder as the precise mirror image of an encoder: where an encoder compresses many active inputs down into one compact code, a decoder expands one compact code back out into exactly one activated output among many, and that expansion mechanism — scaled up with enable inputs for hierarchical selection — is the literal circuit underlying memory row addressing, device bus selection, and the seven-segment digits on countless simple digital displays.

Take decoder further

Ask the copilot about this term, or have our engineers assess it against your process.