SlideShare a Scribd company logo
1 of 34
Boolean Algebra
Logic Gates
Basic logic gates
• NOT
• AND
• OR
• NAND
• NOR
• XOR
x
x
y
x
y
x
y
x
y
x
y
x
xy x
y
xyz
z
xy x
y
z
x+y+z
xy
xy
xy
The AND gate
The OR gate
The NOT gate (or inverter)
A logic buffer gate
The NAND gate
The NOR gate
The Exclusive OR gate
The Exclusive NOR gate
Boolean Algebra
• Boolean Constants
– these are ‘0’ (false) and ‘1’ (true)
• Boolean Variables
– variables that can only take the vales ‘0’ or ‘1’
• Boolean Functions
– each of the logic functions (such as AND, OR and NOT)
are represented by symbols as described above
• Boolean Theorems
– a set of identities and laws – see text for details
Boolean laws
AB  BA
A B  B  A
A(BC)ABBC
ABC(AB)(AC)
A(BC) (AB)C
A(BC) (AB)C
A  AB  A
A(A  B)  A
AB  AB
AB  AB
AAB  AB
A(AB)  AB
OR Gate
Current flows if either switch is closed
– Logic notation A + B = C
A B C
0 0 0
0 1 1
1 0 1
1 1 1
AND Gate
In order for current to flow, both switches must
be closed
– Logic notation AB = C
(Sometimes AB = C)
A B C
0 0 0
0 1 0
1 0 0
1 1 1
Properties of AND and OR
• Commutation
o A + B = B + A
o A  B = B  A
Same as
Same as
Commutation Circuit
A + B B + A
A  B B  A
Properties of AND and OR
• Associative Property
A + (B + C) = (A + B) + C
A  (B  C) = (A  B)  C
=
Distributive Property
(A + B)  (A + C)
4/30/2018
Pavithran Puthiyap
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
urayil1
, Maldives 1 1 1
National University
18
Binary Addition
A B S C(arry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
Notice that the carry results are the same as AND
C = A  B
Inversion (NOT)
A Q
0 1
1 0
Logic: Q  A
Circuit for XOR
A B  A B  A B
Accumulating our results: Binary addition is the
result of XOR plus AND
Converting between circuits and equations
• Find the output of the following circuit
• Answer: (x+y)y
x
x
y
y
y
x+y
y
(x+y)y
Or (xy)y
x
y
Converting between circuits and equations
• Find the output of the following circuit
• Answer: xy
x
y
x y x y
_ _
Or (xy) ≡ x
Py
avithran Puthiyapurayil , Maldives
National University
Converting between circuits and equations
• Write the circuits for the following Boolean
algebraic expressions
a) x+y
x
y
x x+y
x
x
y
y
Converting between circuits and equations
• Write the circuits for the following Boolean
algebraic expressions
b) (x+y)x
x+y
x+y (x+y)x
Writing xor using and/or/not
• p  q  (p  q)  ¬(p  q)
• x  y  (x + y)(xy)
x y xy
1 1 0
1 0 1
0 1 1
0 0 0
x
y
x+y
xy xy
(x+y)(xy)
How to add binary numbers
• Consider adding two 1-bit binary numbers x and y
– 0+0 = 0
– 0+1 = 1
– 1+0 = 1
– 1+1 = 10
• Carry is x AND y
• Sum is x XOR y
• The circuit to compute this is called a half-adder
x y Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
The half-adder
• Sum = x XOR y
• Carry = x AND y
x
y Sum
Carry
x
y Sum
Carry
x y Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Using half adders
• We can then use a half-adder to compute the
sum of two Boolean numbers
1 0 0
1 1 0 0
+ 1 1 1 0
? 0 1 0
How to fix this
• We need to create an adder that can take a carry bit
as an additional input
– Inputs: x, y, carry in
– Outputs: sum, carry out
• This is called a full adder
– Will add x and y with a half-adder
– Will add the sum of that to the
carry in
• What about the carry out?
– It’s 1 if either (or both):
– x+y = 10
– x+y = 01 and carry in = 1
x y c carry sum
1 1 1 1 1
1 1 0 1 0
1 0 1 1 0
1 0 0 0 1
0 1 1 1 0
0 1 0 0 1
0 0 1 0 1
0 0 0 0 0
HA
HA
c
s
HA
X
Y C
HA
X
Y
S
C
c
x
y
The full adder
• The “HA” boxes are
half-adders
x y c s1 c1 carry sum
1 1 1 0 1 1 1
1 1 0 0 1 1 0
1 0 1 1 0 1 0
1 0 0 1 0 0 1
0 1 1 1 0 1 0
0 1 0 1 0 0 1
0 0 1 0 0 0 1
0 0 0 0 0 0 0
s1
S
c1
The full adder
• The full circuitry of the full adder
c
x
y
s
c
Adding bigger binary numbers
• Just chain full adders together
HA
X
Y
FA
C
Y
X
C
FA
C
Y
X
C
FA
C
Y
X
C
x1
y1
x2
y2
x3
y3
x
y
0
0
S
s0
C
S
s1
S
s2
S
s3
c
.
.
.
Adding bigger binary numbers
• A half adder has 4 logic gates
• A full adder has two half adders plus a OR gate
– Total of 9 logic gates
• To add n bit binary numbers, you need 1 HA and n-1
FAs
• To add 32 bit binary numbers, you need 1 HA and 31
FAs
– Total of 4+9*31 = 283 logic gates
• To add 64 bit binary numbers, you need 1 HA and 63
FAs
– Total of 4+9*63 = 571 logic gates

