
Unit 10 T3 Boolean Logic part 1
Presentation
•
Professional Development
•
11th Grade
•
Practice Problem
•
Hard
Michael Harrington
FREE Resource
17 Slides • 21 Questions
1
Objectives
• Construct truth tables for the following logic gates:
• NOT, AND, OR
• NAND, NOR
• XOR (EOR)
• Create logic circuits from problem statements, logic
expressions or truth tables
• Complete truth tables from problem statements, logic
expressions or logic circuit
• Write logic expressions from problem statements, logic
circuits or truth tables
2
Multiple Select
Boolean Logic is a difficult topic
There are 2 lessons on this topic
There will be an exam on this topic after the 2 lessons.
How will you ensure you do well in this exam?
Read the text and questions carfully
Go back and Re-read any notes or slides before the question if you are stuck.
Pay attention to any question you get wrong so you know the correct answer for next time.
Just waste time by chatting with your neighbour.
3
Boolean logic
Unit 10 Advanced programming and databases
Starter
• Consider a safe with two keys
• If both keys are used, the safe opens
IF key1 AND key2
THEN
safeOpen <- TRUE
ELSE
safeOpen <- FALSE
ENDIF
• What are the only possible
values that key1 and key2 can be?
• What values must they be to open the safe?
4
Multiple Choice
What are the only possible values that key1 and key2 can be?
Key1 and key2 can only be FALSE ( unlock)
Key1 and key2 can only be TRUE (lock )
Key1 and key2 can only be TRUE or FALSE (lock or unlock)
Key1 and key2 can only be safeOpen = TRUE or safeOpen = FALSE
5
Boolean logic
Unit 10 Advanced programming and databases
Binary situations
• Binary situations are common in
daily life and can refer to things
that can be in only one of two
states:
• Stop or Go
• Pass or Fail
• On or Off
• In computing terms
• A binary 1 can represent TRUE
• A binary 0 can represent FALSE
6
Multiple Choice
What values must they be to open the safe?
They must both be TRUE or FALSE to open the safe
They must both be FALSE to open the safe
They must both be TRUE to open the safe
They must both be the same to open the safe
7
Boolean logic
Unit 10 Advanced programming and databases
Booleans in loops
• Booleans used in IF
statements and loops
WHILE doorOpen
turnOnLight()
ENDWHILE
8
Boolean logic
Unit 10 Advanced programming and databases
True or False?
Unlocking a smartphone:
• using a known fingerprint or
• using a correct PIN code?
IF fingerprint OR correctPIN
THEN
unlock <- TRUE
ELSE
unlock <-FALSE
end if
9
Multiple Choice
What would the first line of code be on bank vault unlock where the manager had to have the correct fingerprint and they should also show they know the PIN code.
IF correctPIN or fingerprint
IF fingerprint AND correctPIN
IF fingerprint OR correctPIN
IF fingerprint XOR correctPIN
10
11
Multiple Choice
What does this circuit diagram represent?
AND
Either switch needs to be down to complete the circuit
OR
Either switch needs to be down to complete the circuit
AND
Both switches must be down to complete the circuit
OR
Both switches must be down to complete the circuit
12
Multiple Choice
What does this circuit diagram represent?
AND
Either switch needs to be down to complete the circuit
OR
Either switch needs to be down to complete the circuit
AND
Both switches must be down to complete the circuit
OR
Both switches must be down to complete the circuit
13
Boolean logic
Unit 10 Advanced programming and databases
Truth tables
• A truth table shows the output from all possible
combinations of inputs from a Boolean expression
• If there are two inputs A AND B, there are four possible
combinations of TRUE and FALSE
• Both A and B must be True for the output to be True
Input A
Input B
A AND B
False
False
False
False
True
False
True
False
False
True
True
True
14
15
Multiple Choice
The below truth tables represent:
IF a lift is on the correct floor AND the call button has been pressed THEN open the lift door
What are the values for Open Lift Door and P below?
16
17
Multiple Choice
If lane one is open OR lane 2 is open then you can drive down the road
What is P?
18
Boolean logic
Unit 10 Advanced programming and databases
Boolean function – NOT
• IF the input is True then the output is False
• IF the input is False then the output is True
InputA
Output P = NOT A
False
True
True
False
19
Multiple Choice
20
Multiple Choice
21
Multiple Choice
Which logic gate take the input and negates it, turning 0 to 1 and 1 to 0?
AND
OR
NOT
22
Multiple Choice
This is the truth table for which logic gate?
AND
OR
NOT
23
Multiple Choice
What is the output of an OR gate if its inputs are 0 and 0?
1
0
24
Boolean logic
Unit 10 Advanced programming and databases
More logic
Which of the following statements are True?
• (4 > 3) AND (5 > 7)
• (2 < 8) OR (8 > 10)
• NOT (5 * 7 > 30)
• ((7 DIV 3) >= 2) OR ((7 DIV 3) < 2)
• ((12 MOD 5) < 2) AND ((12 MOD 5) == 2)
• DIV gives the integer division (the result of division without any
fractional component)
• MOD gives the remainder after a division
25
Multiple Choice
Is this True or False?
(4 > 3) AND (5 > 7)
True
False
26
Multiple Choice
Is this True or False?
(2 < 8) OR (8 > 10)
True
False
27
Multiple Choice
Is this True or False?
NOT (5 * 7 > 30)
True
False
28
Multiple Choice
Is this True or False?
((7 DIV 3) >= 2) OR ((7 DIV 3) < 2)
(research DIV if you have forgotten)
True
False
29
Multiple Choice
Is this True or False?
((12 MOD 5) < 2) AND ((12 MOD 5) = 2)
(research MOD if you have forgotten)
True
False
30
Boolean logic
Unit 10 Advanced programming and databases
From truth tables to logic gates
• The following logic gates are used in circuits:
• AND gate
• OR gate
• NOT gate
• NAND gate (NOT AND)
• NOR gate (NOT OR)
• XOR gate (Exclusive OR)
31
Boolean logic
Unit 10 Advanced programming and databases
Binary logic – AND gate
• If both inputs are 1 (True) then the output is 1 (True)
• Otherwise the output is 0 (False)
Logic Diagram
Truth Table
INPUT
A
INPUT
B
OUTPUT
P
Logic statement: P = A AND B
A
B
P
0
0
?
0
1
?
1
0
?
1
1
?
32
Multiple Choice
Which is the correct Truth Table for AND
33
Boolean logic
Unit 10 Advanced programming and databases
Binary logic – OR gate
• If either input is 1 (True) then the output is 1 (True)
• Otherwise the output is 0 (False)
Logic Diagram
Truth Table
INPUT
A
INPUT
B
OUTPUT
P
Logic statement: P = A OR B
A
B
P
0
0
?
0
1
?
1
0
?
1
1
?
34
Multiple Choice
Which is the correct Truth table for OR?
35
Boolean logic
Unit 10 Advanced programming and databases
Binary logic – NOT gate
• If 0 is input it outputs 1 (True)
• If 1 is input it outputs 0 (False)
Logic Diagram
Truth Table
A
P
0
1
1
0
INPUT A
Logic statement: P = NOT A
OUTPUT P
36
Boolean logic
Unit 10 Advanced programming and databases
NAND, NOR and XOR gates
• A NAND gate gives the opposite results to an
AND gate
• It is the same as combining an AND gate with a NOT gate
• In the same way, a NOR gate is the same as combining an
OR gate with a NOT gate
• An Exclusive OR gate (XOR) will only be true if one
of the inputs is true
• It will be false if both inputs are true, hence it’s exclusive
• Complete the truth tables for NAND, NOR and
XOR gates
• Also, guess what the symbol would be for each
37
Match
Match the following
A XOR B
A NOR B
A NAND B
P = NOT A
AND
A XOR B
A NOR B
A NAND B
P = NOT A
AND
38
Boolean logic
Unit 10 Advanced programming and databases
Worksheet 3
• Now complete Task Worksheet 3
Objectives
• Construct truth tables for the following logic gates:
• NOT, AND, OR
• NAND, NOR
• XOR (EOR)
• Create logic circuits from problem statements, logic
expressions or truth tables
• Complete truth tables from problem statements, logic
expressions or logic circuit
• Write logic expressions from problem statements, logic
circuits or truth tables
Show answer
Auto Play
Slide 1 / 38
SLIDE
Similar Resources on Wayground
33 questions
LORD OF THE FLIES
Presentation
•
11th Grade
34 questions
SAT Math Prep Calculator 16 Questions Part 1
Presentation
•
11th - 12th Grade
30 questions
Universal Law of Gravitation
Presentation
•
11th Grade
30 questions
Lesson 5 EAPP
Presentation
•
11th Grade
29 questions
Mikroprosesor Mikrokontroler 1
Presentation
•
11th Grade
33 questions
WWI
Presentation
•
11th Grade
34 questions
AP Review: In-Class Learning
Presentation
•
11th - 12th Grade
33 questions
Subroutines
Presentation
•
10th Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Professional Development
28 questions
US History Regents Review
Quiz
•
11th Grade
20 questions
Insurance
Quiz
•
9th - 12th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
10 questions
7.3-7.4 Quiz
Quiz
•
11th Grade
6 questions
Mayan Mathematics part 1
Presentation
•
9th - 12th Grade
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
10 questions
Unit 9 Quiz
Quiz
•
9th - 12th Grade
50 questions
US History Regents Practice Exam
Quiz
•
11th Grade