Decoders
Binary to one-hot conversion - activate exactly one output for each input combination.
A decoder converts an n-bit binary input into 2ⁿ unique output lines, activating exactly one output for each input combination. Decoders are among the most versatile combinational circuits, used for memory address decoding, display drivers, and building arbitrary logic functions. The BCD-to-7-segment decoder is a specialized decoder used to drive numeric displays.
Objectives
- Design 2-to-4 and 3-to-8 decoders from AND gates
- Use enable inputs for cascading and conditional decoding
- Understand BCD-to-7-segment decoders and segment patterns
- Apply decoders for memory address decoding
- Implement arbitrary logic functions using decoders
Key Takeaways
- A decoder converts n-bit binary to 2ⁿ one-hot outputs
- Each decoder output is a minterm of the input variables
- Enable inputs allow cascading for larger decoders
- BCD-to-7-segment decoders (74HC47, CD4511) drive numeric displays
- Decoders can implement ANY Boolean function by OR-ing selected outputs
- 74HC138 (3-to-8) and 74HC139 (dual 2-to-4) are the standard decoder ICs
- Memory address decoding is one of the most important decoder applications
Applications
- Memory Address Decoding: Selecting memory chips based on address bits.
- Display Driving: BCD-to-7-segment conversion for numeric readouts.
- I/O Port Selection: Choosing peripherals in microprocessor systems.
- Instruction Decoding: CPUs decode instruction opcodes to activate control signals.
Practice Problems
Problem 1: Write the output expression for Y5 of a 3-to-8 decoder.
Problem 2: Using a 3-to-8 decoder and OR gates, implement f(A,B,C) = Σm(0,2,5,7).
Problem 3: What segments (a-g) should be ON to display the digit "3" on a 7-segment display?
Problem 4: How do you build a 4-to-16 decoder from two 74HC138 (3-to-8 decoders)?
Problem 5: A memory system has a 16-bit address bus. Using 74HC138 decoders, how would you select between 8 memory chips, each with 8KB?