SlideShare uma empresa Scribd logo
1 de 11
MAGNITUDE COMPARATOR
PREET PATEL
AIIE
ANALOG ELECTRONICS
Magnitude Comparator
• A magnitude digital comparator is a combinational circuit that compares two
digital or binary numbers (consider A and B) and determines their relative
magnitudes in order to find out whether one number is equal, less than or greater
than the other digital number.
• Three binary variables are used to indicate the outcome of the comparison as A>B,
A<B, or A=B. The below figure shows the block diagram of a n-bit comparator
which compares the two numbers of n-bit length and generates their relation
between themselves.
Magnitude comparator is a combinational circuit that compares two numbers and determines their
relative magnitude. A comparator is shown as Figure 2.1. The output of comparator is usually 3
binary variables indicating:
A>B
A=B
A<B
LOGIC DESIGN PROCEDURE
A>B
A=B
A<B
Comparator
A
B
For a 2-bit comparator, we have four inputs A1A0 and B1B0 and three outputs:
E (is 1 if two numbers are equal)
G (is 1 when A > B) and
L (is 1 when A < B)
G(A>B)
E(A=B)
L(A<B)
Comparator
A1
B1
A0
B0
LOGIC DESIGN FOR 2-BIT COMPARATOR
If we use truth table and K-MAP, the result is
E= A’1A’0B’1B’0 + A’1A0B’1B0 + A1A0B1B0 + A1A’0B1B’0
or
E=(( A0 ⊕ B0) + ( A1 ⊕ B1))’
G = A1B’1 + A0B’1B’0 + A1A0B’0
L= A’1B1 + A’1A’0B0 + A’0B1B0
Here we use simpler method to find E (called X) and G (called Y) and L (called Z)
CASE 1: A=B if all Ai= Bi
It means X0 = A0B0 + A’0B’0 and
X1= A1B1 + A’1B’1
If X0=1 and X1=1 then A0=B0 and A1=B1
Thus, if A=B then X0X1 = 1 it means
X= (A0B0 + A’0B’0)(A1B1 + A’1B’1)
since (x ⊕ y)’ = (xy +x’y’)
X= ( A0⊕B0)’ ( A1⊕B1)’ = (( A0 ⊕ B0) + ( A1 ⊕ B1))’
It means for X we can NOR the result of two exclusive-OR gates.
RESULT
Ai Bi Xi
0 0 1
0 1 0
1 0 0
1 1 0
CASE 2: A>B
means
If A1=B1 (X1=1) then A0 should be 1 and B0 should be 0
For A> B: A1 > B1 or
A1 =B1 and A0 > B0
It means Y= A1B’1 + X1A0B’0 should be 1 for A> B.
CASE 3: For B>A : B1 > A1
A1=B1 and B0> A0
Z= A’1B1 + X1A’0B0
A1 B1 Y1
0 0 0
0 1 0
1 0 1
1 1 0
A0 B0 Y0
0 0 1
0 1 0
1 0 0
1 1 0
4-BIT COMPARATOR
The procedure for binary numbers with
more than 2 bits can also be found in the
similar way. Figure shows the 4-bit
magnitude comparator.
Input: A=A3A2A1A0
B=B3B2B1B0
A3
B3
x3
A2
B2
x2
A1
B1
x1
A0
B0
x0
(A<B)
(A>B)
(A=B)
4-Bit Magnitude Comparator
CASE 1: A=B
A3=B3, A2=B2, A1=B1, A0=B0
xi = AiBi + Ai’Bi’
XOR-Invert = (AiBi’+Ai’Bi)’
= (Ai’+Bi)(Ai+Bi’)
= Ai’Ai + Ai’Bi’ + AiBi + BiBi’
= AiBi + Ai’Bi’
Output: X3X2X1X0
CASE 2: A>B
Output: A3B’3 + X3A2B’2 + X3X2A1B’1+ X3X2X1A0B’0
CASE 3: A<B
Output: A’3B3 + X3A’2B2 + X3X2A’1B1+ X3X2X1A’0B0
Truth table of 4-Bit Comparator
COMPARING INPUTS OUTPUT
A3, B3 A2, B2 A1, B1 A0, B0 A > B A < B A = B
A3 > B3 X X X H L L
A3 < B3 X X X L H L
A3 = B3 A2 >B2 X X H L L
A3 = B3 A2 < B2 X X L H L
A3 = B3 A2 = B2 A1 > B1 X H L L
A3 = B3 A2 = B2 A1 < B1 X L H L
A3 = B3 A2 = B2 A1 = B1 A0 > B0 H L L
A3 = B3 A2 = B2 A1 = B1 A0 < B0 L H L
A3 = B3 A2 = B2 A1 = B1 A0 = B0 H L L
A3 = B3 A2 = B2 A1 = B1 A0 = B0 L H L
A3 = B3 A2 = B2 A1 = B1 A0 = B0 L L H
H = High Voltage Level, L = Low Voltage, Level, X = Don’t Care
Applications of Comparators
• These are used in the address decoding circuitry in computers and microprocessor based
devices to select a specific input/output device for the storage of data.
• 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. Then
the outputs from the comparator are used to drive the actuators so as to make the
physical variables closest to the set or reference value.
• Process controllers
• Servo-motor control
Magnitude comparator

