Digital Logic Design Exp. No. 11
Digital Logic Design Exp. No. 11
4:2 ENCODER:
A 4:2 encoder has four inputs and two outputs. By definition, an encoder takes in the high value
of every input and gives an n bit output. Essentially, the output that the encoder outputs is the
physical address of the line.
irfanriazshohab@gcuf.edu.pk 1
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
A B C D Y0 Y1
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
From the truth table of the 4:2 encoder above we have, Y0 = 1 at 0100 or 1000, so,
Y0 = A’BC’D’ + AB’C’D’ = C’D'( )
Similarly, Y1 = 1 at 0010 or 1000, so,
Y1 = A’B’CD’ + AB’C’D’ = B’D'( )
CONNECTION DIAGRAM
Plotting the circuit from the above equations we get the following combinational logic circuit for
the 4:2 encoder.
?
OTHER APPROACH
The 4 to 2 Encoder consists of four inputs Y3, Y2, Y1 & Y0 and two outputs A1 & A0. At any
time, only one of these 4 inputs can be ‘1’ in order to get the respective binary code at the output.
The figure below shows the logic symbol of 4 to 2 encoder :
irfanriazshohab@gcuf.edu.pk 2
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
1 0 0 1 0 0 1
2 0 1 0 0 1 0
3 1 0 0 0 1 1
?
Four to two line encoder Figure 11.1
8:3 ENCODER: Octal-to-Binary
Octal-to-Binary take 8 inputs and provides 3 outputs, thus doing the opposite of what the 3-to-
8 decoder does. At any one time, only one input line has a value of 1. The 8 to 3 Encoder or octal
to Binary encoder consists of 8 inputs : Y7 to Y0 and 3 outputs : A2, A1 & A0. Each input line
corresponds to each octal digit and three outputs generate corresponding binary code.
The figure below shows the logic symbol of octal to binary encoder:
irfanriazshohab@gcuf.edu.pk 3
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
0 0 0 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 1 0 0 0 1
2 0 0 0 0 0 1 0 0 0 1 0
3 0 0 0 0 1 0 0 0 0 1 1
4 0 0 0 1 0 0 0 0 1 0 0
5 0 0 1 0 0 0 0 0 1 0 1
6 0 1 0 0 0 0 0 0 1 1 0
7 1 0 0 0 0 0 0 0 1 1 1
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
CONNECTION DIAGRAM
The above two Boolean functions A2, A1 and A0 can be implemented using four input OR gates
irfanriazshohab@gcuf.edu.pk 4
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
?
For an 8-to-3 binary encoder with if inputs D0-D7 the logic expressions of the outputs A0-A2.
A0 = D1 + D3 + D5 + D7
A1 = D2 + D3 + D6 + D7
A2 = D4 + D5 + D6 + D7
?
Figure 11.2 Octal to Binary Encoder
10:4 ENCODER: Decimal-to-BCD
Decimal-to-BCD take 10 inputs and provides 4 outputs, thus doing the opposite of what the 4-
to-10 decoder does. At any one time, only one input line has a value of 1. The decimal to binary
encoder usually consists of 10 input lines and 4 output lines. Each input line corresponds to the
each decimal digit and 4 outputs correspond to the BCD code. This encoder accepts the decoded
decimal data as an input and encodes it to the BCD output which is available on the output lines.
The figure below shows the logic symbol of decimal to BCD encoder.
irfanriazshohab@gcuf.edu.pk 5
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0 1 0 0 0 0 1
2 0 0 0 0 0 0 0 1 0 0 0 0 1 0
3 0 0 0 0 0 0 1 0 0 0 0 0 1 1
4 0 0 0 0 0 1 0 0 0 0 0 1 0 0
5 0 0 0 0 1 0 0 0 0 0 0 1 0 1
6 0 0 0 1 0 0 0 0 0 0 0 1 1 0
7 0 0 1 0 0 0 0 0 0 0 0 1 1 1
8 0 1 0 0 0 0 0 0 0 0 1 0 0 0
9 1 0 0 0 0 0 0 0 0 0 1 0 0 1
Logical expression for A3, A2, A1 and A0 :
A3 = Y9 + Y8
A2 = Y7 + Y6 + Y5 +Y4
A1 = Y7 + Y6 + Y3 +Y2
A0 = Y9 + Y7 +Y5 +Y3 + Y1
CONNECTION DIAGRAM
The above two Boolean functions can be implemented using OR gates :
?
For 10-to-4 binary encoder with if inputs D0-D9 the logic expressions of the outputs A0-A3
A3 = D8 + D9
A2 = D4 + D5 + D6 + D7
irfanriazshohab@gcuf.edu.pk 6
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
A1 = D2 + D3 + D6 + D7
A0 = D1 + D3 + D5 + D7 + D9
?
Figure 11.3 Decimal to BCD Encoder
4:2 PRIORITY ENCODER:
A 4 to 2 priority encoder has 4 inputs : Y3, Y2, Y1 & Y0 and 2 outputs : A1 & A0. Here, the
input, Y3 has the highest priority, whereas the input, Y0 has the lowest priority. In this case,
even if more than one input is ‘1’ at the same time, the output will be the (binary) code
corresponding to the input, which is having higher priority.
The truth table for priority encoder is as follows :
INPUT OUTPUT
Y3 Y2 Y1 Y0 A1 A0 V
0 0 0 0 X X 0
0 0 0 1 0 0 1
0 0 1 X 0 1 1
0 1 X X 1 0 1
1 X X X 1 1 1
irfanriazshohab@gcuf.edu.pk 7
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
V= Y0 + Y1 + Y2 + Y3
CONNECTION DIAGRAM
?
four to two line priority encoder Figure 11.4
PROCEDURE
?
Task No. 1
Construct a circuit of 4:2 Line Encoder.
Task No. 2
Construct a circuit of 8:3 Line Encoder.
irfanriazshohab@gcuf.edu.pk 8
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
Task No. 3
Construct a circuit of 10:4 Line Encoder.
Task No. 4
Construct a circuit of 4:2 Priority Encoder.
RESULTS
Truth Tables Task # 1 TRUTH TABLE OF 4:2 ENCODER
INPUT OUTPUT
Decimal
Y3 Y2 Y1 Y0 A1 A0
Digit
0 0 0 0 1
1 0 0 1 0
2 0 1 0 0
3 1 0 0 0
Task # 2 TRUTH TABLE OF 8:3 ENCODER
INPUT OUTPUT
Decimal
Digit Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 A2 A1 A0
0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0
2 0 0 0 0 0 1 0 0
3 0 0 0 0 1 0 0 0
4 0 0 0 1 0 0 0 0
irfanriazshohab@gcuf.edu.pk 9
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
5 0 0 1 0 0 0 0 0
6 0 1 0 0 0 0 0 0
7 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1 0
2 0 0 0 0 0 0 0 1 0 0
3 0 0 0 0 0 0 1 0 0 0
4 0 0 0 0 0 1 0 0 0 0
5 0 0 0 0 1 0 0 0 0 0
6 0 0 0 1 0 0 0 0 0 0
7 0 0 1 0 0 0 0 0 0 0
8 0 1 0 0 0 0 0 0 0 0
9 1 0 0 0 0 0 0 0 0 0
Y3 Y2 Y1 Y0 A1 A0 V
0 0 0 0
0 0 0 1
irfanriazshohab@gcuf.edu.pk 10
MSISDN +923338369095
Digital Logic Design Laboratory Hand Book
0 0 1 X
0 1 X X
1 X X X
CONCLUSION
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
irfanriazshohab@gcuf.edu.pk 11
MSISDN +923338369095