SlideShare a Scribd company logo
1 of 19
Download to read offline
MAGNITUDE COMPARATOR
Syed Hasan Saeed, Integral University,
Lucknow
2
MAGNITUDE COMPARATOR: DIGITAL COMPARATOR
• It is a combinational logic circuit.
• Digital Comparator is used to compare the value of two binary
digits.
• There are two types of digital comparator (i) Identity Comparator
(ii) Magnitude Comparator.
• IDENTITY COMPARATOR: This comparator has only one output
terminal for when A=B, either A=B=1 (High) or A=B=0 (Low)
• MAGNITUDE COMPARATOR: This Comparator has three output
terminals namely A>B, A=B, A<B. Depending on the result of
comparison, one of these output will be high (1)
• Block Diagram of Magnitude Comparator is shown in Fig. 1
Syed Hasan Saeed, Integral University,
Lucknow
3
BLOCK DIAGRAM OF MAGNITUDE COMPARATOR
Syed Hasan Saeed, Integral University,
Lucknow
4
n- Bit Digital Comparator
A
n-Bit
B
n-Bit
A<B A=B A>B
Fig. 1
1- Bit Magnitude Comparator:
• This magnitude comparator has two inputs A and B and three
outputs A<B, A=B and A>B.
• This magnitude comparator compares the two numbers of single
bits.
• Truth Table of 1-Bit Comparator
Syed Hasan Saeed, Integral University,
Lucknow
5
INPUTS OUTPUTS
A B Y1 (A<B) Y2 (A=B) Y3 (A>B)
0 0 0 1 0
0 1 1 0 0
1 0 0 0 1
1 1 0 1 0
K-Maps For All Three Outputs :
Syed Hasan Saeed, Integral University,
Lucknow
6
A
B
0 1
0
1
0
0 0
1
B B
A
A
B
A
Y1 
K-Map for Y1 : A<B
K-Maps For All Three Outputs :
Syed Hasan Saeed, Integral University,
Lucknow
7
A
B
0 1
0
1
0
0 0
1
B B
A
A
B
A
Y1 
K-Map for Y1 : A<B
A
B
0 1
0
1
1
0 1
0
B B
A
A
AB
B
A
Y2 

K-Map for Y2 : A=B
K-Maps For All Three Outputs :
Syed Hasan Saeed, Integral University,
Lucknow
8
A
B
0 1
0
1
0
0 0
1
B B
A
A
B
A
Y1 
K-Map for Y1 : A<B
A
B
0 1
0
1
1
0 1
0
B B
A
A
AB
B
A
Y2 

K-Map for Y2 : A=B
A 0 1
0
1
0
1
0
B
B
A
A
B
0
B
A
Y3 
K-Map for Y2 : A>B
Realization of One Bit Comparator
Syed Hasan Saeed, Integral University,
Lucknow
9
B
A
B
A
Y1 

A
B
AB
B
A
AB
B
A
Y2 

B
A
Y3 
B
A 
B
A 
B
A
Y1 
AB
B
A
Y2 

B
A
Y3 
Realization of by Using AND , EX-NOR gates
Syed Hasan Saeed, Integral University,
Lucknow
10
B
A
B
A
Y1 

B
A
B
A
Y2



B
A
Y3 
B
A 
A
B
2-Bit Comparator:
• A comparator which is used to compare two binary numbers each of two
bits is called a 2-bit magnitude comparator.
• Fig. 2 shows the block diagram of 2-Bit magnitude comparator.
• It has four inputs and three outputs.
• Inputs are A0 ,A1,B0 and B1 and Outputs are Y1, Y2 and Y3
Syed Hasan Saeed, Integral University,
Lucknow
11
A0
A1
B1
B0
Y1
Y2
Y3
2-Bit Comparator
Fig. 2
A
B
Input Output
GREATER THAN (A>B)
LESS THAN (A<B)
Similarly,
1. If A1= B1=1 and A0= 0, B0=1, then A<B
2. If A1= B1= 0 and A0= 0, B0=1 then A<B
Syed Hasan Saeed, Integral University,
Lucknow
12
A1 A0 B1 B0
1 0 0 1
1 1 1 0
0 1 0 0
1. If A1= 1 and B1= 0 then A>B
2. If A1 and B1 are same, i.e A1=B1=1 or A1=B1=0 and A0=1, B0=0
then A>B
INPUT OUTPUT
A1 A0 B1 B0 Y1=A<B Y2=(A=B) Y3=A>B
0 0 0 0 0 1 0
0 0 0 1 1 0 0
0 0 1 0 1 0 0
0 0 1 1 1 0 0
0 1 0 0 0 0 1
0 1 0 1 0 1 0
0 1 1 0 1 0 0
0 1 1 1 1 0 0
1 0 0 0 0 0 1
1 0 0 1 0 0 1
1 0 1 0 0 1 0
1 0 1 1 1 0 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 0 1 0
Syed Hasan Saeed, Integral University,
Lucknow
13
TRUTH TABLE
K-Map for A<B: K-Map for A=B:
Syed Hasan Saeed, Integral University,
Lucknow
14
0 1 1 1
0 0 1 1
0 0 0 0
0 0 1 0
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
00 01
00
01
11
10
11 10 00 01 11 10
00
01
11
10
A1A0
A1A0
B1B0
B1B0
For A<B
For A=B
0
1
0
1
1
0
0
1
1 B
B
A
B
A
B
A
A
Y 


