Boolean logic presentation

Post on 07-Jul-2015

112 views 1 download

Tags:

Transcript of Boolean logic presentation

Mr ChestermanManchester Met University

Test Lessonfor new computing subject

Logic

Using logic to make decisionsfrom conditions

Lesson aim explore true / false logic to make decisions

End goalshow understaning by using logic in computer programming techniques

Example:Weather conditions

if _____________

then _____________

if _____________

then _____________Can you think of an example?

if raining

then takeUmbrella

if raining

then takeUmbrella

if raining

then takeUmbrella

if raining

then takeUmbrella

if raining

then takeUmbrella

if raining

then

else

Boolean values are

TRUE or FALSE

raining

TRUE or FALSE?

Boolean Logic is named after George Boole born in 1815.

TRUE or FALSE?George Boole looked like this.

TRUE or FALSE?Boole has a crater on the Moon named after him

BooleanLogic

Is Black and

White

ComputersWhat does Boole have to do with computers?

Computer circuits

Computer Programming

Pac Man

if _______

then ______

if

OReatPellet eatsFruit

then scorePoints

if

ANDeatsPowerPellet

then killsGhost

touchingGhost

if NOT touchingGhost

then continueGame

else loseLife

We can useAND & OR & NOT

with TRUE or FALSE conditions

to make complex decisions

Class activity:

What's it like outside?

Ingredients:

Green – conditionsBlue – actionsOrange – decision control

Goal:Create instructions for a computer to choose what to take outside based on the weather

Recap

Use Bolean logic to

make decisions in programs

Boolean valuesare TRUE or FALSE

You can combine them with AND & OR Use NOT to reverse

them