SlideShare a Scribd company logo
1 of 12
2-Bit Comparator
Introduction 
• In this report it is clearly illustrated how to 
design a 2-bit comparator circuit. 
• It is also reported how we simplified the 
design to use the least number of ICs. 
• Design had been successfully tested by 
proteus simulation software. 
•The result is displayed on a 7- segment.
Problem Declaration 
• It is desired to design and implement a logic 
circuit that accepts two numbers each has two 
bits A0 A1 & B0 B1 and compare between them. 
• If A < B Print g (for greater). 
• If A > B Print L (for lower). 
• If A = B Print E (for equal). 
• The output should be displayed on a 7- segment.
Design 
• The first step to design any combinational circuit is constructing 
the truth table. 
A0 A1 
0 0 
0 0 
0 0 
0 0 
0 1 
0 1 
0 1 
0 1 
1 0 
1 0 
1 0 
1 0 
1 1 
1 1 
1 1 
1 1 
B0 B1 
0 0 
0 1 
1 0 
1 1 
0 0 
0 1 
1 0 
1 1 
0 0 
0 1 
1 0 
1 1 
0 0 
0 1 
1 0 
1 1 
g 
0 
0 
0 
0 
1 
0 
0 
0 
1 
1 
0 
0 
1 
1 
1 
0 
L 
0 
1 
1 
1 
0 
0 
1 
1 
0 
0 
0 
1 
0 
0 
0 
0 
E 
1 
0 
0 
0 
0 
1 
0 
0 
0 
0 
1 
0 
0 
0 
0 
1 
Q 
0 
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15
Design 
• Now we want to get the functions g , L and E . 
• So that we have to construct a 4x16 decoder. 
• But the available decoder ICs are 3x8 decoders. 
• The connection shown in fig1. is used to 
construct a 4x16 decoder by 2 ICs of 3x8 decoders. 
• Fig.1
Design 
• Minimum term algorithm is used to represent the 
desired logic functions designed in the truth table. 
• g = Q4 + Q8 + Q9 + Q12 + Q13 + Q14. 
• L = Q1 +Q2 + Q3 + Q6 +Q7 + Q11 
• E = Q0 + Q5 + Q10 + Q15 
• To implement those functions the decoder output 
corresponding to every functions must be applied to OR 
gates.
Design 
• But we should take in consideration that the outputs of 
the decoder are reversed . 
• DE Morgan theorem is used to solve this problem . 
B A B A F    
g Q Q Q Q Q Q 
4. 8. 9. 12. 13. 14 
 
L Q Q Q Q Q Q 
1. 2. 3. 6. 7. 11 
 
E Q Q Q Q 
0. 5. 10. 15 
 
• Now we can implement g , L &E by applying the corresponding 
decoder output of each function to NAND gates .
Display 
• A 7-segment is used for displaying the result. 
• The following table shows events at which every 
segment should light up. 
segment A B C D E F G 
events G 
E 
g g L 
G 
E 
L 
E 
L 
G 
E 
G 
E 
• According to this table every segment should be connected to 
an OR gate that collects its corresponding events. 
• OR gates are not available , so that we have to use NOR 
gates in addition to not gates .
Display 
• Instead of this ,a simplification of special kind can limit the 
usage of gates. 
• Let us consider that we are making a random experiment by 
inserting a random values of A0A1 & B0B1. 
• The output of the experiment is a signal g or L or E. 
• As shown in the figure sample space consists of three 
independent events , in another word there is no 
intersection between any two events. 
• This property is very useful as a simple 
simplification can be done using probability 
theorem and then we can convert the result into 
boolean expression. 
E 
L 
g 
Sample space
Display 
pins Boolean 
function 
Probability 
equivalent 
simplification Boolean 
equivalent 
E g  
a & g g + E 1 - L 
e L + E 1 - g 
d & f g+E+L 1 Vcc 
Sample space 
L 
E L  g 
g LE 
Sample space Sample space
Display 
• The following table shows the final 7-segment pins connection. 
pins a b c d e f g 
connection g g Vcc Vcc L L g 
• The result shows that the implementation of the function E is 
needless. 
• It is also obvious that the simplification step made us in rich of 
designing and implementing a driver circuit for the 7- segment 
display.
2-bit comparator

More Related Content

What's hot

Registers and counters
Registers and counters Registers and counters
Registers and counters
Deepak John
 

What's hot (20)

Counters
CountersCounters
Counters
 
Decoders
DecodersDecoders
Decoders
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & Decoder
 
encoder and decoder in digital electronics
encoder and decoder in digital electronicsencoder and decoder in digital electronics
encoder and decoder in digital electronics
 
Nand gate
Nand gateNand gate
Nand gate
 
D and T Flip Flop
D and T Flip FlopD and T Flip Flop
D and T Flip Flop
 
Registers and counters
Registers and counters Registers and counters
Registers and counters
 
Lab 4 Three-Bit Binary Adder
Lab 4 Three-Bit Binary AdderLab 4 Three-Bit Binary Adder
Lab 4 Three-Bit Binary Adder
 
multiplexers and demultiplexers
 multiplexers and demultiplexers multiplexers and demultiplexers
multiplexers and demultiplexers
 
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
 
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed KhanDigital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan
 
Logic gates for seminar purpose and easy to understand
Logic gates for seminar purpose and easy to understandLogic gates for seminar purpose and easy to understand
Logic gates for seminar purpose and easy to understand
 
SEQUENTIAL CIRCUITS [Flip-flops and Latches]
SEQUENTIAL CIRCUITS [Flip-flops and Latches]SEQUENTIAL CIRCUITS [Flip-flops and Latches]
SEQUENTIAL CIRCUITS [Flip-flops and Latches]
 
Asynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 pptAsynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 ppt
 
Lab 3 Multi-Function Gate
Lab 3   Multi-Function GateLab 3   Multi-Function Gate
Lab 3 Multi-Function Gate
 
Dld
DldDld
Dld
 
Sequential circuits in Digital Electronics
Sequential circuits in Digital ElectronicsSequential circuits in Digital Electronics
Sequential circuits in Digital Electronics
 
decoder and encoder
 decoder and encoder decoder and encoder
decoder and encoder
 
Data flow model -Lecture-4
Data flow model -Lecture-4Data flow model -Lecture-4
Data flow model -Lecture-4
 
Confusion Matrix Explained
Confusion Matrix ExplainedConfusion Matrix Explained
Confusion Matrix Explained
 

Similar to 2-bit comparator

Similar to 2-bit comparator (20)

2-bit comparator
2-bit comparator2-bit comparator
2-bit comparator
 
Computer Organization And Architecture lab manual
Computer Organization And Architecture lab manualComputer Organization And Architecture lab manual
Computer Organization And Architecture lab manual
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
 
Digital 4-bit Comprator
Digital 4-bit CompratorDigital 4-bit Comprator
Digital 4-bit Comprator
 
Digital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic ProbeDigital Logic Design basic gate and Logic Probe
Digital Logic Design basic gate and Logic Probe
 
Bds lab 4
Bds lab 4Bds lab 4
Bds lab 4
 
Design of chip controller
Design of chip controllerDesign of chip controller
Design of chip controller
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices
 
Combinational logic
Combinational logicCombinational logic
Combinational logic
 
Combinational circuit
Combinational circuitCombinational circuit
Combinational circuit
 
Deld lab manual
Deld lab manualDeld lab manual
Deld lab manual
 
Assignment#4b
Assignment#4bAssignment#4b
Assignment#4b
 
combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...
 
combinational-circuit presenmtation .ppt
combinational-circuit presenmtation .pptcombinational-circuit presenmtation .ppt
combinational-circuit presenmtation .ppt
 
combinational-circuit.ppt
combinational-circuit.pptcombinational-circuit.ppt
combinational-circuit.ppt
 
combinational circuits dispositivos .ppt
combinational circuits dispositivos .pptcombinational circuits dispositivos .ppt
combinational circuits dispositivos .ppt
 
Digital electronics lab
Digital electronics labDigital electronics lab
Digital electronics lab
 
Combinational Ckt.pdf
Combinational Ckt.pdfCombinational Ckt.pdf
Combinational Ckt.pdf
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
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
Neometrix_Engineering_Pvt_Ltd
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Recently uploaded (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
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
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
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
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 

2-bit comparator

  • 2. Introduction • In this report it is clearly illustrated how to design a 2-bit comparator circuit. • It is also reported how we simplified the design to use the least number of ICs. • Design had been successfully tested by proteus simulation software. •The result is displayed on a 7- segment.
  • 3. Problem Declaration • It is desired to design and implement a logic circuit that accepts two numbers each has two bits A0 A1 & B0 B1 and compare between them. • If A < B Print g (for greater). • If A > B Print L (for lower). • If A = B Print E (for equal). • The output should be displayed on a 7- segment.
  • 4. Design • The first step to design any combinational circuit is constructing the truth table. A0 A1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 B0 B1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 g 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0 L 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 E 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 Q 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  • 5. Design • Now we want to get the functions g , L and E . • So that we have to construct a 4x16 decoder. • But the available decoder ICs are 3x8 decoders. • The connection shown in fig1. is used to construct a 4x16 decoder by 2 ICs of 3x8 decoders. • Fig.1
  • 6. Design • Minimum term algorithm is used to represent the desired logic functions designed in the truth table. • g = Q4 + Q8 + Q9 + Q12 + Q13 + Q14. • L = Q1 +Q2 + Q3 + Q6 +Q7 + Q11 • E = Q0 + Q5 + Q10 + Q15 • To implement those functions the decoder output corresponding to every functions must be applied to OR gates.
  • 7. Design • But we should take in consideration that the outputs of the decoder are reversed . • DE Morgan theorem is used to solve this problem . B A B A F    g Q Q Q Q Q Q 4. 8. 9. 12. 13. 14  L Q Q Q Q Q Q 1. 2. 3. 6. 7. 11  E Q Q Q Q 0. 5. 10. 15  • Now we can implement g , L &E by applying the corresponding decoder output of each function to NAND gates .
  • 8. Display • A 7-segment is used for displaying the result. • The following table shows events at which every segment should light up. segment A B C D E F G events G E g g L G E L E L G E G E • According to this table every segment should be connected to an OR gate that collects its corresponding events. • OR gates are not available , so that we have to use NOR gates in addition to not gates .
  • 9. Display • Instead of this ,a simplification of special kind can limit the usage of gates. • Let us consider that we are making a random experiment by inserting a random values of A0A1 & B0B1. • The output of the experiment is a signal g or L or E. • As shown in the figure sample space consists of three independent events , in another word there is no intersection between any two events. • This property is very useful as a simple simplification can be done using probability theorem and then we can convert the result into boolean expression. E L g Sample space
  • 10. Display pins Boolean function Probability equivalent simplification Boolean equivalent E g  a & g g + E 1 - L e L + E 1 - g d & f g+E+L 1 Vcc Sample space L E L  g g LE Sample space Sample space
  • 11. Display • The following table shows the final 7-segment pins connection. pins a b c d e f g connection g g Vcc Vcc L L g • The result shows that the implementation of the function E is needless. • It is also obvious that the simplification step made us in rich of designing and implementing a driver circuit for the 7- segment display.