Search Header Logo
Unit 10 T3 Boolean Logic  part 1

Unit 10 T3 Boolean Logic part 1

Assessment

Presentation

Professional Development

11th Grade

Practice Problem

Hard

Created by

Michael Harrington

FREE Resource

17 Slides • 21 Questions

1

media

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?

1

Read the text and questions carfully

2

Go back and Re-read any notes or slides before the question if you are stuck.

3

Pay attention to any question you get wrong so you know the correct answer for next time.

4

Just waste time by chatting with your neighbour.

3

media

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

Question image

What are the only possible values that key1 and key2 can be?

1

Key1 and key2 can only be FALSE ( unlock)

2

Key1 and key2 can only be TRUE (lock )

3

Key1 and key2 can only be TRUE or FALSE (lock or unlock)

4

Key1 and key2 can only be safeOpen = TRUE or safeOpen = FALSE

5

media

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

Question image

What values must they be to open the safe?

1

They must both be TRUE or FALSE to open the safe

2

They must both be FALSE to open the safe

3

They must both be TRUE to open the safe

4

They must both be the same to open the safe

7

media

Boolean logic

Unit 10 Advanced programming and databases

Booleans in loops

• Booleans used in IF
statements and loops

WHILE doorOpen
turnOnLight()
ENDWHILE

8

media

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

Question image

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.

1

IF correctPIN or fingerprint

2

IF fingerprint AND correctPIN

3

IF fingerprint OR correctPIN

4

IF fingerprint XOR correctPIN

10

media

11

Multiple Choice

Question image

What does this circuit diagram represent?

1

AND
Either switch needs to be down to complete the circuit

2

OR
Either switch needs to be down to complete the circuit

3

AND
Both switches must be down to complete the circuit

4

OR
Both switches must be down to complete the circuit

12

Multiple Choice

Question image

What does this circuit diagram represent?

1

AND
Either switch needs to be down to complete the circuit

2

OR
Either switch needs to be down to complete the circuit

3

AND
Both switches must be down to complete the circuit

4

OR
Both switches must be down to complete the circuit

13

media

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

media

15

Multiple Choice

Question image

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?

1
2
3
4

16

media

17

Multiple Choice

Question image

If lane one is open OR lane 2 is open then you can drive down the road

What is P?

1
2
3
4

18

media

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

Question image
What gate is this table for?
1
AND
2
OR
3
NOT
4
NOR

20

Multiple Choice

Question image
What gate is this table for?
1
AND
2
XOR
3
OR 
4
NOT

21

Multiple Choice

Which logic gate take the input and negates it, turning 0 to 1 and 1 to 0?

1

AND

2

OR

3

NOT

22

Multiple Choice

Question image

This is the truth table for which logic gate?

1

AND

2

OR

3

NOT

23

Multiple Choice

What is the output of an OR gate if its inputs are 0 and 0?

1

1

2

0

24

media

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)

1

True

2

False

26

Multiple Choice

Is this True or False?

(2 < 8) OR (8 > 10)

1

True

2

False

27

Multiple Choice

Is this True or False?

NOT (5 * 7 > 30)

1

True

2

False

28

Multiple Choice

Is this True or False?

((7 DIV 3) >= 2) OR ((7 DIV 3) < 2)

(research DIV if you have forgotten)

1

True

2

False

29

Multiple Choice

Is this True or False?

((12 MOD 5) < 2) AND ((12 MOD 5) = 2)

(research MOD if you have forgotten)

1

True

2

False

30

media

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

media

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

Question image

Which is the correct Truth Table for AND

1
2
3
4

33

media

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

Question image

Which is the correct Truth table for OR?

1
2
3
4

35

media

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

media

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

Question image

Match the following

A XOR B

A NOR B

A NAND B

P = NOT A

AND

38

media

Boolean logic

Unit 10 Advanced programming and databases

Worksheet 3

• Now complete Task Worksheet 3

media

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