Decoders and Encoders
Pre: Binary Logic and Circuits
Decoders
- A binary decoder has
inputs and outputs - Only one output is asserted at a time and each output corresponds to one valuation of the inputs
- Typically, a decoder will have an enable input,
. If , then none of the outputs are asserted. Otherwise, the valuation of will determine which output is asserted.
Symbol
Warning
2-4 Decoder
Truth Table
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 |
0 | x | x | 0 | 0 | 0 | 0 |
Symbol
Implementation
So we have:
Designing Decoders with Smaller Decoders
Implementation
A 3 to 8 decoder using 2 to 4 decoders.
Implementation
A 4 to 16 decoder using 2 to 4 decoders.
Making MUXes with Decoders
See Multiplexers
Implementation
Or with tri-state buffers:
Implementation
Encoders
- A binary encoder encodes information from its
inputs into an -bit code - Exactly one of the inputs should be 1 and the outputs present the binary umber that identifies which input is 1
Symbol
4-2 Encoder
Truth Table
0 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 1 |
0 | 1 | 0 | 0 | 1 | 0 |
1 | 0 | 0 | 0 | 1 | 1 |
Symbol
Implementation