This page is the practice arena for the DEMUX topic . We will hit every kind of question a DEMUX can throw at you — normal routing, the data-is-zero trap, the decoder-mode trick, MSB/LSB confusion, cascading, and a real-world word problem. First we map the terrain, then we walk each cell.
Intuition Symbols we will use (all earned on the parent note)
D = the single data input (one bit: 0 or 1 ).
S n − 1 … S 0 = the n select lines . S n − 1 is the MSB (Most Significant Bit — the one worth the most), S 0 is the LSB (Least Significant Bit — worth 1 ).
Y 0 … Y 2 n − 1 = the 2 n outputs , one per possible select code.
S means "NOT S " — flip the bit (0 = 1 , 1 = 0 ).
m k = the minterm for code k (see Minterms and SOP ): the AND of the select variables that is 1 only when the selects spell k in binary.
Master rule from the parent: Y k = D ⋅ m k .
Every DEMUX question is one (or a blend) of these cells. The table below is our checklist — the examples that follow each say which cell they land in.
Cell
What makes it tricky
Covered by
A. Plain route
data = 1 , one clear destination
Ex 1
B. Data = 0 (degenerate)
destination chosen but nothing to deliver
Ex 2
C. Boundary codes 0 and max
first output Y 0 and last output Y 2 n − 1
Ex 3
D. Decoder mode (D = 1 fixed)
DEMUX behaving as a decoder
Ex 4
E. MSB/LSB flip (exam trap)
same bits read two ways give different outputs
Ex 5
F. Cascade / build big from small
two small DEMUX = one bigger DEMUX
Ex 6
G. Real-world word problem
translate a story into D , selects, output
Ex 7
H. Reverse question
"which selects light Y k ?" — go backward
Ex 8
The count of outputs is always 2 n for n selects. Keep that in your pocket.
Worked example Example 1 — Cell A: plain route (1-to-8 DEMUX)
A 1 -to-8 DEMUX has n = 3 selects. Given D = 1 and S 2 S 1 S 0 = 011 , which output is high?
Forecast: guess the output index before reading on — convert 011 to decimal in your head.
Convert the select code to a number. S 2 S 1 S 0 = 011 = 0 × 4 + 1 × 2 + 1 × 1 = 3 .
Why this step? The output index equals the decimal value of the selects — this instantly names the destination as Y 3 .
Write the minterm for k = 3 . Code 3 is S 2 = 0 , S 1 = 1 , S 0 = 1 , so m 3 = S 2 S 1 S 0 .
Why this step? m 3 must be 1 only at code 011 ; each variable appears complemented where the bit is 0 .
Apply the master rule. Y 3 = D ⋅ m 3 = 1 ⋅ ( 0 ⋅ 1 ⋅ 1 ) = 1 ⋅ ( 1 ⋅ 1 ⋅ 1 ) = 1 . Every other Y k = 0 because its minterm is 0 here.
Verify: exactly one output is 1 and its index (3 ) matches the select decimal (3 ). ✅
Worked example Example 2 — Cell B: the data-is-zero trap (1-to-4 DEMUX)
Same routing intent, S 1 S 0 = 10 , but D = 0 . What are all four outputs?
Forecast: does "select = 2 " still light Y 2 ? Guess yes/no.
Find the addressed output. S 1 S 0 = 10 = 1 × 2 + 0 × 1 = 2 , so the chosen output is Y 2 .
Why this step? The selects still pick a door — they don't care about D .
Multiply the data in. Y 2 = D ⋅ S 1 S 0 = 0 ⋅ ( 1 ⋅ 1 ) = 0 .
Why this step? The master rule is Y k = D ⋅ m k . Even the chosen output's minterm is 1 , but D = 0 crushes it to 0 .
The rest. Y 0 = Y 1 = Y 3 = 0 (their minterms are 0 ) — so all four outputs are 0 .
Verify: a DEMUX never invents a 1 . If nothing comes in (D = 0 ), nothing comes out — the "empty train" from the parent's Feynman story. ✅
Worked example Example 3 — Cell C: the two boundary codes (1-to-4 DEMUX)
On a 1 -to-4 DEMUX with D = 1 , evaluate the smallest code S 1 S 0 = 00 and the largest code S 1 S 0 = 11 . Confirm the first and last outputs behave.
Forecast: which outputs? Guess before computing.
Code 00 (decimal 0 ). m 0 = S 1 S 0 = 0 ⋅ 0 = 1 ⋅ 1 = 1 , so Y 0 = D ⋅ m 0 = 1 .
Why this step? Y 0 is the "all-selects-zero" output — its minterm uses all complemented variables. This is the easy-to-forget corner.
Code 11 (decimal 3 ). m 3 = S 1 S 0 = 1 ⋅ 1 = 1 , so Y 3 = D ⋅ m 3 = 1 .
Why this step? Y 3 is the "all-selects-one" output — its minterm uses no complements at all. The other boundary.
Boundaries never overlap. At code 00 only Y 0 = 1 ; at code 11 only Y 3 = 1 . No code fires two outputs.
Verify: the four minterms m 0 , m 1 , m 2 , m 3 are mutually exclusive and cover all 4 codes — a complete, gap-free set (this is why Decoders and DEMUX outputs partition the input space). ✅
Worked example Example 4 — Cell D: DEMUX as a decoder (1-to-8,
D = 1 )
Tie D = 1 permanently on a 1 -to-8 DEMUX and sweep the selects S 2 S 1 S 0 from 000 to 111 . Show it becomes a 3 -to-8 decoder.
Forecast: with D stuck at 1 , what does each Y k reduce to?
Kill the data term. Y k = D ⋅ m k = 1 ⋅ m k = m k .
Why this step? Setting D = 1 removes the gating — each output is now purely its minterm, which is exactly a decoder output.
Spot-check code 101 (decimal 5 ). m 5 = S 2 S 1 S 0 = 1 ⋅ 0 ⋅ 1 = 1 ⋅ 1 ⋅ 1 = 1 , so Y 5 = 1 , all others 0 .
Why this step? One concrete code proves the whole sweep: each of the 8 codes lights exactly its own line.
Interpret. As the selects count 0 → 7 , the single high output walks Y 0 → Y 7 — the defining behaviour of a 3 -to-8 line decoder . Same silicon, new job.
Verify: 8 codes → 8 outputs, each high once → a valid decoder truth table. This is realisation #1 from the parent note. ✅
Worked example Example 5 — Cell E: MSB/LSB flip (the classic exam trap)
The bits on the wires are S 1 = 1 , S 0 = 0 , and D = 1 on a 1 -to-4 DEMUX. A student reads them LSB-first as "01 " and answers Y 1 . Using the correct convention (S 1 = MSB), find the true output and expose the mistake.
Forecast: Y 1 or Y 2 ? Commit to a guess.
State the convention. S n − 1 is the MSB. Here S 1 (MSB, weight 2 ) = 1 and S 0 (LSB, weight 1 ) = 0 .
Why this step? Value depends on which wire is worth more; you must fix this before converting.
Convert correctly. Value = S 1 × 2 + S 0 × 1 = 1 × 2 + 0 × 1 = 2 . So the true output is Y 2 .
Why this step? Weighting each bit by its place value is the only correct decode.
The student's error. Reading LSB-first swaps the bits to "01 " = 1 , giving Y 1 — wrong. They multiplied S 0 by 2 and S 1 by 1 , i.e. flipped the weights.
Verify: compute Y 2 = D S 1 S 0 = 1 ⋅ 1 ⋅ 0 = 1 ✅, while Y 1 = D S 1 S 0 = 1 ⋅ 1 ⋅ 0 = 0 — the student's answer is genuinely 0 , confirming they'd be wrong. ✅
Worked example Example 6 — Cell F: cascade two 1-to-4 into one 1-to-8
We only have 1 -to-4 DEMUX chips (2 selects, 4 outputs each) but need a 1 -to-8 (3 selects). Use the new top bit S 2 to pick which chip gets the data. If S 2 S 1 S 0 = 110 , which of the eight outputs fires (D = 1 )?
Forecast: which chip, and which of its four lines?
Split the address. Look at the figure: S 2 feeds a 1 -to-2 DEMUX that routes D to either Chip A (when S 2 = 0 ) or Chip B (when S 2 = 1 ). The lower bits S 1 S 0 then pick the line inside the chosen chip.
Why this step? The MSB has weight 4 — flipping it jumps the destination by 4 , exactly the size of one chip's output block. So MSB = "which block", low bits = "which line in block".
Route by S 2 . S 2 = 1 → data goes to Chip B , whose outputs are Y 4 … Y 7 . Chip A's outputs Y 0 … Y 3 receive 0 .
Why this step? The first-stage DEMUX gives D to only one chip; the other chip sees data = 0 , so all its outputs are 0 .
Route by S 1 S 0 inside Chip B. S 1 S 0 = 10 = 2 , so Chip B's third line fires. Its outputs are Y 4 , Y 5 , Y 6 , Y 7 , so line-index 2 inside it is Y 4 + 2 = Y 6 .
Why this step? Output index = (block base 4 ) + (in-block index 2 ) = 6 , which matches 110 = 6 directly.
Verify: S 2 S 1 S 0 = 110 = 6 , and the cascade lit Y 6 . Whole-address decimal (6 ) equals block-plus-offset (4 + 2 = 6 ). ✅
Worked example Example 7 — Cell G: real-world word problem (memory row select)
A tiny memory has 8 rows. A CPU sends a 3 -bit row address A 2 A 1 A 0 = 100 and a write-enable pulse that is currently 1 . A 1 -to-8 DEMUX distributes the write pulse to the correct row (see Memory Addressing ). Which row's write line goes high?
Forecast: guess the row number.
Map the story onto DEMUX pins. Data input D = the write-enable pulse = 1 . Select lines = the address A 2 A 1 A 0 . Outputs Y 0 … Y 7 = the 8 row-write lines.
Why this step? A word problem is solved by naming which real signal is D and which is the selects . Here the pulse is the thing being routed; the address chooses where.
Decode the address. A 2 A 1 A 0 = 100 = 1 × 4 + 0 × 2 + 0 × 1 = 4 . So Y 4 (row 4 ) receives the pulse.
Why this step? Same decimal-conversion habit — the address is the select code.
Check the others. All rows except row 4 get 0 , so no other row is accidentally written — vital, or data corrupts. Y 4 = D A 2 A 1 A 0 = 1 ⋅ 1 ⋅ 1 ⋅ 1 = 1 .
Verify: exactly one row-write line high, index 4 = address decimal 4 . If the write-enable had been 0 (no write happening), even row 4 stays 0 — the safe idle state. ✅
Worked example Example 8 — Cell H: the reverse question
On a 1 -to-16 DEMUX (n = 4 ), you observe that output Y 13 is the one carrying the data. What must the select lines S 3 S 2 S 1 S 0 be, and what is m 13 ?
Forecast: convert 13 to 4 -bit binary first.
Decimal → binary. 13 = 8 + 4 + 1 = 1101 , so S 3 S 2 S 1 S 0 = 1101 .
Why this step? The reverse of "selects → output index" is "output index → selects". Break 13 into powers of two: 8 ( = S 3 ) , 4 ( = S 2 ) , 0 , 1 ( = S 0 ) .
Check the weights: 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 13 . ✅
Build the minterm. A bit that is 1 appears plain , a bit that is 0 appears complemented : m 13 = S 3 S 2 S 1 S 0 .
Why this step? The minterm must equal 1 only at code 1101 ; the single 0 -bit (S 1 ) is the one that gets the bar.
Sanity spot-check. Plug S 3 S 2 S 1 S 0 = 1101 : m 13 = 1 ⋅ 1 ⋅ 0 ⋅ 1 = 1 ⋅ 1 ⋅ 1 ⋅ 1 = 1 . Any other code makes at least one factor 0 .
Verify: 16 outputs need n = 4 selects (2 4 = 16 ), and 1101 = 13 round-trips back to Y 13 . ✅
Recall Quick self-test
A 1-to-4 DEMUX has S 1 S 0 = 01 , D = 1 . Which output? ::: Y 1 (binary 01 = decimal 1 ).
Output Y 6 of a 1-to-8 DEMUX fires — what are the selects? ::: S 2 S 1 S 0 = 110 (since 6 = 110 ).
Why do all outputs go 0 when D = 0 ? ::: Master rule Y k = D ⋅ m k ; a factor of 0 zeroes every output.
In a cascade, what does the MSB select? ::: Which sub-chip (output block) receives the data.
Mnemonic The two-step habit for every question
Decode, then gate. First turn the selects into a decimal index (that names the door); then multiply by D (that's whether anything walks through it).
Demultiplexers — the parent topic these examples drill.
Decoders — Example 4 shows DEMUX-with-D = 1 is a decoder.
Minterms and SOP — every m k we built is a minterm.
Multiplexers — the mirror operation; compare "many-in-one-out".
Memory Addressing — Example 7's row-select DEMUX.
Bus Systems — routing one bus line to a chosen destination.
Encoders — the reverse-direction family member.