36
Binary Logic OCR GCSE Computing

OCR GCSE Computing - Binary logic and Truth Tables

Embed Size (px)

DESCRIPTION

Computing presentation teaching Binary Logic and Truth Tables

Citation preview

Page 1: OCR GCSE Computing - Binary logic and Truth Tables

Binary Logic

OCR GCSE Computing

Page 2: OCR GCSE Computing - Binary logic and Truth Tables

Starter

What is Binary Data?

Why is it important to represent data in a binary form?

Page 3: OCR GCSE Computing - Binary logic and Truth Tables

Candidates should be able to:

d) explain why data is represented in computer systems in binary form

e) understand and produce simple logic diagrams using the operations NOT, AND and OR

f) produce a truth table from a given logic diagram.

Page 4: OCR GCSE Computing - Binary logic and Truth Tables

Binary Logic

This is the process of using the computer to logically work through a sequence of instructions or problems

It helps the computer make a decision (output) based on a given input or inputs.

Is one OR the

other an Apple?

Apple

BananaYes

Page 5: OCR GCSE Computing - Binary logic and Truth Tables

Logic Gates

There are a number of different logic gates that can be used to process data.

Thankfully we only need to know these three

AND OR NOT

Extension: Research other types of logic

gates

Page 6: OCR GCSE Computing - Binary logic and Truth Tables

How they work

A logic gate accepts one or more binary inputs and produces one output.

The output will change depending on the type of gate that it is.

Look at the following slides for examples of different types of gates.

Page 7: OCR GCSE Computing - Binary logic and Truth Tables

NOT

The NOT gate takes only one input and inverts it to create the output.

e.g.

If a 1 (on) value is sent as input a 0 (off) value if output as the result

0 1

Page 8: OCR GCSE Computing - Binary logic and Truth Tables

AND

The AND Gate is slightly more complicated. It requires both inputs to be true (on) for the output to be true. Otherwise the output will be false (off)

0 01

000

100

111

Page 9: OCR GCSE Computing - Binary logic and Truth Tables

OR

The OR Gate will produce a true (on) output whenever either or both of the input values are true (on)

0 11

000

110

111

Page 10: OCR GCSE Computing - Binary logic and Truth Tables

Your goEnter the missing value from the logic gate

1

1

10

11

01

00

10

1

00

Page 11: OCR GCSE Computing - Binary logic and Truth Tables

Combining Logic Gates

While useful by themselves logic gates become more useful when we join them together to create a logic diagram

01

11

How many different combinations of inputs are

there for this example?e.g. 0,0,0 0,0,1 0,1,0 0,1,1

Page 12: OCR GCSE Computing - Binary logic and Truth Tables

Practical

An on/off switch (input)

And Gate

Or Gate

Not gate

Output Light

You will now attempt to create your own logic diagrams and test them to determine the output.

Goto www.neuroproductions.be/logic-lab/

Note that some diagrams look different. We will use the ones below

Page 13: OCR GCSE Computing - Binary logic and Truth Tables

ActiviesCreate the diagram below and test it using the given inputs. Record the output

Both on

Top on bottom off

Both onTop on bottom off

Both off

Page 14: OCR GCSE Computing - Binary logic and Truth Tables

ActivitiesCreate the diagram below and test it using the given inputs. Record the output

Both on

Top off bottom on

Both offTop on bottom off

Both on

Page 15: OCR GCSE Computing - Binary logic and Truth Tables

ActivitiesCreate the diagram below and test it using the given inputs. Record the output

All onMiddle and Bottom OnTop On Bottom OnAll OffTop On

All onMiddle and Bottom OnTop On Middle OnAll Off

Page 16: OCR GCSE Computing - Binary logic and Truth Tables

ActivitiesCreate the diagram below and test it using the given inputs. Record the output

All onMiddle and Bottom OnTop On Bottom OnMiddle and bottom OnAll Off

All onMiddle and Bottom OnTop On Middle OnTop OnAll Off

Page 17: OCR GCSE Computing - Binary logic and Truth Tables

Activity

Draw each of the diagrams from earlier using the correct symbols

Design your own logic gates and create questions for others in the class to attempt.

Page 18: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables

Another way of working out the output from a logic diagram without having to construct the circuit is by using a truth table

A truth table create a map of all of the different possible outcomes.

Note that:for one input there are two possible outcomes

for two inputs there are four possible outcomesfor three inputs there are eight possible outcomes

for four inputs there are _ _ _ _ _ _ _ possible outcomes

Page 19: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (AND)

First we want to label all of the inputs

AB

Next Create the table

A B A and B

Page 20: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (AND)

AB

Add the values For A

A B A and B

T

T

F

F

Page 21: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (AND)

AB

Add the values For B

A B A and B

T T

T F

F T

F F

Page 22: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (AND)

AB

Work out the operation. Always work from left to right if there is more than one logic gate

A B A and B

T T T

T F F

F T F

F F F

Page 23: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (OR)

First we want to label all of the inputs

AB

Next Create the table

A B A or B

Page 24: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (OR)

Add the values For A

A B A or B

T

T

F

F

AB

Page 25: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (OR)

Add the values For B

A B A or B

T T

T F

F T

F F

AB

Page 26: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (OR)

Work out the operation. Always work from left to right if there is more than one logic gate

A B A or B

T T T

T F T

F T T

F F F

AB

Page 27: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (NOT)

First we want to label all of the inputs

A

Next Create the table

A Not A

Page 28: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (NOT)

A

Add the values For A

A Not A

T

F

Page 29: OCR GCSE Computing - Binary logic and Truth Tables

Truth Tables (NOT)

A

Add the values For Not A

A Not A

T F

F T

Page 30: OCR GCSE Computing - Binary logic and Truth Tables

Multiple Logic GatesAB

C

A B C

Page 31: OCR GCSE Computing - Binary logic and Truth Tables

Multiple Logic GatesAB

C

A B C D = A or B

Page 32: OCR GCSE Computing - Binary logic and Truth Tables

Multiple Logic GatesAB

C

A B C D = A or B D and C

Page 33: OCR GCSE Computing - Binary logic and Truth Tables

Multiple Logic GatesAB

C

A B C D = A or B D and C

T T T T T

T T F T F

T F T T T

T F F T F

F T T T T

F T F T F

F F T F F

F F F F F

Page 34: OCR GCSE Computing - Binary logic and Truth Tables

Activities

Create truth tables for the earlier exercises

Page 35: OCR GCSE Computing - Binary logic and Truth Tables

Plenary

Explain to a partner what each of the following terms means:

BinaryLogic

Truth TableLogic GateAND GateOR Gate

NOT Gate

Page 36: OCR GCSE Computing - Binary logic and Truth Tables

Exam Questions