binary logic lets think about the binary!. what is binary? computers use binary as it’s a lot...
TRANSCRIPT
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 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.
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!
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
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
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
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
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
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
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.
Practice!
Complete Binary Worksheet 1
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
8 4 2 1
What is the binary number for 129?
163264128
124864 32 16128
OR1 0 0 0 0 0 0 1
8 4 2 1
What is the binary number for 71?
163264128
124864 32 16128
0 1 0 0 0 0 1 1
Practice!
Complete Binary Worksheet 2
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
Gates
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”
Gates
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”
Gates
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
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