Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
Class: COMPUTERS (DIV A) Experiment No. 3 Subject: DSM
Semester: I Batch: A4
Name: DHEER KEDIA Roll No.: 2024300110
Aim:
Comparator Implementation
Objective: Use digital comparator ICs (such as 7485) to implement and verify the
comparison between binary numbers of different bit sizes (4-bit, 5-bit, 8-bit and
9-bit).
EQUIPMENTS Equipments Needed are :
REQUIRED Digital Trainer kit
Logic Gates :
IC 7432 : OR GATE / IC 7486 : XOR GATE / IC 7408 : AND GATE
IC 7402 : NOR GATE / IC 7404 : NOT GATE / IC 7400 : NAND GATE
IC 74266 : XNOR GATE / IC 7411 : 3 INPUT AND GATE
IC 4072 : 4 INPUT OR GATE
We will need IC 7485 in this experiment.
We need breadboard for prototyping circuits without soldering
We need wires for connection between components
Power supply typically +5v or +3.3V depending on logic levels
Procedure:
1. Design the Circuit: Use truth tables to determine the logic for your
Comparator
2. Build the Circuit: Assemble components on a breadboard.
3. Test the Circuit: Use a multimeter or logic analyzer to verify functionality.
THEORY: What is Comparator ?
Comparator is basically a digital device that performs arithmetic operations like it
takes 2 inputs and then compares if they are equal / which one is greater or less.
Comparators are used in microcontrollers (MCUs) and central processing units (CPUs).
A comparator takes two N-bit binary numbers as inputs, A and B and then the
comparator outputs a 1-bit comparison result. If the two inputs are equal, the output
is a binary 1. If the inputs are different, the output is 0. Some comparators can also
indicate if one input is larger or smaller than the other.
The analog equivalent of a digital comparator is a voltage comparator.
Applications: Comparators are used in:
● Arithmetic logic units (ALUs)
● Digital controllers
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
● Sorting algorithms
● Analog-to-digital converters (ADCs)
Comparator can be of 1 byte and of n-bytes
1 byte comparator compares single bits and n byte comparator compares n-bit binary
numbers
Example :
If A = 10 (2 in decimal) and B = 01 (1 in decimal), the comparator would output signals
indicating that A is greater than B.
We know only following types of comparator:
4-bit / 5-bit / 8-bit / 9-bit
Circuit 4-bit :
Diagram:
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
5-bit :
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
9-bit :
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
8-bit :
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
Result 4-bit Truth Table :
8-bit Truth Table :
Sardar Patel Institute of Technology
Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058-India
(Autonomous Institute Affiliated to University of Mumbai)
Academic Year: 2024-25
5-bit Truth Table :
9-bit Truth Table :
Conclusion: Comparators play a crucial role in digital circuit design and functioning, enabling
effective decision-making based on numerical comparisons.
We reduced propagation delays which is caused when we use logic gates to compare
values
We learned the functioning of a comparator, we compared binary numbers and got
the perfect output. We learned to make 8 / 9 bit comparators and how to use them.