SlideShare a Scribd company logo
Binary Arithmetic
• Adding Binary numbers
• Overflow conditions
• How does it all work?
• AND, OR and NOT
Decimal Addition
• You are probably already familiar with adding
decimal numbers
7
+2
9
5
+1
6
2
+3
5
• You also know that when the addition of two
numbers exceeds the base, a value is “carried” over
to the next column
7
+ 5
1 2
1 Carry the “1”
Binary Addition
• Adding binary numbers employs the same
procedures as adding decimal numbers:
00
+00
00
01
+00
01
00
+01
01
• As with decimal addition, when the addition of two
numbers exceeds the base value, the value is
“carried” over to the next column
01
+01
10
1 Carry the “1”
Binary Addition Examples
01001100
01101010
10110110
11001100
00110011
11111111
01111111
00000001
10000000
• What happens when we have the following case?
11
+11
???
1 Carry the “1”
More Binary Addition Examples
01111111
01000001
11000000
10001100
00111011
11000111
01111111
01001001
11001000
11111111
00000001
????????
• What happens when we get the following case?
(note: assume that we are limited to 8 bits)
Overflow
11111111
00000001
00000000
• In the following case, we have a condition called
“overflow”. The result may be somewhat unexpected
1 Carry the “1”
• When adding two numbers, it is possible that the
result will not fit within the space we have provided.
The addition completes, but part of the value is lost.
• Luckily, overflow is often considered to be an error
condition, so the program “knows” that this has
happened and can take appropriate action.
How does it all work?
• In the first week of lectures, we discussed vacuum
tubes, relays, and transistors
• As we went through the discussion, I asked, “How
could you add two numbers using switches?”
• I didn’t expect an answer, but I did show how switches
could be set up to implement the AND function and the
OR function.
AND, OR and NOT
• You may recall the “truth” tables for the AND and OR
functions:
0 1
0 0 0
1 0 1
0 1
0 0 1
1 1 1
A
B
A
B
AND OR
• The AND, OR and NOT functions are the basic
functions for “Boolean” Algebra
0 1
1 0
A
NOT (~)
Binary Arithmetic/AND and OR
• All binary arithmetic can be represented using
boolean algebra
• Each 1-bit adder has 3 inputs: A, B and CarryIn
• Each 1-bit adder has 2 output: C and CarryOut
CIN 0 0 0 0 1 1 1 1
A 0 0 1 1 0 0 1 1
B 0 1 0 1 0 1 0 1
C 0 1 1 0 1 0 0 1
COUT 0 0 0 1 0 1 1 1
Boolean Equations for Addition
CIN 0 0 0 0 1 1 1 1
A 0 0 1 1 0 0 1 1
B 0 1 0 1 0 1 0 1
C 0 1 1 0 1 0 0 1
COUT 0 0 0 1 0 1 1 1
C = (~A and B and ~CIN) or (A and ~B and ~CIN) or
(~A and ~B and CIN) or (A and B and CIN)
COUT= (A and B) or (A and CIN) or (B and CIN)

More Related Content

Similar to 5941981.ppt

09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
Lee Chadwick
 
Presentacion2
Presentacion2Presentacion2
Presentacion2ayreonmx
 
tCh10.ppt
tCh10.ppttCh10.ppt
basic_gates.ppt
basic_gates.pptbasic_gates.ppt
basic_gates.ppt
ssuser015d541
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
Boolean+logic
Boolean+logicBoolean+logic
Boolean+logic
Bilal Maqbool ツ
 
Alu1
Alu1Alu1
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ravi Kumar
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAV
Deepak Yadav
 
Binary codes
Binary codesBinary codes
Binary codes
ZareenRauf1
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
AmirthavalliR
 
Binary operations
 Binary operations Binary operations
Binary operations
NicolaMorris21
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
umerfarooq648026
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
Edhole.com
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
Edhole.com
 
L1 - Logic Gate & Truth Tables - student.pdf
L1 - Logic Gate & Truth Tables - student.pdfL1 - Logic Gate & Truth Tables - student.pdf
L1 - Logic Gate & Truth Tables - student.pdf
lcabey
 
logic gates ppt.pptx
logic gates ppt.pptxlogic gates ppt.pptx
logic gates ppt.pptx
vijayapraba1
 

Similar to 5941981.ppt (20)

09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
Presentacion2
Presentacion2Presentacion2
Presentacion2
 
tCh10.ppt
tCh10.ppttCh10.ppt
tCh10.ppt
 
basic_gates.ppt
basic_gates.pptbasic_gates.ppt
basic_gates.ppt
 
Adders
AddersAdders
Adders
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
 
Boolean+logic
Boolean+logicBoolean+logic
Boolean+logic
 
Alu1
Alu1Alu1
Alu1
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
LOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAVLOGIC GATES - SARTHAK YADAV
LOGIC GATES - SARTHAK YADAV
 
Binary codes
Binary codesBinary codes
Binary codes
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
 
Binary operations
 Binary operations Binary operations
Binary operations
 
LEC 1.pptx
LEC 1.pptxLEC 1.pptx
LEC 1.pptx
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
Top schools in delhi ncr
Top schools in delhi ncrTop schools in delhi ncr
Top schools in delhi ncr
 
L1 - Logic Gate & Truth Tables - student.pdf
L1 - Logic Gate & Truth Tables - student.pdfL1 - Logic Gate & Truth Tables - student.pdf
L1 - Logic Gate & Truth Tables - student.pdf
 
logic gates ppt.pptx
logic gates ppt.pptxlogic gates ppt.pptx
logic gates ppt.pptx
 

More from samaghorab

Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
samaghorab
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
samaghorab
 
