3.3.8Combinational Circuits

Decoders (2 - 4, 3 - 8)

1,900 words9 min readdifficulty · medium3 backlinks

The Core Idea: outputs = minterms

WHY each output is a minterm. A minterm of variables A,BA,B is a product term that is 11 for exactly one combination. E.g. AˉB\bar A B is 11 only when A=0,B=1A=0, B=1. Since we want each output high for exactly one input combination, each output is a minterm.

Derivation from scratch (2:4): Write the truth table. We want Dk=1D_k=1 only in row kk.

A1A_1 A0A_0 D3D_3 D2D_2 D1D_1 D0D_0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0

Each column has a single 1 → each output is a single minterm → read it straight off. No K-map simplification needed; a decoder is literally "one gate per minterm".


Enable input (the practical must-have)

With active-high enable, each output becomes Dk=E(minterm)D_k = E \cdot (\text{minterm}). Example: D2=EA1A0D_2 = E \cdot A_1 \cdot \overline{A_0}.

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

3:8 Decoder

Building 3:8 from two 2:4 decoders + Enable (Feynman-style construction):

  • The MSB A2A_2 chooses which 2:4 decoder is active.
  • Feed A1A0A_1A_0 to both 2:4 decoders.
  • Top decoder handles A2=0A_2=0 (outputs D0..D3D_0..D_3): enable it with E=A2E = \overline{A_2}.
  • Bottom decoder handles A2=1A_2=1 (outputs D4..D7D_4..D_7): enable it with E=A2E = A_2.

Why this works: For any input, exactly one of the two decoders is enabled (they can't both be on since A2A_2 and A2\overline{A_2} are opposite). The enabled one picks one line among its four. Result: one-hot over all 8. This is the hierarchical decoder trick and generalizes to any size.


Worked Examples


Common Mistakes


Recall Feynman: explain to a 12-year-old

Imagine a light switchboard with 4 lamps. You don't have 4 switches — you have 2 switches showing a number in "on/off" code (00,01,10,11). The decoder is a little machine that reads that 2-switch number and turns on only the matching lamp. Two switches → 4 lamps. Three switches → 8 lamps. The "Enable" button is a master power button: press it off and all lamps go dark no matter what number you set.


Flashcards

What does an n:2nn:2^n decoder do?
Converts an nn-bit binary input into one-hot output — activates exactly one of 2n2^n output lines (the one equal to the input's decimal value).
Why is each decoder output a minterm?
Because each output must be 1 for exactly one input combination, which is precisely the definition of a minterm.
2:4 decoder: write D2D_2.
D2=A1A0D_2 = A_1 \overline{A_0} (fires when A1A0=10A_1A_0=10).
3:8 decoder: which output fires for input 101?
D5D_5, since 1012=5101_2 = 5; equals A2A1A0A_2\overline{A_1}A_0.
What is the role of the Enable input?
When disabled, all outputs are inactive; when enabled the decoder works normally. Also allows expansion and demux use.
How do you build a 3:8 decoder from two 2:4 decoders?
Feed A1A0A_1A_0 to both; enable top with A2\overline{A_2} (lines 0–3), bottom with A2A_2 (lines 4–7).
Decoder vs encoder?
Decoder: binary→one-hot (few→many). Encoder: one-hot→binary (many→few). They are inverses.
How to implement F=m(1,4,7)F=\sum m(1,4,7) with a 3:8 decoder?
OR together outputs D1,D4,D7D_1, D_4, D_7.
A decoder with data on the Enable pin acts as what?
A 1-to-2n2^n demultiplexer (routes the data bit to the addressed output).
For active-low outputs, what does the selected line look like?
It goes to 0 while all others are 1.

Connections

  • Minterms and Maxterms — decoder outputs are the minterms.
  • Multiplexers — dual/complementary block; MUX + decoder are common pair.
  • Demultiplexers — a decoder + enable = demux.
  • Encoders — the inverse operation.
  • Memory Address Decoding — real-world use: selecting RAM rows/chips.
  • Sum of Products (SOP) — decoders realize any SOP with an OR gate.
  • 7-Segment Display Driver — decoding numbers to display segments.

Concept Map

converted by

produces

activates

each output is

AND of inputs

derived from

special case

special case

gates each output

two of these plus enable

selects which

allows

n-bit binary address

n:2^n Decoder

One-hot output

Exactly one output line

Minterm

True or complement form

Truth table

2:4 Decoder

3:8 Decoder

Enable input E

MSB A2

Build bigger decoders

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, decoder ek chhota sa "address se line select karne wala" circuit hai. Aap use binary number dete ho (jaise 2 input bits), aur woh sirf ek output line ko high (1) karta hai — wahi line jiska number aapke input ke barabar hai. Isko one-hot output kehte hain, matlab ek hi "hot" (on) hota hai, baaki sab off. 2 input hain to 22=42^2=4 output, 3 input hain to 23=82^3=8 output. Simple formula: nn input → 2n2^n output.

Har output basically ek minterm hota hai — matlab inputs ka AND, kuch ko complement (bar) karke. Jaise 2:4 me D2=A1A0D_2 = A_1 \cdot \overline{A_0}, kyunki 2=102 = 10 binary me. Truth table banao, har column me sirf ek jagah 1 hoga, wahi minterm padh lo — koi K-map simplification ki zaroorat nahi.

Enable (E) input bahut kaam ka hai: E=0 karo to poora decoder so jaata hai (saare output 0). E=1 pe normal chalta hai. Iska sabse bada fayda — chote decoders se bade banane me. Jaise do 2:4 decoder lo, dono ko A1A0A_1A_0 do, upar wale ko A2\overline{A_2} se enable karo (lines 0–3), neeche wale ko A2A_2 se (lines 4–7) — ban gaya 3:8 decoder! Aur agar Enable pin pe data daal do to yehi decoder demultiplexer ban jaata hai.

Yaad rakho: decoder aur encoder ulte hain. Decoder = binary in, one-hot out (thode se zyada). Encoder = one-hot in, binary out. Real life me memory ke rows select karne, 7-segment display, aur kisi bhi SOP function ko banane me decoder + OR gate use hota hai. Bas MSB/LSB galat mat karna, warna wrong line select ho jayegi!

Go deeper — visual, from zero

Test yourself — Combinational Circuits

Connections