Comparators and Code Convertersv
Comparators and Code Convertersv
ECB2212-Digital Electronics
Numbering Systems
Ms.K.Indra Gandhi
Asst Prof (Sr.Gr) /ECE
DIGITAL SYSTEMS TCE1111
2
DIGITAL SYSTEMS TCE1111
3
DIGITAL SYSTEMS TCE1111
Contd...
• There are two different types of output relationship
between the two binary quantities;
Cascading Outputs
Inputs
6
DIGITAL SYSTEMS TCE1111
7
DIGITAL SYSTEMS TCE1111
8
DIGITAL SYSTEMS TCE1111
Example: Determine the A=B, A>B, and A<B outputs for the input numbers shown on the 4-bit comparator as given below.
Solution: The number on the A inputs is 0110 and the number on the B
inputs is 0011. The A > B output is HIGH and the other outputs (A=B
and A<B) are LOW
9
DIGITAL SYSTEMS TCE1111
Contd...
• In addition, it also has three cascading inputs:
10
DIGITAL SYSTEMS TCE1111
Contd...
• The lowest-order comparator must have a HIGH on the
A=B, and LOWs on the A<B and A>B inputs as shown in next
slide.
12
DIGITAL SYSTEMS TCE1111
13
DIGITAL SYSTEMS TCE1111
14
DIGITAL SYSTEMS TCE1111
15
DIGITAL SYSTEMS TCE1111
16
DIGITAL SYSTEMS TCE1111
Example :
Determine the output for the following sets of
binary
numbers to the comparator inputs in figure below.
(a) 10 and 10 (b) 11 and 10
Solution
( a )The output is 1 (b) The output is 0
17
DIGITAL SYSTEMS TCE1111
CODE CONVERTERS
• A code converter is a logic circuit that changes data
presented in one type of binary code to another type of
binary code, such as BCD to binary, BCD to 7segment,
binary to BCD, BCD to XS3, binary to Gray code, and Gray
code to binary.
• We know that, two digit decimal values ranging from 00
to 99 can be represented in BCD by two 4bit code
groups.
18
DIGITAL SYSTEMS TCE1111
BCD-to-Binary Conversion
19
DIGITAL SYSTEMS TCE1111
Contd...
For example, 4610 is represented as
• The MSB has a weight of 10, and the LSB has a weight
of 1.
Weight Table
21
DIGITAL SYSTEMS TCE1111
The binary equivalent of each BCD bit is a binary number
representing the BCD bit weight
22
DIGITAL SYSTEMS TCE1111
23
DIGITAL SYSTEMS TCE1111
Example :
Convert the BCD equivalent of 26 to binary.
Solution
24
DIGITAL SYSTEMS TCE1111
26
DIGITAL SYSTEMS TCE1111
FOUR BIT BINARY TO GRAY CODE CONVERTER –DESIGN
(3)
Logic Diagram:
27
DIGITAL SYSTEMS TCE1111
FOUR BIT GRAY CODE TO BINARY CONVERTER –DESIGN (1)… MSB + + + + Gray code
1 0 1 0 0
• Truth Table:
Binary code
INPUT ( GRAY CODE) OUTPUTS (BINARY
1 1 ) 0 0 0
G3 G2 G1 G0 B3 B2 B1 B0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 1
0 1 0 1 0 1 1 0
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
1 0 0 0 1 1 1 1
1 0 0 1 1 1 1 0
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 0 1 0 1 1
1 1 1 1 1 0 1 0
28
DIGITAL SYSTEMS TCE1111
29
DIGITAL SYSTEMS TCE1111
30
DIGITAL SYSTEMS TCE1111
FOUR BIT GRAY CODE TO BINARY CONVERTER –DESIGN
(4)
Logic Diagram:
31
DIGITAL SYSTEMS TCE1111
Exercise
Solution:
32
DIGITAL SYSTEMS TCE1111
34
DIGITAL SYSTEMS TCE1111
35
DIGITAL SYSTEMS TCE1111
36