0% found this document useful (0 votes)
21 views13 pages

DSM Exp 3 - DEVANK

Data structure

Uploaded by

dskolpe7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views13 pages

DSM Exp 3 - DEVANK

Data structure

Uploaded by

dskolpe7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

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: C Experiment No. 2 Subject: DSM

Semester: I Batch:C4

Name: Devank Swamiprasad Kolpe Roll


No.:2024300118

Aim: COMPARATOR IMPLEMENTATION.

Objective:
1. Use digital comparator IC’s (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  IC 7485.
REQUIRED  IC 7466 (Ex-Nor Gate).

THEORY:
1. Digital Comparators:
Comparators can be designed for comparing multi-bit numbers. Figure below shows the block diagram of an n-
bit comparator. It receives two n-bit numbers A and Bas inputs and the outputs are A > B A = B and A < B
Depending upon the relative magnitude of the two numbers, one of the outputs will be HIGH. Table 6.8 gives the
truth table of a 2-bit comparator. The reader is advised to simplify the expressions for A > B A = B and A < B
outputs using K-map and design the circuit using gates. However, 4-bit comparators are available in MSI (7485)
which can compare straight binary and natural BCD codes. These ICs can be cascaded to compare words of
greater lengths without external gates. The A > B A = B and A < B outputs of a stage handling less-significant bits
are connected to the corresponding A > B A = B and A < B cascading inputs of the next stage handling more-
significant bits. The stage handling the least- significant bits must have A = B input connected to logic 1 level and
A > B and A < B inputs connected to logic 0 or 1 level.

THEORY: 74LS85 Binary Comparator Features


 74LS85 can be used to compare 4-bits at the same time.
 It can be expanded further to compare data more than 4-bits.
 7485 gives output in TTL form, which makes it compatible with other TTL devices
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
and microcontrollers.
 It comes in two packages, SOIC and PDIP.
 It comes with internal protection from clamp voltages.
To the make the IC workable we will need to connect the IC first with the power
supply and further with a TTL device or microcontroller to use it. In other IC like an
adder, the IC starts working from LSB but in the comparator, the IC will start
comparing from the MSB. The data will start comparing from MSB and it will go to
the LSB. In the case, at any point, data A is bigger than the data B or vice versa
then the output will be decided. In IC the input data will be of two parts with 4-bit
each and output data will be of 3 bits. In input, the data can be any binary numbers
but in output data, only one bit will HIGH other will be LOW and all three bits will be
describing the output on the base of input.

1. 4 BIT-COMPARATOR:
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
The 4-bit magnitude comparator is used in more complex digital circuits like
microprocessors, microcontrollers, and many more. It is a type of comparator
that can compare the values or magnitudes of two 4-bit binary numbers and
produce an output indicating whether one number is equal to or less than or
greater than the other. The block diagram of the 4-bit magnitude comparator is
shown in the following figure
In a 4-bit comparator, the condition of A>B can be possible in the following four
cases.

 If A3 = 1 and B3 = 0
 If A3 = B3 and A2 = 1 and B2 = 0
 If A3 = B3, A2 = B2 and A1 = 1 and B1 = 0
 If A3 = B3, A2 = B2, A1 = B1 and A0 = 1 and B0 = 0

Similarly, the condition for A<B can be possible in the following four cases.

 If A3 = 0 and B3 = 1
 If A3 = B3 and A2 = 0 and B2 = 1
 If A3 = B3, A2 = B2 and A1 = 0 and B1 = 1
 If A3 = B3, A2 = B2, A1 = B1 and A0 = 0 and B0 = 1

The condition of A=B is possible only when all the individual bits of one number
exactly coincide with the corresponding bits of another number

Cascading Comparator:
A comparator performing the comparison operation to more than
four bits by cascading two or more 4-bit comparators is called a
cascading comparator. When two comparators are to be
cascaded, the outputs of the lower-order comparator are
connected to the corresponding inputs of the higher-order
comparator.
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

2. 5 BIT-COMPARATOR:
In simple words -IC 7485 compares 4 bit inputs. If we want 5 bit magnitude
comparator then we have to adjust one input line. Every 7485 IC has three
cascading input lines which can used in this case because we are using only
one IC to make 7485 comparator. A>B is grouped with one of the input
and A<B with another, now we have 5 bit inputs.

3. 8 BIT-COMPARATOR:
An 8-bit comparator compares the two 8-bit numbers by cascading of two 4-bit
comparators. The circuit connection of this comparator is shown above in which
the lower order comparator A>B, A=B, and A<B. For the lower order comparator,
the A=B cascade input must be connected High, while the other two cascading
inputs A, B must be connected to LOW. The outputs of the higher-order
comparator become the outputs of this eight-bit comparator.

4. 9 BIT-COMPARATOR:
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
To construct a 9-bit comparator using this IC, two ICs can be cascaded:

 Cascading Two ICs:


 The first IC compares the first 8 bits (4 bits from each number).
 The second IC handles the 9th bit separately.
 Cascading Logic:
 The output from the first IC provides inputs to the second IC's cascade
inputs.
 The outputs from both ICs will determine the overall comparison result for
all nine bits
Logic Design

For a more detailed understanding of how to implement this:

 First IC (ICI): Compare bits A3-A0 with B3-B0.


 Second IC (IC2): Compare bits A7-A4 with B7-B4. The outputs from IC1 will
dictate whether to continue comparing in IC2.
 Final Comparison for 9th Bit: Use simple logic gates to compare the 9th
bits directly:
 If both previous outputs indicate equality and the 9th bits are equal, then
the overall output will be equality.
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
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
Circuit 1)4 bit comparator:
Diagram:

2)5 bit comparator:

3)8 bit comparator:


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. 9 bit comparator :
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 TRUTH TABLES:

1. 4 bit comparator:

2. 5 BIT COMPARATOR:

 EX NOR GATE:
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

3. 8 BIT COMPARATOR:

 FIRST IC 7485:-

 SECOND IC 7485:
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

4. 9 BIT COMPARATOR:
 FIRST IC-

 SECOND IC-
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

 EX-NOR GATE:

Conclusion: Applications of Comparators:


 Comparators are used in central processing units (CPU s) and microcontrollers (MCUs).
 These are used in control applications in which the binary numbers representing
physical variables such as temperature, position, etc. are compared with a reference
value.
 Comparators are also used as process controllers and for Servo motor control.
 Used in password verification and biometric applications
 7485 has multiple uses in servers, networking devices, digital systems, and smart
electronic devices.
 IC simply used to compare the binary data which allows the other devices to perform
other functions.
 The IC comes internally in some embedded systems to perform logical operations

Advantage of Comparator :
 Comparators are simple and efficient for comparison of binary values.
 Fast decision-making in Digital Circuits.
 This comparator can be easily integrated in to complex systems like processors
and arithmetic units.
 Design of comparator are modular, which allow them to scale solutions for
comparing multi-bit numbers.

Disadvantages of Comparator :
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
 Comparators have limit of bits for comparison.
 It requires more complex circuit for large bits.
 Power consumption increase with increase in the complexity of the circuits.

You might also like