DE Notes
Complete guide to decoders: 2:4 and 3:8 decoder truth tables, Boolean expressions, enable inputs, IC 74138, cascading decoders, function implementation using decoders, and Verilog.
What is a Decoder?
A decoder converts an n-bit binary input code into one of 2ⁿ output lines. Exactly one output is active (HIGH) for each input combination.
3:8 Decoder — IC 74138
The 74138 is the standard 3-to-8 decoder with active-LOW outputs and enable inputs:
Enable logic: Active when G1=1 AND Ḡ2A=0 AND Ḡ2B=0
Truth Table (enabled, active-LOW outputs):
| A2 | A1 | A0 | Active output |
|---|---|---|---|
| 0 | 0 | 0 | Ȳ0 = 0 (all others = 1) |
| 0 | 0 | 1 | Ȳ1 = 0 |
| 0 | 1 | 0 | Ȳ2 = 0 |
| 0 | 1 | 1 | Ȳ3 = 0 |
| 1 | 0 | 0 | Ȳ4 = 0 |
| 1 | 0 | 1 | Ȳ5 = 0 |
| 1 | 1 | 0 | Ȳ6 = 0 |
| 1 | 1 | 1 | Ȳ7 = 0 |
Implementing Boolean Functions Using Decoder
A decoder generates all minterms. Any function can be implemented by ORing the required minterms.
Example: F(A,B,C) = Σm(0,3,5,6)
Why NAND? Active-LOW outputs of 74138 are already complemented minterms. NAND of complemented minterms = OR of minterms (De Morgan's).
Cascading 74138 Decoders for 4:16 Decoder
Decoder vs Demultiplexer
| Property | Decoder | Demultiplexer |
|---|---|---|
| Inputs | Address only | Address + 1 data line |
| Outputs | 2ⁿ (one-hot) | Routes data to 1 of 2ⁿ outputs |
| Function | Binary to one-hot | Data routing |
| Enable = data input | ✓ (decoder = DEMUX when enable used as data) | — |
A 74138 decoder doubles as a DEMUX — use the enable (G1) as the data input!
Interview Questions
Q1: What is the output of a 2:4 decoder when input A1A0 = 10? D2 = 1, all others (D0, D1, D3) = 0. Only the output corresponding to decimal 2 is active.
Q2: How can a decoder implement any combinational function? A decoder generates all minterms of n variables (one output per minterm). Any Boolean function is a sum of minterms. OR the decoder outputs corresponding to the function's minterms to get the function. It's a "minterm generator."
Q3: What is the advantage of using 74138 enable inputs? Multiple 74138s can be cascaded without additional logic by using the enable inputs. Also, the enable input (G1) serves as a data input for DEMUX operation. The three enable pins (G1, Ḡ2A, Ḡ2B) give design flexibility.
Q4: How many 3:8 decoders are needed to build a 5:32 decoder? 4 decoders of 3:8 give 32 outputs, but only handle 3 address bits. Adding a 2:4 decoder for the 2 MSBs to enable one of the four 3:8 decoders: total = 1 (2:4) + 4 (3:8) = 5 decoders.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Decoder — 2:4, 3:8 Decoder, IC 74138 and Applications.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Digital Electronics topic.
Search Terms
digital-electronics, digital electronics, digital, electronics, combinational, circuits, decoder, decoder — 2:4, 3:8 decoder, ic 74138 and applications
Related Digital Electronics Topics