DE Notes
Complete guide to encoders: basic encoder, priority encoder, octal-to-binary encoder, IC 74148, 74147, Boolean expressions, and applications in keyboard and interrupt handling.
What is an Encoder?
An encoder performs the reverse of decoding — it converts 2ⁿ one-hot inputs into an n-bit binary output code. Only one input should be active at a time (basic encoder).
Priority Encoder
The priority encoder handles multiple simultaneous active inputs by assigning priorities. The highest priority input determines the output. A valid output indicator (V or GS) shows that at least one input is active.
4:2 Priority Encoder
Priority: I3 > I2 > I1 > I0
| I3 | I2 | I1 | I0 | Y1 | Y0 | V | |
|---|---|---|---|---|---|---|---|
| X | X | X | X | 0 | 0 | 0 | (no input) |
| 0 | 0 | 0 | 1 | 0 | 0 | 1 | |
| 0 | 0 | 1 | X | 0 | 1 | 1 | |
| 0 | 1 | X | X | 1 | 0 | 1 | |
| 1 | X | X | X | 1 | 1 | 1 |
Boolean expressions (from K-map):
8:3 Priority Encoder — IC 74148
The 74148 is an 8-to-3 priority encoder (active-LOW):
- Active LOW inputs and outputs
- Priority: Ī7 highest (binary 111), Ī0 lowest (binary 000)
- GS̄ = 0 when any valid input is active
- EO̅ = 0 when enabled but no input active (for cascading)
Cascading for 16:4: Connect EO̅ of high-priority chip to ĒI of low-priority chip.
Applications
Keyboard Encoder
A 104-key keyboard uses a priority encoder to convert key press position to ASCII code. If multiple keys pressed, highest priority key wins.
Interrupt Priority Controller (8259A)
Multiple hardware devices request CPU attention simultaneously. Priority encoder determines which interrupt to service first.
ADC Flash Encoder
In flash ADC, 2ⁿ-1 comparators output one-hot thermometer code. Priority encoder converts to n-bit binary output.
Interview Questions
Q1: What is the limitation of a basic (non-priority) encoder? Two limitations: (1) Only one input can be active at a time — simultaneous active inputs give incorrect output. (2) The zero (I0) case produces the same output code (00...0) as the no-input case — ambiguous. Priority encoders solve both issues.
Q2: How does a priority encoder solve the multiple-input problem? By assigning a priority order to inputs. When multiple inputs are active, only the highest-priority active input determines the binary output. Lower-priority active inputs are ignored. A valid (V) or group-select (GS) output indicates any input is active.
Q3: In IC 74148, input Ī7 corresponds to which binary code? Ī7 is the highest priority input. When Ī7=0 (active LOW), the output A2̄A1̄A0̄ = 000 (all active LOW), meaning Y2Y1Y0 = 111 = 7. So Ī7 → binary 111.
Q4: What is the difference between encoder and decoder? A decoder converts n-bit binary to one of 2ⁿ active outputs. An encoder converts one-hot 2ⁿ inputs back to n-bit binary. They are inverse operations. Decoder: binary-to-one-hot. Encoder: one-hot-to-binary.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Encoder — Priority Encoder, Octal to Binary, IC 74148.
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, encoder, encoder — priority encoder, octal to binary, ic 74148
Related Digital Electronics Topics