Professional Documents
Culture Documents
Experiment-10
Digital Comparator
10-1 Object:
To study and design a 2-bit, and 4-bit digital comparator by logic gates, and
then to know the operation of 4-bit IC digital comparator.
10-2 Theory:
First of all, we should point out that, although the digital and analogical
comparators have the same mission, while one evaluates magnitudes of analogical
voltage, the other works with digital signals.
Since, if A>B, then A=1 and B=0, whereby C=1. On the other hand, if A=B or
A<B (A=0, B=1), then C=0.
Similarly, the restriction A<B is determined by:
The logic block diagram for the n-bit, drawn in figure (10-1), has the three
necessary outputs Cn, Dn, and En.
Figure (10-1) the logic block diagram for the n-bit comparator
MD
Middle Technical University Digital Electronic Lab.
Electrical Engineering Technical College First Stage
Electrical Power Technical Engineering Dept. Mohammed D. Altamemi
Figure (10-2) the logic block diagram for the 2-bit comparator
Table (10-1)
10-3 Procedures:
MD
Middle Technical University Digital Electronic Lab.
Electrical Engineering Technical College First Stage
Electrical Power Technical Engineering Dept. Mohammed D. Altamemi
Figure (10-3)
Table 10-2
A0 B0 A<B A=B A>B
0 0
0 1
1 0
1 1
The circuit being studied is represented in figure (10-4). The IC used is 74LS85.
It is a digital comparator of 4-bit that gives us information about the three
possibilities: bigger, equal, or smaller.
MD
Middle Technical University Digital Electronic Lab.
Electrical Engineering Technical College First Stage
Electrical Power Technical Engineering Dept. Mohammed D. Altamemi
Table (10-3)
A3 A2 A1 A0 B3 B2 B1 B0 A<B A=B A>B
1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 1
1 0 1 1 1 0 1 0
6-4 Discussions:
MD
Middle Technical University Digital Electronic Lab.
Electrical Engineering Technical College First Stage
Electrical Power Technical Engineering Dept. Mohammed D. Altamemi
5. If A=0110, and in the input B we can only connect a lead with a logic 1, where
would we connect it to be sure that B>A is fulfilled?
A. To input B0.
B. To input B1
C. To input B2
D. To input B3
MD