Digital Logic Circuits for Data Conversion
A Decoder is a combinational logic circuit that:
👉 It decodes binary input into a specific output line.
Think of it as a translator: it reads binary numbers and lights up the correct output line.
| E | A1 | A0 | Y0 | Y1 | Y2 | Y3 |
|---|---|---|---|---|---|---|
| 0 | X | X | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 1 |
(X means "don't care")
👉 Implemented using AND gates and NOT gates.
Example: A 4-to-16 decoder selects one of 16 memory blocks using a 4-bit address.
Converts binary machine instructions into control signals.
Converts binary input into decimal digit display.
Routes one input signal to multiple outputs.
👉 The reverse of a Decoder.
| Y3 | Y2 | Y1 | Y0 | A1 | A0 |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
Converts key presses into binary codes.
Example: Pressing "A" = binary 0100 0001.
Reduces multiple inputs into fewer outputs.
Encodes several input signals into fewer lines for transmission.
Handles multiple inputs and gives priority to the highest-order active signal (used in interrupts).
| Feature | Decoder (n→2ⁿ) | Encoder (2ⁿ→n) |
|---|---|---|
| Inputs | n | 2ⁿ |
| Outputs | 2ⁿ | n |
| Function | Converts binary input → activates one output | Converts active input → binary code |
| Example | 2-to-4 Decoder | 4-to-2 Encoder |
⚡ In simple terms:
Decoder = expands binary → many outputs (only 1 active)
Encoder = compresses many inputs → binary code
🔹 Decoder: Takes n binary inputs and produces 2ⁿ outputs, with only one output active for each input combination.
🔹 Encoder: Takes 2ⁿ input lines and produces n binary outputs, converting the active input into a binary code.
🔹 Key Difference: Decoders expand binary inputs to multiple outputs, while encoders compress multiple inputs to binary outputs.
🔹 Applications: Both are essential in digital systems for data conversion, routing, and control.
Decoders and encoders are fundamental building blocks in digital logic design, enabling efficient data conversion and control in computer systems.