Lec_1_Integration.ppt
Lec_1_Integration.pptLec_1_Integration.ppt
Lec_1_Integration.ppt
samaghorab
 
L2Web.pptx
L2Web.pptxL2Web.pptx
L2Web.pptx
samaghorab
 
Chapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfChapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdf
samaghorab
 
L6.pdf
L6.pdfL6.pdf
L6.pdf
samaghorab
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
samaghorab
 
Intro_to_data_base.pdf
Intro_to_data_base.pdfIntro_to_data_base.pdf
Intro_to_data_base.pdf
samaghorab
 
programs+ifelse&+for.pptx
programs+ifelse&+for.pptxprograms+ifelse&+for.pptx
programs+ifelse&+for.pptx
samaghorab
 
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptxBioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
samaghorab
 
Python_Session05_Homeworkquestions.pptx
Python_Session05_Homeworkquestions.pptxPython_Session05_Homeworkquestions.pptx
Python_Session05_Homeworkquestions.pptx
samaghorab
 

More from samaghorab (11)

Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
 
Lec_1_Integration.ppt
Lec_1_Integration.pptLec_1_Integration.ppt
Lec_1_Integration.ppt
 
L2Web.pptx
L2Web.pptxL2Web.pptx
L2Web.pptx
 
Chapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdfChapter+3+-+Normalization.pdf
Chapter+3+-+Normalization.pdf
 
L6.pdf
L6.pdfL6.pdf
L6.pdf
 
Lecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdfLecture-1-2-+(1).pdf
Lecture-1-2-+(1).pdf
 
Intro_to_data_base.pdf
Intro_to_data_base.pdfIntro_to_data_base.pdf
Intro_to_data_base.pdf
 
programs+ifelse&+for.pptx
programs+ifelse&+for.pptxprograms+ifelse&+for.pptx
programs+ifelse&+for.pptx
 
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptxBioinformatics-Lec+4-DNADamage-and-Repair.pptx
Bioinformatics-Lec+4-DNADamage-and-Repair.pptx
 
Python_Session05_Homeworkquestions.pptx
Python_Session05_Homeworkquestions.pptxPython_Session05_Homeworkquestions.pptx
Python_Session05_Homeworkquestions.pptx
 

Recently uploaded

一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
pchutichetpong
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
nscud
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
yhkoc
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
FP Growth Algorithm and its Applications
FP Growth Algorithm and its ApplicationsFP Growth Algorithm and its Applications
FP Growth Algorithm and its Applications
MaleehaSheikh2
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
ewymefz
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 

Recently uploaded (20)

一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
Data Centers - Striving Within A Narrow Range - Research Report - MCG - May 2...
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
FP Growth Algorithm and its Applications
FP Growth Algorithm and its ApplicationsFP Growth Algorithm and its Applications
FP Growth Algorithm and its Applications
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 

5941981.ppt

  • 1. Binary Arithmetic • Adding Binary numbers • Overflow conditions • How does it all work? • AND, OR and NOT
  • 2. Decimal Addition • You are probably already familiar with adding decimal numbers 7 +2 9 5 +1 6 2 +3 5 • You also know that when the addition of two numbers exceeds the base, a value is “carried” over to the next column 7 + 5 1 2 1 Carry the “1”
  • 3. Binary Addition • Adding binary numbers employs the same procedures as adding decimal numbers: 00 +00 00 01 +00 01 00 +01 01 • As with decimal addition, when the addition of two numbers exceeds the base value, the value is “carried” over to the next column 01 +01 10 1 Carry the “1”
  • 4. Binary Addition Examples 01001100 01101010 10110110 11001100 00110011 11111111 01111111 00000001 10000000 • What happens when we have the following case? 11 +11 ??? 1 Carry the “1”
  • 5. More Binary Addition Examples 01111111 01000001 11000000 10001100 00111011 11000111 01111111 01001001 11001000 11111111 00000001 ???????? • What happens when we get the following case? (note: assume that we are limited to 8 bits)
  • 6. Overflow 11111111 00000001 00000000 • In the following case, we have a condition called “overflow”. The result may be somewhat unexpected 1 Carry the “1” • When adding two numbers, it is possible that the result will not fit within the space we have provided. The addition completes, but part of the value is lost. • Luckily, overflow is often considered to be an error condition, so the program “knows” that this has happened and can take appropriate action.
  • 7. How does it all work? • In the first week of lectures, we discussed vacuum tubes, relays, and transistors • As we went through the discussion, I asked, “How could you add two numbers using switches?” • I didn’t expect an answer, but I did show how switches could be set up to implement the AND function and the OR function.
  • 8. AND, OR and NOT • You may recall the “truth” tables for the AND and OR functions: 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 1 A B A B AND OR • The AND, OR and NOT functions are the basic functions for “Boolean” Algebra 0 1 1 0 A NOT (~)
  • 9. Binary Arithmetic/AND and OR • All binary arithmetic can be represented using boolean algebra • Each 1-bit adder has 3 inputs: A, B and CarryIn • Each 1-bit adder has 2 output: C and CarryOut CIN 0 0 0 0 1 1 1 1 A 0 0 1 1 0 0 1 1 B 0 1 0 1 0 1 0 1 C 0 1 1 0 1 0 0 1 COUT 0 0 0 1 0 1 1 1
  • 10. Boolean Equations for Addition CIN 0 0 0 0 1 1 1 1 A 0 0 1 1 0 0 1 1 B 0 1 0 1 0 1 0 1 C 0 1 1 0 1 0 0 1 COUT 0 0 0 1 0 1 1 1 C = (~A and B and ~CIN) or (A and ~B and ~CIN) or (~A and ~B and CIN) or (A and B and CIN) COUT= (A and B) or (A and CIN) or (B and CIN)