Chapter 7 - Digital Comparators
Chapter 7 - Digital Comparators
5 Digital comparators
The basic function of a comparator is to compare the magnitudes of two binary quantities to determine the
relationship of those quantities. Figure 7.12 illustrates n-bit comparator block diagram.
A1
n-bit A A2
… A<B
_GE_C06.indd Page 330 12/11/14 8:13 PM user /204/PH01677_PIV/9781292075983_FLOYD/FLOYD_DIGITAL_FUNDAMENTALS11_PIE
An
n-bit
A=B
B1 comparator
B2 A>B
n-bit B
…
Bn
B3 1 (10) COMP
16 VCC 0
(12)
A < Bin 2 15 A3
(13) A
A = Bin 3 14 B2 (15)
3
A > Bin 4 13 A2 (4) (5)
A>B A>B
Cascading (3) (6)
A > Bout 5 12 A1 A=B A=B Outputs
inputs (2) (7)
A = Bout 6 11 B1
A<B A<B
(9)
0
A < Bout 7 10 A0 (11)
(14) B
GND 8 9 B0
(1)
3 VCC (16), GND(8)
(a) Pin diagram (b) Logic symbol
In addition, the 7485 IC is provided with three cascading inputs: (𝐴 > 𝐵), (𝐴 = 𝐵), (𝐴 < 𝐵). These
inputs allow several comparators to be cascaded for comparison of any number of bits greater than four.
To expand the comparator, the (𝐴 > 𝐵), 𝐴 < 𝐵), and (𝐴 = 𝐵) outputs of the lower-order comparator are
connected to the corresponding cascading inputs of the next higher-order comparator. The lowest-order
comparator must have a HIGH on the (𝐴 = 𝐵) input and LOWs on the (𝐴 > 𝐵) and (𝐴 > 𝐵) inputs. Figure
7.15 shows how two 7485 ICs are cascaded to form an 8-bit magnitude comparator.
LSBs MSBs
COMP COMP
A0 0 A4 0
A1 A5
A A
A2 A6
A3 3 A7 3
A>B A>B A>B A>B
+5 V A=B A=B A=B A=B Outputs
A<B A<B A<B A<B
B0 0 B4 0
B1 B5
B B
B2 B6
B3 3 B7 3
7485 7485
59