0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2 B
B
A
A
B
B
A
A
B
B
A
A
B
B
A
A
Y 



K-Map For A>B
Syed Hasan Saeed, Integral University,
Lucknow
15
0 0 0 0
1 0 0 0
1 1 0 1
1 1 0 0
00 01 11 10
00
01
11
10
A1A0
B1B0
0
0
1
1
1
0
1
0
3 B
A
A
B
A
B
B
A
Y 


For A=B From K-Map
Syed Hasan Saeed, Integral University,
Lucknow
16
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
2 B
B
A
A
B
B
A
A
B
B
A
A
B
B
A
A
Y 



)
B
(A
)
B
A
(
Y
)
B
A
B
A
(
)
B
A
B
A
(
Y
)
B
A
B
A
(
B
A
)
B
A
B
A
(
B
A
Y
0
0
1
1
2
0
0
0
0
1
1
1
1
2
1
1
1
1
0
0
1
1
1
1
0
0
2










LOGIC DIAGRAM OF 2-BIT COMPARATOR:
Syed Hasan Saeed, Integral University,
Lucknow
17
A1 A0 B1 B0
A< B
A=B
A > B
0
0
1 B
A
A
1
1 B
A
0
1
0 B
B
A
1
1 B
A
0
0
1 B
A
A
0
1
0 B
B
A
1
1 B
A 
0
0 B
A 
THANK YOU
Syed Hasan Saeed, Integral University,
Lucknow
18
Quick Quiz (Poll 1)
• If two numbers are not equal then binary
variable will be ____________
a) 0
b) 1
c) A
d) B
Quick Quiz (Poll 2)
• Comparators are used in ____________
a) Memory
b) CPU
c) Motherboard
d) Hard drive

More Related Content

What's hot

Logic gates and its realization
Logic gates and its realizationLogic gates and its realization
Logic gates and its realizationnganesh90
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuitsMahesh_Naidu
 
OrCAD / Allegro PCB Editor Design Guide
OrCAD / Allegro PCB Editor Design GuideOrCAD / Allegro PCB Editor Design Guide
OrCAD / Allegro PCB Editor Design GuideOle Ejlersen
 
2.3 sequantial logic circuit
2.3 sequantial logic circuit2.3 sequantial logic circuit
2.3 sequantial logic circuitWan Afirah
 
CMOS Inverter static characterstics.pptx
CMOS Inverter static characterstics.pptxCMOS Inverter static characterstics.pptx
CMOS Inverter static characterstics.pptxindrajeetPatel22
 
Introduction to Hardware Design Using KiCAD
Introduction to Hardware Design Using KiCADIntroduction to Hardware Design Using KiCAD
Introduction to Hardware Design Using KiCADNEEVEE Technologies
 
Flip Chip technology
Flip Chip technologyFlip Chip technology
Flip Chip technologyMantra VLSI
 
Ic tech unit 5- VLSI Process Integration
Ic tech unit 5- VLSI Process IntegrationIc tech unit 5- VLSI Process Integration
Ic tech unit 5- VLSI Process Integrationkriticka sharma
 
Reduced ordered binary decision diagram
Reduced ordered binary decision diagramReduced ordered binary decision diagram
Reduced ordered binary decision diagramTeam-VLSI-ITMU
 
MOSFET, SOI-FET and FIN-FET-ABU SYED KUET
MOSFET, SOI-FET and FIN-FET-ABU SYED KUETMOSFET, SOI-FET and FIN-FET-ABU SYED KUET
MOSFET, SOI-FET and FIN-FET-ABU SYED KUETA. S. M. Jannatul Islam
 
VLSI Fresher Resume
VLSI Fresher ResumeVLSI Fresher Resume
VLSI Fresher Resumevikas kumar
 
Unit no. 5 cmos logic design
Unit no. 5 cmos logic designUnit no. 5 cmos logic design
Unit no. 5 cmos logic designswagatkarve
 
Digital logic gates and Boolean algebra
Digital logic gates and Boolean algebraDigital logic gates and Boolean algebra
Digital logic gates and Boolean algebraSARITHA REDDY
 
Binary to grey code conversion
Binary to grey code conversionBinary to grey code conversion
Binary to grey code conversionSunny
 
encoder and decoder in digital electronics
encoder and decoder in digital electronicsencoder and decoder in digital electronics
encoder and decoder in digital electronicsvikram rajpurohit
 

What's hot (20)

Logic gates and its realization
Logic gates and its realizationLogic gates and its realization
Logic gates and its realization
 
PCB Layout Fundamentals
PCB Layout FundamentalsPCB Layout Fundamentals
PCB Layout Fundamentals
 
Encoders and decoders
Encoders and decodersEncoders and decoders
Encoders and decoders
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
 
OrCAD / Allegro PCB Editor Design Guide
OrCAD / Allegro PCB Editor Design GuideOrCAD / Allegro PCB Editor Design Guide
OrCAD / Allegro PCB Editor Design Guide
 
2.3 sequantial logic circuit
2.3 sequantial logic circuit2.3 sequantial logic circuit
2.3 sequantial logic circuit
 
Logic gate
Logic gateLogic gate
Logic gate
 
CMOS Inverter static characterstics.pptx
CMOS Inverter static characterstics.pptxCMOS Inverter static characterstics.pptx
CMOS Inverter static characterstics.pptx
 
Introduction to Hardware Design Using KiCAD
Introduction to Hardware Design Using KiCADIntroduction to Hardware Design Using KiCAD
Introduction to Hardware Design Using KiCAD
 
Flip Chip technology
Flip Chip technologyFlip Chip technology
Flip Chip technology
 
Layout02 (1)
Layout02 (1)Layout02 (1)
Layout02 (1)
 
Mosfet
MosfetMosfet
Mosfet
 
Ic tech unit 5- VLSI Process Integration
Ic tech unit 5- VLSI Process IntegrationIc tech unit 5- VLSI Process Integration
Ic tech unit 5- VLSI Process Integration
 
Reduced ordered binary decision diagram
Reduced ordered binary decision diagramReduced ordered binary decision diagram
Reduced ordered binary decision diagram
 
MOSFET, SOI-FET and FIN-FET-ABU SYED KUET
MOSFET, SOI-FET and FIN-FET-ABU SYED KUETMOSFET, SOI-FET and FIN-FET-ABU SYED KUET
MOSFET, SOI-FET and FIN-FET-ABU SYED KUET
 
VLSI Fresher Resume
VLSI Fresher ResumeVLSI Fresher Resume
VLSI Fresher Resume
 
Unit no. 5 cmos logic design
Unit no. 5 cmos logic designUnit no. 5 cmos logic design
Unit no. 5 cmos logic design
 
Digital logic gates and Boolean algebra
Digital logic gates and Boolean algebraDigital logic gates and Boolean algebra
Digital logic gates and Boolean algebra
 
Binary to grey code conversion
Binary to grey code conversionBinary to grey code conversion
Binary to grey code conversion
 
encoder and decoder in digital electronics
encoder and decoder in digital electronicsencoder and decoder in digital electronics
encoder and decoder in digital electronics
 

Similar to magnitude comparator.pdf

Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparatorSyed Saeed
 
6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit convertedsubisugadevan
 
Adder and Subtractor
Adder and SubtractorAdder and Subtractor
Adder and SubtractorJaydeep Kale
 
UNIT - II.pptx
UNIT - II.pptxUNIT - II.pptx
UNIT - II.pptxamudhak10
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logicDeepak John
 
IS 151 Lecture 9
IS 151 Lecture 9IS 151 Lecture 9
IS 151 Lecture 9wajanga
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...michaelaaron25322
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & DecoderSyed Saeed
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECESeshaVidhyaS
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparatorPreet_patel
 
PPT 2 - CA unit II 22 7-2020
PPT 2 - CA unit II 22 7-2020PPT 2 - CA unit II 22 7-2020
PPT 2 - CA unit II 22 7-2020Thyagharajan K.K.
 
Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)ali9753
 

Similar to magnitude comparator.pdf (20)

Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 
6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted6 2 magnitudecomparator ibit and 2 bit converted
6 2 magnitudecomparator ibit and 2 bit converted
 
PLA
PLAPLA
PLA
 
Subtractor
SubtractorSubtractor
Subtractor
 
Decimal adder
Decimal adderDecimal adder
Decimal adder
 
Adder and Subtractor
Adder and SubtractorAdder and Subtractor
Adder and Subtractor
 
UNIT - II.pptx
UNIT - II.pptxUNIT - II.pptx
UNIT - II.pptx
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logic
 
IS 151 Lecture 9
IS 151 Lecture 9IS 151 Lecture 9
IS 151 Lecture 9
 
Lesson Week 1-2.pptx
Lesson Week 1-2.pptxLesson Week 1-2.pptx
Lesson Week 1-2.pptx
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & Decoder
 
Combinational Ckt.pdf
Combinational Ckt.pdfCombinational Ckt.pdf
Combinational Ckt.pdf
 
17067688.ppt
17067688.ppt17067688.ppt
17067688.ppt
 
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECEDigital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
Digital Electronics (EC8392) UNIT-II -PPT-S.SESHA VIDHYA/ ASP/ECE
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
 
PPT 2 - CA unit II 22 7-2020
PPT 2 - CA unit II 22 7-2020PPT 2 - CA unit II 22 7-2020
PPT 2 - CA unit II 22 7-2020
 
Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)
 
encoderdecoder.pptx
encoderdecoder.pptxencoderdecoder.pptx
encoderdecoder.pptx
 

Recently uploaded

SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxCHAIRMAN M
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Stationsiddharthteach18
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...Christo Ananth
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationEmaan Sharma
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxMustafa Ahmed
 
Presentation on Slab, Beam, Column, and Foundation/Footing
Presentation on Slab,  Beam, Column, and Foundation/FootingPresentation on Slab,  Beam, Column, and Foundation/Footing
Presentation on Slab, Beam, Column, and Foundation/FootingEr. Suman Jyoti
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...IJECEIAES
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfSkNahidulIslamShrabo
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelDrAjayKumarYadav4
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxMustafa Ahmed
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsVIEW
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailingAshishSingh1301
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
Introduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxIntroduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxProfASKolap
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfKira Dess
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 

Recently uploaded (20)

SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Station
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...
Call for Papers - Journal of Electrical Systems (JES), E-ISSN: 1112-5209, ind...
 
History of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & ModernizationHistory of Indian Railways - the story of Growth & Modernization
History of Indian Railways - the story of Growth & Modernization
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 
Presentation on Slab, Beam, Column, and Foundation/Footing
Presentation on Slab,  Beam, Column, and Foundation/FootingPresentation on Slab,  Beam, Column, and Foundation/Footing
Presentation on Slab, Beam, Column, and Foundation/Footing
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdf
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
Introduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptxIntroduction-to- Metrology and Quality.pptx
Introduction-to- Metrology and Quality.pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 