Mais conteúdo relacionado

Mais procurados

Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
Basic theorems and properties of boolean algebra
Basic theorems and properties of boolean algebraBasic theorems and properties of boolean algebra
Basic theorems and properties of boolean algebraHanu Kavi
 
Magnitude Comparator and types of MC
Magnitude Comparator and types of MCMagnitude Comparator and types of MC
Magnitude Comparator and types of MCEasy n Inspire L
 
Boolean algebra And Logic Gates
Boolean algebra And Logic GatesBoolean algebra And Logic Gates
Boolean algebra And Logic GatesKumar
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparatorBilal Amjad
 
M3 PPT 22ESC143.docx
M3 PPT 22ESC143.docxM3 PPT 22ESC143.docx
M3 PPT 22ESC143.docxJyothi122118
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment displayMaulik Sanchela
 
Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operationsNitesh Bichwani
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliersSyed Saeed
 

Mais procurados (20)

Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
Digital Logic circuit
Digital Logic circuitDigital Logic circuit
Digital Logic circuit
 
Code conversion
Code conversionCode conversion
Code conversion
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Subtractor
SubtractorSubtractor
Subtractor
 
Basic theorems and properties of boolean algebra
Basic theorems and properties of boolean algebraBasic theorems and properties of boolean algebra
Basic theorems and properties of boolean algebra
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Magnitude Comparator and types of MC
Magnitude Comparator and types of MCMagnitude Comparator and types of MC
Magnitude Comparator and types of MC
 
Bcd adder
Bcd adderBcd adder
Bcd adder
 
Logic gates presentation
Logic gates presentationLogic gates presentation
Logic gates presentation
 
Boolean algebra And Logic Gates
Boolean algebra And Logic GatesBoolean algebra And Logic Gates
Boolean algebra And Logic Gates
 
4-bit camparator
4-bit camparator4-bit camparator
4-bit camparator
 
M3 PPT 22ESC143.docx
M3 PPT 22ESC143.docxM3 PPT 22ESC143.docx
M3 PPT 22ESC143.docx
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
Digital logic circuit
Digital logic circuitDigital logic circuit
Digital logic circuit
 
Bcd to 7 segment display
Bcd to 7 segment displayBcd to 7 segment display
Bcd to 7 segment display
 
Arithmetic micro operations
Arithmetic micro operationsArithmetic micro operations
Arithmetic micro operations
 
Binary multipliers
Binary multipliersBinary multipliers
Binary multipliers
 
Encoder
EncoderEncoder
Encoder
 

Semelhante a 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 convertedsubisugadevan
 
I semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxI semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxMayank Pandey
 
Unit 4 combinational circuit
Unit 4 combinational circuitUnit 4 combinational circuit
Unit 4 combinational circuitKalai Selvi
 
Magnitude Comparator
Magnitude ComparatorMagnitude Comparator
Magnitude Comparatorsakshiravte4
 
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptxDLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptxSaveraAyub2
 
