DESIGN AND IMPLEMENTATION OF MAGNITUDE COMPARATORS
(a) 2-bit Magnitude Comparator using Logic Gates (b) 4-bit Magnitude
Comparator using IC 7485
AIM:
To design and implement (a) 2-bit magnitude comparator using logic gates &
(b) 4-bit magnitude comparator using IC 7485 and verify their truth table.
EQUIPMENTS & COMPONENTS REQUIRED:
Sl. No. Equipments & Components Quantity
1 Digital IC Trainer Kit 1
2 ICs 7404, 7486, 7408, 7432, 7485 1, 1, 2, 1, 2 respectively
3 Connecting wires As Required
THEORY:
The comparison of two numbers is an operation that determines whether one number
is greater than, less than or equal to the other number. A magnitude comparator is a
combinational circuit that compares two numbers A and B and determines their
relative magnitudes. The outcome of the comparison is specified by three binary
variables that indicate whether (A > B), (A = B) or (A < B). The circuit for comparing
two n- bit numbers has 22n entries in the truth table and this is difficult even with 𝑛 =
3 as it requires 64 entries in the table. Here we give the truth table for 2- bit magnitude
comparator and thereby obtain the logic diagram by finding the expression for the
output variables. Due to this disadvantage of making the truth table more complex
for even 3- bit number we derive an algorithm to design a magnitude comparator.
For any n-bit number, the algorithm is given as follows. First, the most significant bit
of both the numbers A & B is compared. In that bit position it is checked whether (A
> B), (A = B) or (A < B). If (A > B) or (A < B) that is the final output. But if (A = B), then
the next significant bit is compared. Likewise, the procedure goes until all the bits are
compared.
IC 7485 is a 4-bit magnitude comparator whose pin diagram is as shown.
PROCEDURE:
1. Test all the ICs manually/ using IC tester.
2. Connect VCC and the ground.
3. Connect the appropriate pins to the input and output LEDs and switches.
4. Give various combinations of the inputs and verify the truth table/function
table.
PIN DIAGRAM, TRUTH TABLE & LOGIC DIAGRAM:
2- bit Magnitude Comparator using Logic Gates:
Inputs Outputs
A1 A0 B1 B0 A=B A<B A>B
0 0 0 0 1 0 0
0 0 0 1 0 1 0
0 0 1 0 0 1 0
0 0 1 1 0 1 0
0 1 0 0 0 0 1
0 1 0 1 1 0 0
0 1 1 0 0 1 0
0 1 1 1 0 1 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 1 0 0
1 0 1 1 0 1 0
1 1 0 0 0 0 1
1 1 0 1 0 0 1
1 1 1 0 0 0 1
1 1 1 1 1 0 0
K-maps for comparator outputs:
Figure. Logic diagram for 2- bit Magnitude Comparator using Logic gates
4-bit Magnitude Comparator using IC 7485:
PIN DIAGRAM FOR IC 7485:
Figure. Connection diagram for 4-bit Magnitude Comparator using IC 7485
Function Table:
A3, B3 A2, B2 A1, B1 A0, B0 A>B A=B A<B
A3> B3 x x x 1 0 0
A3< B3 x x x 0 0 1
A3= B3 A2> B2 x x 1 0 0
A3= B3 A2< B2 x x 0 0 1
A3= B3 A2= B2 A1> B1 x 1 0 0
A3= B3 A2= B2 A1< B1 x 0 0 1
A3= B3 A2= B2 A1= B1 A0> B0 1 0 0
A3= B3 A2= B2 A1= B1 A0< B0 0 0 1
A3= B3 A2= B2 A1= B1 A0= B0 0 1 0
RESULT: