SlideShare a Scribd company logo
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

IS 151 Lecture 8
IS 151 Lecture 8IS 151 Lecture 8
IS 151 Lecture 8
wajanga
 
L08 power amplifier (class a)
L08 power amplifier (class a)L08 power amplifier (class a)
L08 power amplifier (class a)hasanen22
 
Potentiometer Experiment 1
Potentiometer Experiment 1Potentiometer Experiment 1
Potentiometer Experiment 1
Lakshmikanta Satapathy
 
EE8351 DLC
EE8351 DLCEE8351 DLC
EE8351 DLC
rmkceteee
 
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
sskiran88k
 
Operational Amplifiers
Operational AmplifiersOperational Amplifiers
Operational Amplifiers
Mahesh_Naidu
 
BCD to binary code converter
BCD to binary code converterBCD to binary code converter
BCD to binary code converter
kiruthikamaniG1
 
Embedded c programming guide e book atmel 8051 / 89c51 /89c52
Embedded c programming guide e book atmel 8051 / 89c51 /89c52Embedded c programming guide e book atmel 8051 / 89c51 /89c52
Embedded c programming guide e book atmel 8051 / 89c51 /89c52
Raghav Shetty
 
Operational amplifiers
Operational amplifiersOperational amplifiers
Operational amplifiers
amritash10
 
Half subtracter
Half subtracterHalf subtracter
Half subtracter
awais ahmad
 
Four elevator controller
Four elevator controllerFour elevator controller
Four elevator controller
Bhagwat Singh Rathore
 
8 bit Multiplier Accumulator
8 bit Multiplier Accumulator8 bit Multiplier Accumulator
8 bit Multiplier Accumulator
Daksh Raj Chopra
 
electronics lab.doc
electronics lab.docelectronics lab.doc
electronics lab.doc
ELECTRONICSCOMMUNICA6
 
Computer graphics question for exam solved
Computer graphics question for exam solvedComputer graphics question for exam solved
Computer graphics question for exam solved
Kuntal Bhowmick
 
operational amplifiers
operational amplifiersoperational amplifiers
operational amplifiers
Patel Jay
 
Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder
Bharti Airtel Ltd.
 
Mealy state machine
Mealy state machineMealy state machine
Mealy state machineArif Siyal
 
Ch02認知評量解答
Ch02認知評量解答Ch02認知評量解答
Ch02認知評量解答
lungtengtech
 
Half adder and full adder | Digital electronics | engineering
Half adder  and full adder | Digital electronics | engineeringHalf adder  and full adder | Digital electronics | engineering
Half adder and full adder | Digital electronics | engineering
NITESH POONIA
 

What's hot (20)

IS 151 Lecture 8
IS 151 Lecture 8IS 151 Lecture 8
IS 151 Lecture 8
 
L08 power amplifier (class a)
L08 power amplifier (class a)L08 power amplifier (class a)
L08 power amplifier (class a)
 
Potentiometer Experiment 1
Potentiometer Experiment 1Potentiometer Experiment 1
Potentiometer Experiment 1
 
EE8351 DLC
EE8351 DLCEE8351 DLC
EE8351 DLC
 
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
Transistor Biasing and Thermal Stabilization Short Question and Answers by S ...
 
Operational Amplifiers
Operational AmplifiersOperational Amplifiers
Operational Amplifiers
 
BCD to binary code converter
BCD to binary code converterBCD to binary code converter
BCD to binary code converter
 
Embedded c programming guide e book atmel 8051 / 89c51 /89c52
Embedded c programming guide e book atmel 8051 / 89c51 /89c52Embedded c programming guide e book atmel 8051 / 89c51 /89c52
Embedded c programming guide e book atmel 8051 / 89c51 /89c52
 
Operational amplifiers
Operational amplifiersOperational amplifiers
Operational amplifiers
 
Half subtracter
Half subtracterHalf subtracter
Half subtracter
 
Four elevator controller
Four elevator controllerFour elevator controller
Four elevator controller
 
8 bit Multiplier Accumulator
8 bit Multiplier Accumulator8 bit Multiplier Accumulator
8 bit Multiplier Accumulator
 
electronics lab.doc
electronics lab.docelectronics lab.doc
electronics lab.doc
 
Computer graphics question for exam solved
Computer graphics question for exam solvedComputer graphics question for exam solved
Computer graphics question for exam solved
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
operational amplifiers
operational amplifiersoperational amplifiers
operational amplifiers
 
Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder Verilog VHDL code Parallel adder
Verilog VHDL code Parallel adder
 
Mealy state machine
Mealy state machineMealy state machine
Mealy state machine
 
Ch02認知評量解答
Ch02認知評量解答Ch02認知評量解答
Ch02認知評量解答
 
Half adder and full adder | Digital electronics | engineering
Half adder  and full adder | Digital electronics | engineeringHalf adder  and full adder | Digital electronics | engineering
Half adder and full adder | Digital electronics | engineering
 

Similar to magnitude comparator.pdf

Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
Syed 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 converted
subisugadevan
 
PLA
PLAPLA
Subtractor
SubtractorSubtractor
Subtractor
Syed Saeed
 
Decimal adder
Decimal adderDecimal adder
Decimal adder
Syed Saeed
 
Adder and Subtractor
Adder and SubtractorAdder and Subtractor
Adder and Subtractor
Jaydeep Kale
 
UNIT - II.pptx
UNIT - II.pptxUNIT - II.pptx
UNIT - II.pptx
amudhak10
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logic
Deepak John
 
IS 151 Lecture 9
IS 151 Lecture 9IS 151 Lecture 9
IS 151 Lecture 9
wajanga
 
Lesson Week 1-2.pptx
Lesson Week 1-2.pptxLesson Week 1-2.pptx
Lesson Week 1-2.pptx
ChristineTorrepenida1
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
SIVALAKSHMIPANNEERSE
 
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 & Decoder
Syed Saeed
 
Combinational Ckt.pdf
Combinational Ckt.pdfCombinational Ckt.pdf
Combinational Ckt.pdf
ShivarkarSandip
 
17067688.ppt
17067688.ppt17067688.ppt
17067688.ppt
Krishna Kumar
 
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
SeshaVidhyaS
 
Magnitude comparator
Magnitude comparatorMagnitude comparator
Magnitude comparator
Preet_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-2020
Thyagharajan K.K.
 
Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)Combinational circuit (7-Segment display)
Combinational circuit (7-Segment display)
ali9753
 
encoderdecoder.pptx
encoderdecoder.pptxencoderdecoder.pptx
encoderdecoder.pptx
AshwiniMate10
 

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

Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 

Recently uploaded (20)

Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 

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