Lab
1 | P a g e
L o g i c a l F u n c t i o n C i r c u i t : C o m p a r a t o r
Lab Experiment 10
Logical Function Circuit:
Comparators
The basic function of a comparator is to compare the magnitude of two binary numbers to
determine the relationship between them. In its simplest form, a comparator determines if
two binary numbers are equal or not. These comparators can be set up with relatively simple
gates.
Many IC comparators provide outputs which indicate not only if two numbers are equal but
also if they are not equal, which one is the larger one. One such IC is the TTL 7485, an
inequality comparator.
In this experiment you will work with both types of comparators: equality and inequality
comparators.
2 | P a g e L o g i c a l F u n c t i o n C i r c u i t : C o m p a r a t o r
LAB EXPERIMENT PROCEDURE
Part 1) Two-bit comparator
A two bit comparator is simply a XOR gate because the output is LOW if the two inputs are
the same and it is HIGH if the two inputs are different.
1. Insert a 74LS86 Quad XOR onto the protoboard PROPERLY next to the digital board.
2. Build Circuit 10.1. Connect pin 14 of 74LS86 to +5V of the digital board, pin 7 to GND,
pin 1 to Switch 8, pin 2 to Switch 7, and pin 3 to LED 4. Also, connect Switch 8 to LED
2 and Switch 7 to LED 1 of the digital board.
LED 2 is used as input A, LED 1 is used as input B, and LED 4 as Output.
Circuit 10.1 – 1-bit equality comparator
3. Operate the switches 7 and 8 in binary order according to Table 10.1, and record if LED
4 turns ON or OFF
Part 2. 2-bit equality comparator
A four bit comparator can be set up by adding two, two bit comparators.
4. Build Circuit 10.2 with the following pin number. Don’t forget to connect power and
ground to the chip.
Minterm B (LED 1) A (LED 2) Y A B (LED 4)
0 0 0
1 0 1
2 1 0
3 1 1
Table 10.1 – Truth table for a 1-bit Equality Comparator
3 | P a g e L o g i c a l F u n c t i o n C i r c u i t : C o m p a r a t o r
Circuit 10.2 – 2-bit equality comparator
LED 1 is used as input A0, LED 2 is used as input B0, LED 3 is used as input A1,
LED 4 is used as input A2, and LED 6 as the output.
This circuit will compare two, two bit numbers and give a HIGH if they are equal and
a LOW if they are not equal. Number A will be made up of the two bits A1 and A0.
The number B will be made up of the two bits B1 and B0. A1 and B1 are the two
most significant bits while A0 and B0 are the two least significant bits.
5. Operate switch 5, 6, 7, and 8 according to Table 10.2 , and record if LED 6 turns ON or OFF
B1
(Switch 8, LED 4)
B0
(Switch 7, LED 3)
A1
(Switch 6, LED 2)
A0
(Switch 5, LED 1)
Y
LED 6
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
Table 10.2 – Truth table for a 2-bit Equality Comparator
4 | P a g e L o g i c a l F u n c t i o n C i r c u i t : C o m p a r a t o r
Part 3) Inequality Comparator
A 74LS85 compares a four bit number A and a four bit number B. The bits in each number
are labeled 0 through 3, 0 being the LSB. Since these chips can be cascaded, they have three
inputs which accept the output of a previous comparison. These three inputs are at pin 2, 3,
and 4.
6. Build and constructor Circuit 10.3.
Circuit 10.3 – Inequality Comparator
Circuit 10.3, pin 2 and 4 have to be grounded while pin 3 has to be connected to +5V
for proper operation. The bits that make up number B get fed to pins 9, 11, 14, and 1;
while the number A bits go to pin 10, 12, 13, and 15. If A=B, pin 6 goes HIGH. If
A>B, pin 5 goes HIGH. If A
7. Operate switch 1 to switch 8 according to Table 10.3 , and record if LED 1, 2, and 3 turns ON
or OFF
B3
Switch 1
B2
Switch 2
B1
Switch 3
B0
Switch 4
A3
Switch 5
A2
Switch 6
A1
Switch 7
A0
Switch 8
Pin5
LED 3
Pin6
LED 2
Pin7
LED 1
0 1 1 0 0 0 1 1
1 0 0 0 1 0 0 1
1 1 0 0 1 1 1 0
Table 10.3 – Truth table for an Inequality Comparator
Student’s Name: Lab Instructor’s Signature
—————————— LAB EXPERIMENT ENDS HERE ——————————-