Decoder
A decoder maps an input code to an output pattern. A binary line decoder selects one output when enabled; a BCD-to-seven-segment decoder can activate several segment outputs for one digit. These are related functions, not the same one-hot truth table.
The SN74HC138 is a 3-to-8 line decoder with active-low outputs. With G1 HIGH and both G2A and G2B LOW, the binary address selects one LOW output while the others remain HIGH. Deactivating any enable forces all outputs HIGH. A display decoder such as CD4511B instead maps a BCD code to a segment pattern and includes separate control functions.
In plain terms
A line decoder is like a switchboard selecting one destination from an address. A display decoder is more like a translator that turns a digit code into several lit segments.
Why designers use it
- Generate chip-select signals for a bus with many peripheral ICs from three address lines.
- Drive seven-segment displays without custom code — send BCD, get segments.
- Multiplex analogue paths by enabling one of many analogue switches.
Best for
- Chip-select generation
- Seven-segment
- Demux
Key specifications
- Truth table: Input code, enable conditions and selected output pattern
- Polarity: Active-high versus active-low outputs
- Timing: Propagation delay and input-transition requirements
- Electrical interface: Supply range, logic thresholds and output drive
When not to use it
- When the selected truth table, output polarity or timing does not suit the receiving circuit.
- When the required logic is better implemented by another documented decoding arrangement; there is no universal 16-output cutoff.
Common mistakes
- Assuming floating enable inputs create a reliably disabled state. Hold inputs at defined logic levels.
- Confusing active-low selection with an active-high one-hot output.
- Ignoring propagation delay and address transitions when generating chip-select signals.
- Applying a line decoder's one-output behaviour to a seven-segment decoder.
Where you will find it
- TI documents SN74HC138 for memory decoding and data routing, including cascading through its three enables.
- CD4511B provides BCD display decoding with lamp-test, blanking and latch controls; follow its output and display-circuit requirements.
A short history
Binary line decoding and display-code decoding solve different mapping problems. The SN74HC138 selects one active-low line from eight; CD4511B produces a display pattern from BCD. Checking the truth table is more useful than assuming that every part called a decoder behaves identically.