IS 151 Lecture 9
IS 151 Lecture 9IS 151 Lecture 9
IS 151 Lecture 9wajanga
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsArti Parab Academics
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logicDeepak John
 
Comparators_and_Code_Convertersv.pptx.ppt
Comparators_and_Code_Convertersv.pptx.pptComparators_and_Code_Convertersv.pptx.ppt
Comparators_and_Code_Convertersv.pptx.pptHardikGupta400524
 

Semelhante a Magnitude comparator (20)

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
 
I semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxI semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptx
 
Unit 4 combinational circuit
Unit 4 combinational circuitUnit 4 combinational circuit
Unit 4 combinational circuit
 
Magnitude Comparator
Magnitude ComparatorMagnitude Comparator
Magnitude Comparator
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
Logic Gates.pptx
Logic Gates.pptxLogic Gates.pptx
Logic Gates.pptx
 
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptxDLD Lecture No 21  BCD Multiplier and Magnitude Comparator.pptx
DLD Lecture No 21 BCD Multiplier and Magnitude Comparator.pptx
 
IS 151 Lecture 9
IS 151 Lecture 9IS 151 Lecture 9
IS 151 Lecture 9
 
Digital 4-bit Comprator
Digital 4-bit CompratorDigital 4-bit Comprator
Digital 4-bit Comprator
 
Arithmatic &Logic Unit
Arithmatic &Logic UnitArithmatic &Logic Unit
Arithmatic &Logic Unit
 
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic CircuitsFYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
FYBSC IT Digital Electronics Unit III Chapter II Arithmetic Circuits
 
Digital 1 8
Digital 1 8Digital 1 8
Digital 1 8
 
B sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lcktB sc3 unit 4 combi..lckt
B sc3 unit 4 combi..lckt
 
Logic gates
Logic gatesLogic gates
Logic gates
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
 
Combinational and sequential logic
Combinational and sequential logicCombinational and sequential logic
Combinational and sequential logic
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
2dig circ
2dig circ2dig circ
2dig circ
 
Comparators_and_Code_Convertersv.pptx.ppt
Comparators_and_Code_Convertersv.pptx.pptComparators_and_Code_Convertersv.pptx.ppt
Comparators_and_Code_Convertersv.pptx.ppt
 
Lesson Week 1-2.pptx
Lesson Week 1-2.pptxLesson Week 1-2.pptx
Lesson Week 1-2.pptx
 

Mais de Preet_patel

DESIGN OF TURBO ALTERNATORS
DESIGN OF TURBO ALTERNATORSDESIGN OF TURBO ALTERNATORS
DESIGN OF TURBO ALTERNATORSPreet_patel
 
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROL
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROLLOAD FREQUENCY AND VOLTAGE GENERATION CONTROL
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROLPreet_patel
 
Wind farm planning and commissioning
Wind farm planning and commissioningWind farm planning and commissioning
Wind farm planning and commissioningPreet_patel
 
Rotor Resistance Control and Slip Power Control using Chopper
Rotor Resistance Control and Slip Power Control using ChopperRotor Resistance Control and Slip Power Control using Chopper
Rotor Resistance Control and Slip Power Control using ChopperPreet_patel
 
Transient in Power system
Transient in Power systemTransient in Power system
Transient in Power systemPreet_patel
 
Impulse testing of transformer
Impulse testing of transformerImpulse testing of transformer
Impulse testing of transformerPreet_patel
 
Three Phase Separately Exited Drives
Three Phase Separately Exited DrivesThree Phase Separately Exited Drives
Three Phase Separately Exited DrivesPreet_patel
 
Signal Flow Graph
Signal Flow GraphSignal Flow Graph
Signal Flow GraphPreet_patel
 
MMF for Airgap and Tooth
MMF for Airgap and ToothMMF for Airgap and Tooth
MMF for Airgap and ToothPreet_patel
 
Special transformers
Special transformersSpecial transformers
Special transformersPreet_patel
 
WITRICITY FIELD THEORY
WITRICITY FIELD THEORYWITRICITY FIELD THEORY
WITRICITY FIELD THEORYPreet_patel
 
