Logo
All chapters
Volume II: Digital Logic  ›  Combinational Logic

Decoders

Turns an n-bit code into one active line out of 2ⁿ.

PrevMagnitude Comparator
NextEncoders

Description

A circuit that activates exactly one of 2ⁿ outputs for each n-bit input. It selects memory rows, devices, or implements arbitrary functions via minterms. AND each output to match one input combination (its minterm).

  • Each output corresponds to one minterm of the inputs.
  • OR selected outputs to realize any Boolean function directly.
  • An enable input gates all outputs off when inactive.
  • What: A circuit that activates exactly one of 2ⁿ outputs for each n-bit input.
  • Why: It selects memory rows, devices, or implements arbitrary functions via minterms.
  • How: AND each output to match one input combination (its minterm).
  • Where: Memory address decoding, instruction decode, demultiplexing.
  • When: Any time a coded value must select one of many targets.
  • Analogy — Like an apartment buzzer panel: you punch a short flat number (the code) and exactly one doorbell rings (one output line). The code picks one of many.

At a glance

What

A circuit that activates exactly one of 2ⁿ outputs for each n-bit input.

Why

It selects memory rows, devices, or implements arbitrary functions via minterms.

How

AND each output to match one input combination (its minterm).

Where

Memory address decoding, instruction decode, demultiplexing.

When

Any time a coded value must select one of many targets.

Think of it like…

Like an apartment buzzer panel: you punch a short flat number (the code) and exactly one doorbell rings (one output line). The code picks one of many.

Minterm generator

  • Each output corresponds to one minterm of the inputs.
  • OR selected outputs to realize any Boolean function directly.
  • An enable input gates all outputs off when inactive.

2-to-4 decoder

A1A0Active output
00D0
01D1
10D2
11D3

Black-box view

A1A0EN2-to-4 Decoderblack boxD0D1D2D3

Inputs on the left → outputs on the right · particles show signal direction

2-to-4 decoder

▶ live simulator
A10A00EN1DEC2:41D00D10D20D3

Code 00 = activates D0 (one-hot).

The 5 Whys

  1. 1

    Why a decoder? To select one target from a coded address.

  2. 2

    Why one-hot outputs? Exactly one device/row should respond.

  3. 3

    Why is it a minterm generator? Each line equals one input combination.

  4. 4

    Why useful for functions? OR the needed minterm lines together.

  5. 5

    Root cause: decoding maps a compact code to explicit, mutually exclusive selections.

Cheat sheet

Working principle

  • AND each output to match one input combination (its minterm).
  • A circuit that activates exactly one of 2ⁿ outputs for each n-bit input.

Key facts

  • Each output corresponds to one minterm of the inputs.

Why it exists

  • Root cause: decoding maps a compact code to explicit, mutually exclusive selections.
PrevMagnitude Comparator
NextEncoders