3.3.8 · D3Combinational Circuits

Worked examples — Decoders (2 - 4, 3 - 8)

4,060 words18 min readBack to topic

This page is the "case gym" for the parent decoder note. We take every kind of question a decoder can throw at you and grind through one worked example per case — from the simplest "which line lights up" to active-low chips, demux routing, and full chip-expansion. Read the scenario matrix first, then work each example before peeking at the steps.

Everything here is built on one fact you already met: a decoder turns a binary address (a number written in 0s and 1s) into a one-hot output — exactly one wire goes "hot" (active), the one whose number equals the address. If any word here is unfamiliar, that's fine — each example rebuilds it from zero.


The scenario matrix

Every decoder problem is one of these case classes. The examples below each carry a tag like (Cell A) so you can see the whole grid is covered.

Cell Case class What makes it tricky Covered by
A Plain 2:4 evaluate mapping binary → decimal index Ex 1
B Plain 3:8 evaluate 3 bits, bigger index arithmetic Ex 2
C MSB/LSB swap trap reading bits in the wrong order Ex 3
D Disabled chip (Enable = 0) the degenerate all-zero output Ex 4
E Active-low outputs "selected" means 0, not 1 Ex 5
F Implement an SOP function OR the right minterm outputs Ex 6
G Decoder as demultiplexer data on Enable, routing Ex 7
H Limiting / boundary cases address 0, address Ex 8
I Real-world word problem memory row/chip select Ex 9
J Exam twist (build 4:16) hierarchical expansion Ex 10

Setup: labels we will reuse

Before any symbol appears in an example, here is the full vocabulary, once. Nothing below this box uses a symbol not defined here.


Worked Examples

Ex 1 — Plain 2:4 evaluate (Cell A)

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

Reading the figure. The box is the decoder; the two arrows on the left are the input bits ; the four arrows on the right are . Three are grey (logic 0) and one is red — that red wire is . It maps directly to step 3: the algebra said "", and the picture shows exactly that one wire carrying current while its three siblings stay dark.


Ex 2 — Plain 3:8 evaluate (Cell B)


Ex 3 — MSB/LSB swap trap (Cell C)

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

Reading the figure. The single bit-string "0 1 1" sits at the top. Two arrows fan out: the grey left branch is the wrong reading (bits taken as , giving value 3 → grey lamp), and the red right branch is the correct MSB-anchored reading (bits as , giving value 6 → red lamp). The picture shows the two branches landing on different lamps — a direct visual of step 3's ", not ".


Ex 4 — Disabled chip: the degenerate case (Cell D)


Ex 5 — Active-low outputs, multi-enable chip (Cell E)

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

Reading the figure. Eight output arrows leave the box. Seven are grey and labelled "1" (their inactive level), and the single red arrow is labelled "0" — that lonely 0 is the selected line . This is the visual of step 3: active-low flips the meaning, so the winner is the one wire at 0 while all its siblings rest at 1.


Ex 6 — Implement an SOP function (Cell F)


Ex 7 — Decoder as demultiplexer (Cell G)


Ex 8 — Boundary / limiting cases (Cell H)


Ex 9 — Real-world: memory chip select (Cell I)


Ex 10 — Exam twist: build a 4:16 decoder (Cell J)

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

Reading the figure. Two stacked boxes are the two 3:8 banks. The red wire from is the steering signal: it feeds to the top box (drawn grey = the off / all-zero bank of step 3) and to the bottom box (drawn black = on). Inside the live bottom bank the lower bits pick internal line 3, which the numbering maps to the red output on the right — mirroring steps 3→5 exactly.


Recall

Recall Which cell is which?

Cell D (disabled) is the only case with ::: zero hot lines — every other case has exactly one.

Recall Active-low selected line

On an active-low chip the selected output is ::: 0, and all the others are 1.

Recall Decoder-as-demux

To make a decoder route a data bit, put the data on the ::: Enable pin; the address selects which output copies it.

Recall 4:16 from two 3:8

The extra top bit () is used to ::: enable one 3:8 bank via / while the lower three bits address inside it.

Recall What is a minterm

? An AND of all inputs, complemented where the bit of is 0, that is 1 for ::: exactly one input combination — namely ; and .

Recall Multi-enable chip (74138)

A chip with pins is enabled only when ::: all agree: AND AND .


Connections

  • Decoders (2 - 4, 3 - 8) — parent note; this page drills its every case.
  • Minterms and Maxterms — each output is a minterm (Ex 6).
  • Sum of Products (SOP) — decoder + OR realizes any SOP (Ex 6).
  • Demultiplexers — decoder + data-on-enable (Ex 7).
  • Multiplexers — complementary block.
  • Encoders — the inverse (one-hot in, binary out).
  • Memory Address Decoding — chip-select example (Ex 9).
  • 7-Segment Display Driver — another decode-to-many use.

Case Map

weigh and add

selects

forces

selected line

becomes

steers bank

OR chosen lines

binary address

decimal index

one hot line

Enable equals 0

all lines off

active low chip

logic 0

data on Enable

demultiplexer

extra top bit

bigger decoder

any SOP function