State table and characteristic equation for sequential circuit
State table and characteristic equation for sequential circuitState table and characteristic equation for sequential circuit
State table and characteristic equation for sequential circuitPreet_patel
 
Phase locked loop
Phase locked loopPhase locked loop
Phase locked loopPreet_patel
 
Garodiya survey
Garodiya survey Garodiya survey
Garodiya survey Preet_patel
 
Static and dynamic personality
Static and dynamic personalityStatic and dynamic personality
Static and dynamic personalityPreet_patel
 
who is a contributor...?
who is a contributor...?who is a contributor...?
who is a contributor...?Preet_patel
 

Mais de Preet_patel (19)

DESIGN OF TURBO ALTERNATORS
DESIGN OF TURBO ALTERNATORSDESIGN OF TURBO ALTERNATORS
DESIGN OF TURBO ALTERNATORS
 
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROL
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROLLOAD FREQUENCY AND VOLTAGE GENERATION CONTROL
LOAD FREQUENCY AND VOLTAGE GENERATION CONTROL
 
Wind farm planning and commissioning
Wind farm planning and commissioningWind farm planning and commissioning
Wind farm planning and commissioning
 
Rotor Resistance Control and Slip Power Control using Chopper
Rotor Resistance Control and Slip Power Control using ChopperRotor Resistance Control and Slip Power Control using Chopper
Rotor Resistance Control and Slip Power Control using Chopper
 
Transient in Power system
Transient in Power systemTransient in Power system
Transient in Power system
 
Impulse testing of transformer
Impulse testing of transformerImpulse testing of transformer
Impulse testing of transformer
 
Three Phase Separately Exited Drives
Three Phase Separately Exited DrivesThree Phase Separately Exited Drives
Three Phase Separately Exited Drives
 
Ac distribution
Ac distributionAc distribution
Ac distribution
 
Signal Flow Graph
Signal Flow GraphSignal Flow Graph
Signal Flow Graph
 
MMF for Airgap and Tooth
MMF for Airgap and ToothMMF for Airgap and Tooth
MMF for Airgap and Tooth
 
Special transformers
Special transformersSpecial transformers
Special transformers
 
WITRICITY FIELD THEORY
WITRICITY FIELD THEORYWITRICITY FIELD THEORY
WITRICITY FIELD THEORY
 
State table and characteristic equation for sequential circuit
State table and characteristic equation for sequential circuitState table and characteristic equation for sequential circuit
State table and characteristic equation for sequential circuit
 
Cost and BEA
Cost and BEACost and BEA
Cost and BEA
 
Phase locked loop
Phase locked loopPhase locked loop
Phase locked loop
 
Garodiya survey
Garodiya survey Garodiya survey
Garodiya survey
 
Cpd ch 3
Cpd ch 3Cpd ch 3
Cpd ch 3
 
Static and dynamic personality
Static and dynamic personalityStatic and dynamic personality
Static and dynamic personality
 
who is a contributor...?
who is a contributor...?who is a contributor...?
who is a contributor...?
 

Último

Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 

Último (20)

Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 

