Author: M Abo Bakar Aslam
Introduction to Encoder and Decoder
An Encoder and Decoder are fundamental digital combinational circuits used in data conversion and communication systems.
- An Encoder converts multiple input signals into a smaller number of output bits.
- A Decoder performs the reverse operation by converting coded inputs back into multiple outputs.
These circuits are widely used in digital systems, communication, memory, and control units.
1. Encoder
An Encoder is a combinational circuit that converts 2ⁿ input lines into n output lines.
Key Idea:
It reduces the number of bits by encoding active input into binary form.
Example: 4-to-2 Encoder
- Inputs: Input-0, Input-1, Input-2, Input-3
- Outputs: Y1, Y0
Total Outputs = log₂(Number of Inputs)
Properties of Encoder
- Number of inputs = 2ⁿ
- Number of outputs = n
- Performs data compression
- Only one input should be active at a time (basic encoder)
Applications of Encoder
- Keyboard encoding
- Priority encoding in interrupt systems
- Data compression in digital circuits
2. Decoder
A Decoder is a combinational circuit that converts n input lines into 2ⁿ output lines.
Key Idea:
It expands binary information into multiple output lines.
Example: 2-to-4 Decoder
- Inputs: A, B
- Outputs: out-0, out-1, out-2, out-3
Total Outputs = 2^(Number of Inputs)
Properties of Decoder
- Number of inputs = n
- Number of outputs = 2ⁿ
- Only one output is active at a time
- Used for selection and addressing
Applications of Decoder
- Memory address decoding
- Instruction decoding in CPU
- Seven segment display systems
3. Encoder vs Decoder
| Feature | Encoder | Decoder |
|---|---|---|
| Function | Multiple inputs → fewer outputs | Fewer inputs → multiple outputs |
| Conversion | Analog/active input → binary code | Binary code → active output |
| Size Relation | 2ⁿ → n | n → 2ⁿ |
| Operation | Compression | Expansion |
4. Important Note
Encoder and Decoder are inverse operations of each other. Encoder reduces data size while Decoder reconstructs the original information.