Professional Documents
Culture Documents
Learning Outcomes: Eedwards@doc - Ic.ac - Uk
Learning Outcomes: Eedwards@doc - Ic.ac - Uk
Learning Outcomes
At the end of this lecture you should:
understand how logic relates to computing problems
Truth tables
Logic circuits
Eddie Edwards
eedwards@doc.ic.ac.uk
Boolean algebra
be able to produce circuits for the half adder and full adder
http://www.doc.ic.ac.uk/~eedwards/compsys
(Heavily based on notes by Andrew Davison and
Ian Harries)
Computer Systems - Architecture (EEdwards)
What is Logic?
Boolean Logic
the science that investigates the principles governing correct or reliable inference
Branch of philosophy
Principles of inference
0 or 1?
TRUE or FALSE?
YES OR NO?
Ancient civilizations (India the Rigveda, China Gongsun Long 325 BC)
Greek Aristotle (Syllogistic logic)
Modern: John Stuart Mill The science of reasoning, Frege, Russell, Gdel...
10/28/2010
Example 2
Simple Example
Truth table:
Raining
False
Umbrella
False
Raining
False
False
True
True
True
True
True
True
Example 3
Digital Logic
Truth table:
Raining
False
False
True
No Car
False
True
False
Umbrella
False
False
False
True
True
True
NOT
AND
OR
Exclusive OR (XOR)
Also
NOT AND (NAND)
NOT OR (NOR)
10/28/2010
Logic Gates
Digital Logic
Computers operate electronically using Logic Gates
NOT gate:
computers
1 = TRUE
Logic Gates
AND gate:
OR gate:
XOR gate:
10/28/2010
Answer
NOT
AND
OR
Summary
Basic logic gates AND, OR and NOT are enough
Useful to have others - XOR, NAND etc.
Can have more complex gates (e.g, multiple inputs)
NAND gate
(AND followed by NOT)
10/28/2010
AB
A OR B
A XOR B
AB
NOT A
AB
A+B
A&B
AB
There are many rules that can be used for algebraic manipulation
Negation:
Associative:
Commutative:
(A')' = A
(AB)C = A(BC)
AB = BA
AA' = 0
(A+B)+C = A+(B+C)
A+B = B+A
A+A' = 1
AB
A|B
Distributive:
A(B+C) = AB + AC
Single variables:
AA = A
A+A = A
A+0 = A
A+1 = 1
10/28/2010
A B = A B' + A' B
The sum?
Any bit that might carry over?
The half-adder
10/28/2010
The full-adder
Learning Outcomes
10/28/2010