- 2081 Baisakh · 2+5 marks
Encoder vs decoder; 8-to-3 encoder
Short answer
An encoder has 2^n inputs and n outputs, converting one active input to binary using OR gates; a decoder does the reverse. An 8-to-3 encoder uses OR gates: Y2=D4+D5+D6+D7, Y1=D2+D3+D6+D7, Y0=D1+D3+D5+D7. D0 inactive gives 000.
Differentiate between encoder and decoder. Design an 8 to 3 encoder with diagrams.
Encoder vs decoder
| Point | Encoder | Decoder |
|---|---|---|
| Function | Converts one active line to a binary code | Converts a binary code to one active line |
| Inputs / outputs | inputs, outputs | inputs, outputs |
| Main gates | OR gates | AND gates |
| Example | 8-to-3 (octal to binary) | 3-to-8 (74138) |
| Use | Keyboards, interrupt encoding | Address decoding, display driving |
8-to-3 encoder
An 8-to-3 (octal-to-binary) encoder has eight inputs – and three outputs . When one input is 1, the output is the binary code of . Only one input is assumed active at a time.
Truth table
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
Output equations. Each output is 1 for the inputs whose code has a 1 in that bit:
Logic diagram
D4, D5, D6, D7 ---[OR 4]---> Y2
D2, D3, D6, D7 ---[OR 4]---> Y1
D1, D3, D5, D7 ---[OR 4]---> Y0
(D0 not connected: it gives 000)
Example: → , , , output .
Limitations: and "no input active" both give 000, and two active inputs give a wrong code (e.g. and give 111). A valid-output bit and a priority encoder (74148) remove these problems.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Encoder; 4×16 decoder from 2×4 decoders · Digital Logic, chapter 4
- Combinational vs sequential; BCD-to-decimal decoder · Digital Logic, chapter 4
- DEMUX vs decoder; 4×16 decoder from 2×4 · Digital Logic, chapter 4
- Octal priority encoder design · Digital Logic, chapter 4 · asked 3×
- DEMUX vs decoder; seven-segment "b" segment · Digital Logic, chapter 4
- Priority encoder; "e" and "f" segments · Digital Logic, chapter 4
- Delta modulation encoder/decoder; PCM vs DM · Communication Systems, chapter 4
- Stereo FM encoder and decoder · Communication Systems, chapter 3 · asked 2×
- Stereo FM encoder and decoder block diagram · Communication Systems, chapter 3
- Error detection vs correction; rate ½ convolutional encoder · Communication Systems, chapter 8