3.3.8 · D2Combinational Circuits

Visual walkthrough — Decoders (2 - 4, 3 - 8)

2,067 words9 min readBack to topic

Before any symbol appears, let us agree what our raw material is.


Step 1 — Two switches make four possible "codes"

WHAT. We take two bits and give them names. Call the left one and the right one . The subscript is just a label so we can talk about each switch separately — nothing more yet.

WHY. A single switch only has 2 states, which cannot pick between 4 rooms. Two switches together have more room to breathe: each can be or independently, so together they can be in distinct settings. Four settings is exactly what we need to address four output lines.

PICTURE. Look at the four rows on the left. Each row is one combination of the two switches: . There are no others — you cannot invent a fifth combination of two on/off switches.

Figure — Decoders (2 - 4, 3 - 8)

We now have a way to turn any of the four codes into a plain decimal number . That number is the whole point: it names which output we want.


Step 2 — What we WANT: one lamp, never two

WHAT. We line up four output lamps, labelled . The stands for "decoder output"; the subscript is the lamp's number. Our goal: when the switches spell the number , lamp lights and the other three stay dark.

WHY. Downstream hardware (a memory row, a display segment) needs its own private wire that is high only for it. A binary code is compact but shared; we must fan it out to one dedicated wire per item. That "exactly one wire on" behaviour has a name.

PICTURE. In the figure, the switches read (value ), and only glows. This is one-hot: out of all the outputs, exactly one is "hot" (on).

Figure — Decoders (2 - 4, 3 - 8)

Step 3 — The truth table is the specification

WHAT. We write down, for every one of the four input rows, what all four lamps must do. This table is the definition of our circuit — it leaves nothing to guess.

WHY. A circuit is fully determined once you say its output for every possible input. With only 4 input rows, we can list them all — no case is skipped. Notice the shape of the answer before we do any algebra.

PICTURE. The highlighted diagonal of single 's is the key visual: each output column contains exactly one . That single- pattern is our clue for Step 4.

Figure — Decoders (2 - 4, 3 - 8)
value
0 0 0 1 0 0 0
0 1 1 0 1 0 0
1 0 2 0 0 1 0
1 1 3 0 0 0 1

Step 4 — Introducing NOT and AND (the only two tools we need)

Before we can write a lamp's equation, we must earn two operations. We choose these two on purpose — here is the "why this tool" for each.

WHY NOT. Lamp must fire when AND . But our building block "AND" (next paragraph) only fires on 's, not on 's. So we need a way to say "is this switch OFF?" as a fresh signal that is when the switch is . That flip is the job of NOT, written with a bar: reads "NOT ".

WHY AND. Each lamp must check several conditions at once (" is this AND is that"). The operation that is only when all its inputs are is AND, written as a dot: , or just .

PICTURE. The top panel shows NOT as a mirror: input becomes , input becomes . The bottom panel shows AND as a strict gatekeeper: its bulb lights only when both wires are on.

Figure — Decoders (2 - 4, 3 - 8)

Step 5 — Turning one table row into one equation (a minterm)

WHAT. Take row : it is high only when and . Translate each condition into our atoms and AND them.

WHY. We want a single expression that is in exactly one row and everywhere else — matching the single- column we saw in Step 3. " is " becomes (which is when ). " is " becomes . ANDing them gives something that is only when both are true — i.e. only in row .

PICTURE. The figure feeds through two NOT gates (both become ) into an AND gate whose output goes high — lamp lights. Change either switch and one input to the AND drops to , so the lamp dies.

Figure — Decoders (2 - 4, 3 - 8)


Step 6 — Do it for all four lamps

WHAT. Repeat Step 5 mechanically for each row. For each lamp, bar the switches that must be , leave plain the switches that must be , and AND them.

WHY. Every column in the truth table had a single , so every column is a minterm. There is nothing to simplify — no clever algebra, no K-map — because a single- column is already the simplest form. This is the beautiful thing about decoders: the table reads off directly as gates.

PICTURE. All four minterm circuits sit side by side. Trace the bars: a bar sits over exactly where that row needs , and over exactly where that row needs .

Figure — Decoders (2 - 4, 3 - 8)

These are exactly the four equations the parent note stated — but now you built them, symbol by symbol.


Step 7 — The degenerate case: the master switch (Enable)

WHAT. Add one more input ("Enable"). Redefine every lamp as its minterm ANDed with : .

WHY. We must cover the case where the whole chip should be silent — for instance while we build bigger decoders, or use it as a router. When , the AND forces every output to no matter what the switches say (because anything AND is ). When , the AND passes the minterm through unchanged (anything AND is itself). So is a clean on/off master.

PICTURE. Two panels. Left: — all four lamps dark even though the switches read . Right: , same switches — only glows, normal behaviour restored.

Figure — Decoders (2 - 4, 3 - 8)

The one-picture summary

This final figure compresses all seven steps: switches → decimal value → the single matching minterm → one hot lamp, with the Enable master gate riding on top.

Figure — Decoders (2 - 4, 3 - 8)
Recall Feynman: the whole walkthrough in plain words

We began with two light switches, each just on or off. Two switches can be set four ways: 00, 01, 10, 11 — and we read each setting as a plain number 0, 1, 2, 3 by giving the left switch double the weight of the right. Then we said what we WANT: four lamps, and only the lamp whose number matches the switches should glow. We wrote that wish as a table — and noticed each lamp's column had exactly one "1". To turn a "1" into wires, we earned two tiny tools: NOT (a mirror that flips a switch) and AND (a strict gatekeeper that lights only when everything feeding it is on). For each lamp we barred the switches that had to be off and left plain the ones that had to be on, then ANDed them — that combination is called a minterm, and it lights for exactly one setting. Doing that four times gave the four decoder equations directly, with no clever simplification needed. Finally we bolted on a master switch, Enable: AND it into every lamp so that flipping it off darkens the whole board at once. That is a 2:4 decoder — two switches in, one hot wire out, master power optional.


Connections

  • Minterms and Maxterms — each lamp's equation is a minterm; this page builds one from scratch.
  • Sum of Products (SOP) — OR a chosen subset of these outputs to realize any function.
  • Demultiplexers — reuse the Enable pin of Step 7 as a data line to route one bit.
  • Multiplexers — the complementary "many-to-one" block.
  • Encoders — the exact inverse: one-hot in, binary out.
  • Memory Address Decoding — where the one-hot lines pick physical RAM rows.
  • 7-Segment Display Driver — decoding a number into lit segments.