binary logic lets think about the binary!. what is binary? computers use binary as it’s a lot...

23
Binary Logic Lets think about the Binary!

Upload: myra-cunningham

Post on 28-Dec-2015

220 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Binary Logic

Lets think about the Binary!

Page 2: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

What is Binary?

Computers use binary as it’s a lot simpler!

Each CPU is made up of millions of transistors which can only have TWO states (ON/OFF).We will be thinking of it as either 1 or 0.

Anything can be converted into a binary number so a computer can understand, process and store it.

Page 3: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

How do we get 1?

1

All we need is ONE GREEN TRIANGLE!

Page 4: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

How do we get 2?

All we need is ONE BLUE CIRCLE!

2

Page 5: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

How do we get 3?

All we need is ONE GREEN TRIANGLE and ONE BLUE CIRCLE!

21

Page 6: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

How do we get 5?

All we need is ONE GREEN TRIANGLE and ONE ORANGE SQUARE!

1 4

Page 7: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

How do we get 7?

All we need is ONE GREEN TRIANGLE and ONE ORANGE SQUARE!

1 2 4

Page 8: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How binary is calculated?

1 2

4 8

We have FOUR shapes worth a different amount

but ONLY ONE of each.

What’s the highest number we can make?

1 + 2 + 4 + 8 = 15

1 2 4 8

Page 9: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Binary Numbers

0 0 0 10 0 1 00 0 1 10 1 0 0 0 1 0 10 1 1 0

If we use a shape we mark it as ‘1’ otherwise it’s a ‘0’

1248 TOTAL

123456

Page 10: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

How many 8’s can fit into 5?The answer can be 1 or 0.

Click to continue…

8 fits into 5 zero times…So we put a 0 in the 8 column.

Click to continue…

8 4 2 1

Let’s take the number 5 and work out the binary representation…

5 0

Does 4 fit into 5?1 or 0 times?

Click to continue…

4 fits into 5! So we put a 1 in the 4 column.

Click to continue…

1

We then have to take the 4 we have noted away from the original number…

Click to continue…

1This leaves 1 left over – we will nowtest our numbers against 1 instead.

Click to continue…

How many 2’s fit into 1?

Click to continue…

2 is larger than 1, so we put a zero in the 2 column.

Click to continue…

0

Does 1 fit into 1?The answer can be 1 or 0.

Click to continue…

1

1 fits into 1 exactly So, one last time, a 1 goes in the final column.

Click to continue…

So 5 = 0101 in 4-bit binary.We can check we have the answer right by adding

the columns that hold a 1.4 + 1 = 5, so 0101 is correct.

Page 11: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Practice!

Complete Binary Worksheet 1

Page 12: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

What are binary numbers used for?

Anything the computer needs!We have been calculating Nibbles (4 bits) but

computers usually work in Bytes (8 bits).

8 4 2 1

We know what the FIRST FOUR bits stand for, what do you think the NEXT FOUR stand for?

163264128

Page 13: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

8 4 2 1

What is the binary number for 129?

163264128

124864 32 16128

OR1 0 0 0 0 0 0 1

Page 14: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

8 4 2 1

What is the binary number for 71?

163264128

124864 32 16128

0 1 0 0 0 0 1 1

Page 15: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Practice!

Complete Binary Worksheet 2

Page 16: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Gates

We know that BITS are either 1 or 0 but there are “gates” which can change the value.

Do you like to play football?1 = Yes0 = No

NOT

5 say “Yes” &3 say “No”

Do you not like to play football?

1 = Yes0 = No

5 say “No” &3 say “Yes”

1 becomes 0 &0 becomes 1

Page 17: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Gates

Page 18: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

GatesDo you like to play

playstation?1 = Yes0 = No

AND5 say “Yes” &

3 say “No”

Do you like to play playstation AND

sing?1 = Yes0 = No

1 says “Yes” &7 say “No”

Both questions must be ‘1’ to

output ‘1’

Do you like to sing?

1 = Yes0 = No

2 say “Yes” &6 say “No”

Page 19: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Gates

Page 20: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

GatesDo you like to play

playstation?1 = Yes0 = No

OR5 say “Yes” &

3 say “No”

Do you like to play playstation OR sing?

1 = Yes0 = No

1 says “Yes” &7 say “No”One or more

questions must be ‘1’ to output

‘1’

Do you like to sing?

1 = Yes0 = No

2 say “Yes” &6 say “No”

Page 21: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Gates

Page 22: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Truth Tables

We sometimes represent these gates on a Truth Table, e.g.:

Copy the truth table into your notes and also create the truth tables for the NOT and OR gates

Page 23: Binary Logic Lets think about the Binary!. What is Binary? Computers use binary as it’s a lot simpler! Each CPU is made up of millions of transistors

Practice!

Go onto http://logic.ly/demo and complete the following tasks on one sheet:a) Create an A OR B circuitb) Create (A OR B) and Cc) Create (Not A) AND Bd) Create (Not (A AND B)) OR CPrint out this one page by taking a screen shot and create the truth tables for these tasks

A, B & C are light switches