Magnitude comparator

  • 2. Magnitude Comparator • A magnitude digital comparator is a combinational circuit that compares two digital or binary numbers (consider A and B) and determines their relative magnitudes in order to find out whether one number is equal, less than or greater than the other digital number. • Three binary variables are used to indicate the outcome of the comparison as A>B, A<B, or A=B. The below figure shows the block diagram of a n-bit comparator which compares the two numbers of n-bit length and generates their relation between themselves.
  • 3. Magnitude comparator is a combinational circuit that compares two numbers and determines their relative magnitude. A comparator is shown as Figure 2.1. The output of comparator is usually 3 binary variables indicating: A>B A=B A<B LOGIC DESIGN PROCEDURE A>B A=B A<B Comparator A B
  • 4. For a 2-bit comparator, we have four inputs A1A0 and B1B0 and three outputs: E (is 1 if two numbers are equal) G (is 1 when A > B) and L (is 1 when A < B) G(A>B) E(A=B) L(A<B) Comparator A1 B1 A0 B0 LOGIC DESIGN FOR 2-BIT COMPARATOR
  • 5. If we use truth table and K-MAP, the result is E= A’1A’0B’1B’0 + A’1A0B’1B0 + A1A0B1B0 + A1A’0B1B’0 or E=(( A0 ⊕ B0) + ( A1 ⊕ B1))’ G = A1B’1 + A0B’1B’0 + A1A0B’0 L= A’1B1 + A’1A’0B0 + A’0B1B0 Here we use simpler method to find E (called X) and G (called Y) and L (called Z) CASE 1: A=B if all Ai= Bi It means X0 = A0B0 + A’0B’0 and X1= A1B1 + A’1B’1 If X0=1 and X1=1 then A0=B0 and A1=B1 Thus, if A=B then X0X1 = 1 it means X= (A0B0 + A’0B’0)(A1B1 + A’1B’1) since (x ⊕ y)’ = (xy +x’y’) X= ( A0⊕B0)’ ( A1⊕B1)’ = (( A0 ⊕ B0) + ( A1 ⊕ B1))’ It means for X we can NOR the result of two exclusive-OR gates. RESULT Ai Bi Xi 0 0 1 0 1 0 1 0 0 1 1 0
  • 6. CASE 2: A>B means If A1=B1 (X1=1) then A0 should be 1 and B0 should be 0 For A> B: A1 > B1 or A1 =B1 and A0 > B0 It means Y= A1B’1 + X1A0B’0 should be 1 for A> B. CASE 3: For B>A : B1 > A1 A1=B1 and B0> A0 Z= A’1B1 + X1A’0B0 A1 B1 Y1 0 0 0 0 1 0 1 0 1 1 1 0 A0 B0 Y0 0 0 1 0 1 0 1 0 0 1 1 0
  • 7. 4-BIT COMPARATOR The procedure for binary numbers with more than 2 bits can also be found in the similar way. Figure shows the 4-bit magnitude comparator. Input: A=A3A2A1A0 B=B3B2B1B0 A3 B3 x3 A2 B2 x2 A1 B1 x1 A0 B0 x0 (A<B) (A>B) (A=B) 4-Bit Magnitude Comparator
  • 8. CASE 1: A=B A3=B3, A2=B2, A1=B1, A0=B0 xi = AiBi + Ai’Bi’ XOR-Invert = (AiBi’+Ai’Bi)’ = (Ai’+Bi)(Ai+Bi’) = Ai’Ai + Ai’Bi’ + AiBi + BiBi’ = AiBi + Ai’Bi’ Output: X3X2X1X0 CASE 2: A>B Output: A3B’3 + X3A2B’2 + X3X2A1B’1+ X3X2X1A0B’0 CASE 3: A<B Output: A’3B3 + X3A’2B2 + X3X2A’1B1+ X3X2X1A’0B0
  • 9. Truth table of 4-Bit Comparator COMPARING INPUTS OUTPUT A3, B3 A2, B2 A1, B1 A0, B0 A > B A < B A = B A3 > B3 X X X H L L A3 < B3 X X X L H L A3 = B3 A2 >B2 X X H L L A3 = B3 A2 < B2 X X L H L A3 = B3 A2 = B2 A1 > B1 X H L L A3 = B3 A2 = B2 A1 < B1 X L H L A3 = B3 A2 = B2 A1 = B1 A0 > B0 H L L A3 = B3 A2 = B2 A1 = B1 A0 < B0 L H L A3 = B3 A2 = B2 A1 = B1 A0 = B0 H L L A3 = B3 A2 = B2 A1 = B1 A0 = B0 L H L A3 = B3 A2 = B2 A1 = B1 A0 = B0 L L H H = High Voltage Level, L = Low Voltage, Level, X = Don’t Care
  • 10. Applications of Comparators • These are used in the address decoding circuitry in computers and microprocessor based devices to select a specific input/output device for the storage of data. • 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. Then the outputs from the comparator are used to drive the actuators so as to make the physical variables closest to the set or reference value. • Process controllers • Servo-motor control