Encoder and
Decoder
Decoder
A decoder is a multiple-input, multiple-
output logic circuit which converts coded
inputs into coded outputs, where the input
and output codes are different.
The encoded information is presented as
n inputs producing 2^n possible outputs.
A decoder which has an n-bit binary input
code and a one activated output of 2^n
output code is called binary decoder.
Types of Decoder
2:4 decoder
3:8 decoder
4:16 decoder
2:4 Decoder
Step 1: Definition- logic circuit which converts
coded inputs into coded outputs
Step 2: No. of Input lines : n = 2 =A,B
No. of Output line : 2^n = 2^2 = 4 =
Yo,Y1,Y2,Y3
Step 3: Block diagram
A Y0
B 2:4 Decoder
Y1
Y2
Y3
Step 4: Truth table
A B Y0 Y1 Y2 Y3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
Step 5: Expression Y0=A’B’
Y1=A’B
Y2=AB’
Y3=AB
Step 6: Logic diagram
Y0
Y1
Y2
Y3
3:8 Decoder
Step 1: Definition- logic circuit which converts
coded inputs into coded outputs
Step 2: No. of Input lines : n = 3 =A,B,C
No. of Output line : 2^n = 2^3 = 8 =
Yo,Y1,Y2,Y3,Y4,Y5,Y6,Y7
Step 3: Block diagram
Y0
Y1
A Y2
B 3:8 Decoder Y3
Y4
C Y5
Y6
Y7
Step 4: Truth table
A B C Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Step 5: Expression Y0=A’B’C’ Y4=AB’C’
Y1=A’B’C Y5=AB’C
Y2=A’BC’ Y6=ABC’
Y3=A’BC Y7=ABC
Step 6: Logic diagram
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
HW: 4:16
Implementation of boolean
function using decoder
Encoder
An encoder is a digital circuit that performs
the inverse operation of a decoder.
An encoder has 2^n input lines and n output
lines.
In encoder the output lines generate the
binary code corresponding to the input value.
The decoded information is presented as 2^n
inputs producing n possible outputs.
Types of encoder
4:2
8:3
16:4
4:2 Encoder
Step 1: Definition- In encoder the output lines
generate the binary code corresponding to the input
value.
Step 2: No. of Output lines : n = 2 =Yo,Y1
No. of Input line : 2^n = 2^2 = 4 = Do,D1,D2,D3
Step 3: Block diagram
D0 Y0
D1 4:2 Encoder
Y1
D2
D3
Step 4: Truth table
D0 D1 D2 D3 Y0 Y1
1 0 0 0 0 0
0 1 0 0 0 1
0 0 1 0 1 0
0 0 0 1 1 1
Step 5: Expression Y0=D2+D3
Y1=D1+D3
Step 6: Logic diagram
D0
Y0
D1
D2
Y1
D3
8:3 Encoder
Step 1: Definition- In encoder the output lines generate
the binary code corresponding to the input value.
Step 2: No. of Output lines : n = 3 =A,B,C
No. of Input line : 2^n = 2^3 = 8 =
Do,D1,D2,D3,D4,D5,D6,D7
Step 3: Block diagram
A
B
C
Step 4:
Truth table
Step 5: Expression
Step 6: Logic diagram
HW: 16:4 (hexadecimal to binary)
Priority Encoder
A priority encoder is an encoder circuit
that includes the priority function. In
priority encoder, if two or more inputs
are equal to 1 at the same time, the
input having the highest priority will
take precedence.
Y1 V
Yo