Introduction to logic

George Boole,
(1815-1864)
•
To understand the functions of
logic gates.
•
To apply gained knowledge to
use logic gate
•
To understand truth tables
Did you know?
George Boole Inventor of the idea of logic
gates. He was born in Lincoln, England and
he was the son of a shoemaker in a low class
family.
Why are we learning about logic
gates?
A logic gate is a digital circuit which either allows a signal to pass
through it or to stop it.
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
NOT
GATE
OR
AND
GATE
GATE
?Logic
!
Did you know?
Logic gates allow the computer to do
things such as add, divide, multiply, do
simple yes and no reasoning in certain
situations along with other things.
Input
OR
GATE
Input
Output
FRONT DOORBELL
SWITCH
An OR gate can have two or more
inputs.
The output will be positive (True) if
at least one input is true.
OR
GATE
BACK DOORBELL
SWITCH
DOORBELL
Input
AND
GATE
Input
An AND gate can have two or more
inputs.
The output will be positive (true)
Output when both inputs (the input one
AND the input two) are positive
(true).
PERSON SENSOR
AND
GATE
ON SWITCH
c
FOR ALARM
BURGLAR ALARM
ON or OFF ?
BEDROOM
SENSOR
OR
GATE
FRONT ROOM
SENSOR
AND
GATE
ON SWITCH
FOR ALARM
BURGLAR
ALARM
A NOT gate (inverter) has only
one input.
It reverses the logic state.
NOT
GATE
Input
HEAT DETECTOR
(ABOVE 20 C)
Output
NOT
GATE
CENTRAL
HEATING
Is the Final Output ON (True)
or OFF (false) ?
OR
GATE
AND
GATE
AND
NOT
GATE
GATE
FINAL
OUTPUT
ON ? OFF ?
http://www.bbc.co.uk/education/guides/zc4bb
9q/revision/2
Name the logic gates. Test it by answering True
or false (Yes or No) for each Input.
Good dancer
?
?
Good at sport
?
Blue eyes
Has a big nose
?
YES,
She/He is
OK
By writing your own things in the Input boxes. You can choose the logic
gates you have learnt. Name the logic gates. Test the Chooser by
answering Yes or Not ( True or false ).
YES,
She/He is
OK
http://logic.ly/demo/
4.
1.
ON
OFF
ON
OFF
?
ON
?
5.
2.
ON
OFF
ON
?
ON
6.
OFF
ON
OFF
3.
ON
OFF
OFF
?
?
The output is
ON or OFF ?
?
7.
OFF
ON
OFF
ON
OFF
?
8.
ON
ON
ON
OFF
ON
?
?
OFF
ON
OFF
9.
ON
ON
ON
ON
ON
ON
10.
?
OFF
ON
The output is
ON or OFF ?
Truth tables
• AND
A
B
0
0
0
1
1
0
1
1
Q
• Can you do a truth table for an OR and NOT and XOR
Complex logic gates
and truth tables
A
B
C
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
D = NOT A
E = B AND C Z = D OR E