More Related Content

Similar to logic gates ppt.pptx

LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVDeepak Yadav
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Frankie Jones
 
Name dld preparation
Name dld preparationName dld preparation
Name dld preparationPadam Rai
 
B.sc cs-ii-u-1.5 digital logic circuits, digital component
B.sc cs-ii-u-1.5 digital logic circuits, digital componentB.sc cs-ii-u-1.5 digital logic circuits, digital component
B.sc cs-ii-u-1.5 digital logic circuits, digital componentRai University
 
digital logic circuits, digital component
 digital logic circuits, digital component digital logic circuits, digital component
digital logic circuits, digital componentRai University
 
Bca 2nd sem-u-1.5 digital logic circuits, digital component
Bca 2nd sem-u-1.5 digital logic circuits, digital componentBca 2nd sem-u-1.5 digital logic circuits, digital component
Bca 2nd sem-u-1.5 digital logic circuits, digital componentRai University
 
DM2020 boolean algebra
DM2020 boolean algebraDM2020 boolean algebra
DM2020 boolean algebraRobert Geofroy
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.mshoaib15
 
logic gate presentation for and or n.ppt
logic gate presentation for and or n.pptlogic gate presentation for and or n.ppt
logic gate presentation for and or n.pptnaghamallella
 
Lecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptxLecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptxAzeenShahid
 

Similar to logic gates ppt.pptx (20)

Logic gates (2)
Logic gates (2)Logic gates (2)
Logic gates (2)
 
LOGIC CKT.ppt
LOGIC CKT.pptLOGIC CKT.ppt
LOGIC CKT.ppt
 
LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAV
 
Logic Gates (1).ppt
Logic Gates (1).pptLogic Gates (1).ppt
Logic Gates (1).ppt
 
Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)Chapter 2 Boolean Algebra (part 2)
Chapter 2 Boolean Algebra (part 2)
 
Name dld preparation
Name dld preparationName dld preparation
Name dld preparation
 
B.sc cs-ii-u-1.5 digital logic circuits, digital component
B.sc cs-ii-u-1.5 digital logic circuits, digital componentB.sc cs-ii-u-1.5 digital logic circuits, digital component
B.sc cs-ii-u-1.5 digital logic circuits, digital component
 
02-gates-w.pptx
02-gates-w.pptx02-gates-w.pptx
02-gates-w.pptx
 
digital logic circuits, digital component
 digital logic circuits, digital component digital logic circuits, digital component
digital logic circuits, digital component
 
9. logic gates._rr
9. logic gates._rr9. logic gates._rr
9. logic gates._rr
 
2dig circ
2dig circ2dig circ
2dig circ
 
Logicgates
LogicgatesLogicgates
Logicgates
 
Bca 2nd sem-u-1.5 digital logic circuits, digital component
Bca 2nd sem-u-1.5 digital logic circuits, digital componentBca 2nd sem-u-1.5 digital logic circuits, digital component
Bca 2nd sem-u-1.5 digital logic circuits, digital component
 
DM2020 boolean algebra
DM2020 boolean algebraDM2020 boolean algebra
DM2020 boolean algebra
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.
 
Logic Gates
Logic GatesLogic Gates
Logic Gates
 
logic gate presentation for and or n.ppt
logic gate presentation for and or n.pptlogic gate presentation for and or n.ppt
logic gate presentation for and or n.ppt
 
Arithmatic &Logic Unit
Arithmatic &Logic UnitArithmatic &Logic Unit
Arithmatic &Logic Unit
 
Lecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptxLecture 18 M - Copy.pptx
Lecture 18 M - Copy.pptx
 
Logic gates
Logic gatesLogic gates
Logic gates
 

More from vijayapraba1

