Lecture 2.1.7
Lecture 2.1.7
To learn about design of different design of Encoder, decoder & Magnitude Comparator.
3
.
2
Course Objectives
1. The course is designed to make the students develop a strong foundation in basic electrical & digital electronics
concepts.
2. It will make the students competent to gain the skills and knowledge required to design and implement combinational
and sequential logic circuits for various applications.
3. It will enhance the skill level of the students in building, testing, and troubleshooting digital circuits to enhance their
practical skills and problem-solving abilities and shall make them preferred choice for getting employment in industry
and research labs.
4. It will give thorough knowledge of the discipline to enable students to disseminate knowledge in pursuing excellence in
academic areas.
3
Course
Outcomes
CO
Numbe Title Level
r
CO5 To assess the different applications of Counters and shift registers. Evaluate Figure showing same application
but different technology
4
ENCODER
• An Encoder is a combinational logic circuit.
• It performs the inverse operation of Decoder.
• The opposite process of decoding is known as Encoding.
• An Encoder converts an active input signal into a coded output signal.
• Block diagram of Encoder is shown in Fig.1.1. It has ‘M’ inputs and ‘N’ outputs.
• An Encoder has ‘M’ input lines, only one of which is activated at a given time, and produces an N-bit
output code, depending on which input is activated.
A0 A1 B0
‘M’ Inputs
‘N’ Outputs
A2 B1
B2
-------
-------
Encoder
AM-1 BN-1
Types of Encoders
i. Priority Encoder
ii. Decimal to BCD Encoder
iii. Octal to Binary Encoder
iv. Hexadecimal to Binary Encoder
ENCODER
M=4 M=22
M=2N
‘M’ is the input and ‘N’
is the output
A0
B0
A1
B1
A2 Encoder 4 Decoder 2
B2
A3 x2 x4
B3
00
A0
01
A1
A2
10 Encoder 4 Decoder 2
11 x2 x4
A3
00
A0
01 1
A1
A2
10 Encoder 4 0
Decoder 2
A3
11 x2 x4
00
A0
01 1
A1
A2
10 Encoder 4 0
Decoder 2
10
A3
11 x2 x4
D3 INPUTS OUTPUTS V
Y1
D2 D3 D2 D1 D0 Y1 Y0
Priority 0 0 0 0 x x 0
D1 Encoder
0 0 0 1 0 0 1
Y0
D0 0 0 1 x 0 1 1
0 1 x x 1 0 1
Lowest Priority Output 1 x x x 1 1 1
Input
Block Diagram of Priority Encoder Fig. 1 1 : ENCODER DIAGRAM
• There are four inputs D0, D1,D2, D3 and two outputs Y1 and Y2.
• D3 has highest priority and D0 is at lowest priority.
• If D3=1 irrespective of other inputs then output Y1Y0=11.
• D3 is at highest priority so other inputs are considered as don’t care.
00 X 0 0 0 00 X 0 1 1
01 1 1 1 1 01 0 0 0 0
11 1 1 1 1 11 1 1 1 1
10 1 1 1 1 10 1 1 1 1
Y1 D 2 D 3
Y 0 D 3 D D 2 1
D3 D2 D1 D0
Y1
Y0
0
A
1
2 B
-------- -
ENCODER
9 D
INPUTS OUTPUTS
Fig. 14 : ENCODER DIAGRAM
Truth Table
INPUTS BCD OUTPUTS
0 1 2 3 4 5 6 7 8 9 A B C D
1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 0 0 0 0 0 1 0 1
0 0 0 0 0 0 1 0 0 0 0 1 1 0
0 0 0 0 0 0 0 1 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 0 1
A B C D
Fig. 16: ENCODER DIAGRAM
OCTAL TO BINARY ENCODER
• Block Diagram of Octal to Binary Encoder is shown below.
• It has eight inputs and three outputs.
• Only one input has one value at any given time.
• Each input corresponds to each octal digit and output generates
corresponding Binary Code.
D0
D1 X
D2
D3 ENCODER Y
D4
D5
D6 Z
D7
INPUT OUTPUT
Fig. 17: ENCODER DIAGRAM
TRUTH TABLE
INPUT OUTPUT
D0 D1 D2 D3 D4 D5 D6 D7 X Y Z
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
X D4 D5 D6 D7
Y D2 D3 D6 D7
Z D1 D 3 D 5 D 7
There are two types of digital comparator (i) Identity Comparator (ii) Magnitude Comparator.
IDENTITY COMPARATOR : This comparator has only one output terminal for when A=B, either
A=B=1 (High) or A=B=0 (Low) .
MAGNITUDE COMPARATOR : This Comparator has three output terminals namely A>B, A=B, A<B.
Depending on the result of comparison, one of these output will be high.
.
Figure 2 Block Diagram of n-bit Magnitude
Comparator
25
Classification of Comparators
1-bit Comparator
2-bit Comparator
26
1-Bit Magnitude Comparator
•This magnitude comparator has two inputs A and B and three outputs A<B, A=B and
A>B.
27
1-Bit Magnitude Comparator
28
• A>B: AB‘ A<B: A'B A=B: A'B' + AB
From the above expressions we can derive the following formula:
29
1-Bit Magnitude Comparator
30
1-Bit Magnitude Comparator
31
2-Bit Magnitude Comparator
A comparator which is used to compare two binary numbers each of two bits is called a 2-bit
magnitude comparator.
It has four inputs and three outputs.
Inputs are A0,A1,B0 and B1 and Outputs are Y1,Y2 and Y3.
32
2-Bit Magnitude Comparator
35
2-Bit Magnitude Comparator
36
REFERENCES
• https://
www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fwww.indiamart.com%2Fproddetail%2Fmultiplexer-and-demultiplexer-tr
ainer-9336916362.html&psig=AOvVaw3rvmgb8TYvQK2MTxMP2mes&ust=1595882004114000&source=images&cd=vfe&
ved=0CAIQjRxqFwoTCKDo-fbh6-oCFQAAAAAdAAAAABAD
• https://
www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Flearn.circuitverse.org%2Fdocs%2FMSI%2Fmux.html&psig=AOvVaw1iWc
VSERqtD9-mFibmInEQ&ust=1595882330875000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCOiboojj6-oCFQAAAAAdA
AAAABAJ
• https://
www.google.com/search?q=combinational+circuits+in+digital+electronics&source=lnms&tbm=i
sch&sa=X&ved=0ahUKEwj526-wnv3iAhWSXCsKHf77AtQQ_AUIESgC&biw=1366&bih=657#imgrc
=v4c5n7-dy4fzAM
• https://
www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fsimple.wikipedia.org%2Fwiki%2FMultiplexer&ps37
REFERENCES
• https://
www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fwww.vlsi-expert.com%2F2013%2F12%2Fdigital-b
asic-15-multiplexer-mux.html&psig=AOvVaw3xN1zjAPc331kKANSJ_As5&ust=1595886452950000
&source=images&cd=vfe&ved=0CAIQjRxqFwoTCOCG_Ljy6-oCFQAAAAAdAAAAABAD
38
THANK YOU