magnitude comparator.pdf

  • 1. MAGNITUDE COMPARATOR Syed Hasan Saeed, Integral University, Lucknow 2
  • 2. MAGNITUDE COMPARATOR: DIGITAL COMPARATOR • It is a combinational logic circuit. • Digital Comparator is used to compare the value of two binary digits. • There are two types of digital comparator (i) Identity Comparator (ii) Magnitude Comparator. • IDENTITY COMPARATOR: This comparator has only one output terminal for when A=B, either A=B=1 (High) or A=B=0 (Low) • MAGNITUDE COMPARATOR: This Comparator has three output terminals namely A>B, A=B, A<B. Depending on the result of comparison, one of these output will be high (1) • Block Diagram of Magnitude Comparator is shown in Fig. 1 Syed Hasan Saeed, Integral University, Lucknow 3
  • 3. BLOCK DIAGRAM OF MAGNITUDE COMPARATOR Syed Hasan Saeed, Integral University, Lucknow 4 n- Bit Digital Comparator A n-Bit B n-Bit A<B A=B A>B Fig. 1
  • 4. 1- Bit Magnitude Comparator: • This magnitude comparator has two inputs A and B and three outputs A<B, A=B and A>B. • This magnitude comparator compares the two numbers of single bits. • Truth Table of 1-Bit Comparator Syed Hasan Saeed, Integral University, Lucknow 5 INPUTS OUTPUTS A B Y1 (A<B) Y2 (A=B) Y3 (A>B) 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 1 0
  • 5. K-Maps For All Three Outputs : Syed Hasan Saeed, Integral University, Lucknow 6 A B 0 1 0 1 0 0 0 1 B B A A B A Y1  K-Map for Y1 : A<B
  • 6. K-Maps For All Three Outputs : Syed Hasan Saeed, Integral University, Lucknow 7 A B 0 1 0 1 0 0 0 1 B B A A B A Y1  K-Map for Y1 : A<B A B 0 1 0 1 1 0 1 0 B B A A AB B A Y2   K-Map for Y2 : A=B
  • 7. K-Maps For All Three Outputs : Syed Hasan Saeed, Integral University, Lucknow 8 A B 0 1 0 1 0 0 0 1 B B A A B A Y1  K-Map for Y1 : A<B A B 0 1 0 1 1 0 1 0 B B A A AB B A Y2   K-Map for Y2 : A=B A 0 1 0 1 0 1 0 B B A A B 0 B A Y3  K-Map for Y2 : A>B
  • 8. Realization of One Bit Comparator Syed Hasan Saeed, Integral University, Lucknow 9 B A B A Y1   A B AB B A AB B A Y2   B A Y3  B A  B A  B A Y1  AB B A Y2   B A Y3 
  • 9. Realization of by Using AND , EX-NOR gates Syed Hasan Saeed, Integral University, Lucknow 10 B A B A Y1   B A B A Y2    B A Y3  B A  A B
  • 10. 2-Bit Comparator: • A comparator which is used to compare two binary numbers each of two bits is called a 2-bit magnitude comparator. • Fig. 2 shows the block diagram of 2-Bit magnitude comparator. • It has four inputs and three outputs. • Inputs are A0 ,A1,B0 and B1 and Outputs are Y1, Y2 and Y3 Syed Hasan Saeed, Integral University, Lucknow 11 A0 A1 B1 B0 Y1 Y2 Y3 2-Bit Comparator Fig. 2 A B Input Output
  • 11. GREATER THAN (A>B) LESS THAN (A<B) Similarly, 1. If A1= B1=1 and A0= 0, B0=1, then A<B 2. If A1= B1= 0 and A0= 0, B0=1 then A<B Syed Hasan Saeed, Integral University, Lucknow 12 A1 A0 B1 B0 1 0 0 1 1 1 1 0 0 1 0 0 1. If A1= 1 and B1= 0 then A>B 2. If A1 and B1 are same, i.e A1=B1=1 or A1=B1=0 and A0=1, B0=0 then A>B
  • 12. INPUT OUTPUT A1 A0 B1 B0 Y1=A<B Y2=(A=B) Y3=A>B 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 1 0 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 0 1 0 Syed Hasan Saeed, Integral University, Lucknow 13 TRUTH TABLE
  • 13. K-Map for A<B: K-Map for A=B: Syed Hasan Saeed, Integral University, Lucknow 14 0 1 1 1 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 00 01 00 01 11 10 11 10 00 01 11 10 00 01 11 10 A1A0 A1A0 B1B0 B1B0 For A<B For A=B 0 1 0 1 1 0 0 1 1 B B A B A B A A Y    0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 B B A A B B A A B B A A B B A A Y    
  • 14. K-Map For A>B Syed Hasan Saeed, Integral University, Lucknow 15 0 0 0 0 1 0 0 0 1 1 0 1 1 1 0 0 00 01 11 10 00 01 11 10 A1A0 B1B0 0 0 1 1 1 0 1 0 3 B A A B A B B A Y   
  • 15. For A=B From K-Map Syed Hasan Saeed, Integral University, Lucknow 16 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 B B A A B B A A B B A A B B A A Y     ) B (A ) B A ( Y ) B A B A ( ) B A B A ( Y ) B A B A ( B A ) B A B A ( B A Y 0 0 1 1 2 0 0 0 0 1 1 1 1 2 1 1 1 1 0 0 1 1 1 1 0 0 2          
  • 16. LOGIC DIAGRAM OF 2-BIT COMPARATOR: Syed Hasan Saeed, Integral University, Lucknow 17 A1 A0 B1 B0 A< B A=B A > B 0 0 1 B A A 1 1 B A 0 1 0 B B A 1 1 B A 0 0 1 B A A 0 1 0 B B A 1 1 B A  0 0 B A 
  • 17. THANK YOU Syed Hasan Saeed, Integral University, Lucknow 18
  • 18. Quick Quiz (Poll 1) • If two numbers are not equal then binary variable will be ____________ a) 0 b) 1 c) A d) B
  • 19. Quick Quiz (Poll 2) • Comparators are used in ____________ a) Memory b) CPU c) Motherboard d) Hard drive