C10ComputerEngg.pptx
C10ComputerEngg.pptxC10ComputerEngg.pptx
C10ComputerEngg.pptxvijayapraba1
 
apacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfapacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfvijayapraba1
 
HDFS_architecture.ppt
HDFS_architecture.pptHDFS_architecture.ppt
HDFS_architecture.pptvijayapraba1
 
2 Discovery and Acquisition of Data1.pptx
2 Discovery and Acquisition of Data1.pptx2 Discovery and Acquisition of Data1.pptx
2 Discovery and Acquisition of Data1.pptxvijayapraba1
 
C6ModelingTestingFinalOutputs.pptx
C6ModelingTestingFinalOutputs.pptxC6ModelingTestingFinalOutputs.pptx
C6ModelingTestingFinalOutputs.pptxvijayapraba1
 
C3Problems and Brainstorming.ppt
C3Problems and Brainstorming.pptC3Problems and Brainstorming.ppt
C3Problems and Brainstorming.pptvijayapraba1
 
Combinational_Logic_Circuit_PPT.pptx
Combinational_Logic_Circuit_PPT.pptxCombinational_Logic_Circuit_PPT.pptx
Combinational_Logic_Circuit_PPT.pptxvijayapraba1
 
NumberSystems.pptx
NumberSystems.pptxNumberSystems.pptx
NumberSystems.pptxvijayapraba1
 
NumberSystems.pptx
NumberSystems.pptxNumberSystems.pptx
NumberSystems.pptxvijayapraba1
 
logic gates ppt-180430044215.pdf
logic gates ppt-180430044215.pdflogic gates ppt-180430044215.pdf
logic gates ppt-180430044215.pdfvijayapraba1
 
sequential circuits PPT.pdf
sequential circuits PPT.pdfsequential circuits PPT.pdf
sequential circuits PPT.pdfvijayapraba1
 
03_NumberSystems.pdf
03_NumberSystems.pdf03_NumberSystems.pdf
03_NumberSystems.pdfvijayapraba1
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptxvijayapraba1
 

More from vijayapraba1 (16)

HBase.pptx
HBase.pptxHBase.pptx
HBase.pptx
 
C10ComputerEngg.pptx
C10ComputerEngg.pptxC10ComputerEngg.pptx
C10ComputerEngg.pptx
 
apacheairflow-160827123852.pdf
apacheairflow-160827123852.pdfapacheairflow-160827123852.pdf
apacheairflow-160827123852.pdf
 
HDFS_architecture.ppt
HDFS_architecture.pptHDFS_architecture.ppt
HDFS_architecture.ppt
 
2 Discovery and Acquisition of Data1.pptx
2 Discovery and Acquisition of Data1.pptx2 Discovery and Acquisition of Data1.pptx
2 Discovery and Acquisition of Data1.pptx
 
C6ModelingTestingFinalOutputs.pptx
C6ModelingTestingFinalOutputs.pptxC6ModelingTestingFinalOutputs.pptx
C6ModelingTestingFinalOutputs.pptx
 
C3Problems and Brainstorming.ppt
C3Problems and Brainstorming.pptC3Problems and Brainstorming.ppt
C3Problems and Brainstorming.ppt
 
ch13_extsort.ppt
ch13_extsort.pptch13_extsort.ppt
ch13_extsort.ppt
 
Combinational_Logic_Circuit_PPT.pptx
Combinational_Logic_Circuit_PPT.pptxCombinational_Logic_Circuit_PPT.pptx
Combinational_Logic_Circuit_PPT.pptx
 
NumberSystems.pptx
NumberSystems.pptxNumberSystems.pptx
NumberSystems.pptx
 
NumberSystems.pptx
NumberSystems.pptxNumberSystems.pptx
NumberSystems.pptx
 
DA-Module 1.pptx
DA-Module 1.pptxDA-Module 1.pptx
DA-Module 1.pptx
 
logic gates ppt-180430044215.pdf
logic gates ppt-180430044215.pdflogic gates ppt-180430044215.pdf
logic gates ppt-180430044215.pdf
 
sequential circuits PPT.pdf
sequential circuits PPT.pdfsequential circuits PPT.pdf
sequential circuits PPT.pdf
 
03_NumberSystems.pdf
03_NumberSystems.pdf03_NumberSystems.pdf
03_NumberSystems.pdf
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
 

Recently uploaded

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
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
 
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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
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
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
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
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
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
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 

