Alpha Breathing
Evocation
ENCODER & DECODER
INTRODUCTION ENCODER- a digital circuit that produces a binary output code depending on which of its inputs are activated.
DECODER- a digital circuit that converts an input binary code into a single numeric output.
ENCODERS AND DECODERS REPRESENTATION A0 A1 A2 A3 A4 A5 A6 A7
O0 O1 O2 ENCODER
A0 A1 A2 DECODER
O0 O1 O2 O3 O4 O5 O6 O7
THE 8421 BCD CODE • BCD stands for Binary-Coded Decimal. • A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example: Decimal number 4926 4 9 2 6 8421 BCD coded number
0100 1001 0010 0110
ELECTRONIC ENCODER -
DECIMAL TO BCD BCD output Decimal input
7 5
3
00 10 0 11 Decimal to BCD Encoder
0
• Encoders are available in IC form. • This encoder translates from decimal input to BCD output.
10 line to 4 line Encoder
10 line to 4 line Encoder BINARY (BCD)
DECIMAL 8 ENCODER 9 5V 8 5V 7 5V 6 5V 5 5V 4 5V 3 5V 2 5V 1 5V
74147 I9 I8 I7 A3 I6 A2 I5 A1 I4 A0 I3 I2 I1
4
2
1
Decoder – Accepts a value and decodes it • Output corresponds to value of n inputs
– Consists of: • Inputs (n) • Outputs (2n , numbered from 0 2n - 1) • Selectors / Enable (active high or active low)
The truth table of 2-to-4 Decoder
2-to-4 Decoder
2-to-4 Decoder
The truth table of 3-to-8 Decoder A2
A1
A0
D0
0
0
0
1
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
D1
D2
D3
D4
D5
D6
D7
1 1 1 1 1
1 1
3-to-8 Decoder
3-to-8 Decoder with Enable
Decoder Expansion • Decoder expansion – Combine two or more small decoders with enable inputs to form a larger decoder – 3-to-8-line decoder constructed from two 2-to4-line decoders • The MSB is connected to the enable inputs • if A2=0, upper is enabled; if A2=1, lower is enabled.
Decoder Expansion
Combining two 2-4 decoders to form one 3-8 decoder using enable switch
The highest bit is used for the enables
How about 4-16 decoder • Use how many 3-8 decoder? • Use how many 2-4 decoder?
Encoders • Perform the inverse operation of a decoder – 2n (or less) input lines and n output lines
Encoders
Encoders with OR gates
Encoders • Perform the inverse operation of a decoder –2n (or less) input lines and n output lines
Priority Encoder – Accepts multiple values and encodes them • Works when more than one input is active – Consists of: • Inputs (2n) • Outputs – when more than one output is active, sets output to correspond to highest input – V (indicates whether any of the inputs are active) • Selectors / Enable (active high or active low)
D3
D2
D1
D0
A1
A0
V
0
0
0
0
x
X
0
0
0
0
1
0
0
1
0
0
1
0
0
1
1
0
0
1
1
0
1
1
0
1
0
0
1
0
1
0
1
0
1
1
0
1
0
1
1
0
1
0
1
0
1
1
1
1
0
1
1
0
0
0
1
1
1
1
0
0
1
1
1
1
1
0
1
0
1
1
1
1
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
Priority Encoder
Puzzles
33
Mind Map – Encoder and Decoder Hexadecimal to binary encoder
Priority Encoder
Encoder
Decimal BCD to encoder
Applications
Block diagram
Octal to binary encoder
Code conversion
Truth table 2 to 4 line decoder
Decoder
Counter system
Applications Logic diagram
3 to 8 line Decoder
Block diagram
Truth table
Logic diagram
A to D counter Display system
Summary Encoders & Decoders
Truth table K-Map Logic Diagram
36