Recently uploaded (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
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
 
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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
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
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
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
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
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...
 
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
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 

logic gates ppt.pptx

  • 2. Basic logic gates • NOT • AND • OR • NAND • NOR • XOR x x y x y x y x y x y x xy x y xyz z xy x y z x+y+z xy xy xy
  • 5. The NOT gate (or inverter)
  • 11. Boolean Algebra • Boolean Constants – these are ‘0’ (false) and ‘1’ (true) • Boolean Variables – variables that can only take the vales ‘0’ or ‘1’ • Boolean Functions – each of the logic functions (such as AND, OR and NOT) are represented by symbols as described above • Boolean Theorems – a set of identities and laws – see text for details
  • 12. Boolean laws AB  BA A B  B  A A(BC)ABBC ABC(AB)(AC) A(BC) (AB)C A(BC) (AB)C A  AB  A A(A  B)  A AB  AB AB  AB AAB  AB A(AB)  AB
  • 13. OR Gate Current flows if either switch is closed – Logic notation A + B = C A B C 0 0 0 0 1 1 1 0 1 1 1 1
  • 14. AND Gate In order for current to flow, both switches must be closed – Logic notation AB = C (Sometimes AB = C) A B C 0 0 0 0 1 0 1 0 0 1 1 1
  • 15. Properties of AND and OR • Commutation o A + B = B + A o A  B = B  A Same as Same as
  • 16. Commutation Circuit A + B B + A A  B B  A
  • 17. Properties of AND and OR • Associative Property A + (B + C) = (A + B) + C A  (B  C) = (A  B)  C =
  • 18. Distributive Property (A + B)  (A + C) 4/30/2018 Pavithran Puthiyap A B C Q 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 urayil1 , Maldives 1 1 1 National University 18
  • 19. Binary Addition A B S C(arry) 0 0 0 0 1 0 1 0 0 1 1 0 1 1 0 1 Notice that the carry results are the same as AND C = A  B
  • 20. Inversion (NOT) A Q 0 1 1 0 Logic: Q  A
  • 21. Circuit for XOR A B  A B  A B Accumulating our results: Binary addition is the result of XOR plus AND
  • 22. Converting between circuits and equations • Find the output of the following circuit • Answer: (x+y)y x x y y y x+y y (x+y)y Or (xy)y
  • 23. x y Converting between circuits and equations • Find the output of the following circuit • Answer: xy x y x y x y _ _ Or (xy) ≡ x Py avithran Puthiyapurayil , Maldives National University
  • 24. Converting between circuits and equations • Write the circuits for the following Boolean algebraic expressions a) x+y x y x x+y
  • 25. x x y y Converting between circuits and equations • Write the circuits for the following Boolean algebraic expressions b) (x+y)x x+y x+y (x+y)x
  • 26. Writing xor using and/or/not • p  q  (p  q)  ¬(p  q) • x  y  (x + y)(xy) x y xy 1 1 0 1 0 1 0 1 1 0 0 0 x y x+y xy xy (x+y)(xy)
  • 27. How to add binary numbers • Consider adding two 1-bit binary numbers x and y – 0+0 = 0 – 0+1 = 1 – 1+0 = 1 – 1+1 = 10 • Carry is x AND y • Sum is x XOR y • The circuit to compute this is called a half-adder x y Carry Sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0
  • 28. The half-adder • Sum = x XOR y • Carry = x AND y x y Sum Carry x y Sum Carry x y Carry Sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0
  • 29. Using half adders • We can then use a half-adder to compute the sum of two Boolean numbers 1 0 0 1 1 0 0 + 1 1 1 0 ? 0 1 0
  • 30. How to fix this • We need to create an adder that can take a carry bit as an additional input – Inputs: x, y, carry in – Outputs: sum, carry out • This is called a full adder – Will add x and y with a half-adder – Will add the sum of that to the carry in • What about the carry out? – It’s 1 if either (or both): – x+y = 10 – x+y = 01 and carry in = 1 x y c carry sum 1 1 1 1 1 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 0 0
  • 31. HA HA c s HA X Y C HA X Y S C c x y The full adder • The “HA” boxes are half-adders x y c s1 c1 carry sum 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 s1 S c1
  • 32. The full adder • The full circuitry of the full adder c x y s c
  • 33. Adding bigger binary numbers • Just chain full adders together HA X Y FA C Y X C FA C Y X C FA C Y X C x1 y1 x2 y2 x3 y3 x y 0 0 S s0 C S s1 S s2 S s3 c . . .
  • 34. Adding bigger binary numbers • A half adder has 4 logic gates • A full adder has two half adders plus a OR gate – Total of 9 logic gates • To add n bit binary numbers, you need 1 HA and n-1 FAs • To add 32 bit binary numbers, you need 1 HA and 31 FAs – Total of 4+9*31 = 283 logic gates • To add 64 bit binary numbers, you need 1 HA and 63 FAs – Total of 4+9*63 = 571 logic gates