Download presentation
Presentation is loading. Please wait.
1
Lesson 1-5 AP Computer Science Principles
Binary Numbers Lesson 1-5 AP Computer Science Principles
2
Objectives Students will be able to:
Describe how to use bits to create a functioning number system Understand the relationship between the powers of 2 and the number of bits needed to express a number of a certain magnitude. e.g. How many bits do I need to represent the number “15”, or “32”, or “1492”? Determine, for a given number of bits, both the number of possible numbers that can be represented and also the range of those numbers
3
Recall… In the previous lesson you created 27 different 3-place patterns out of circles, triangles and squares, and tried to define a system of rules to generate all of the patterns.
4
Journal What if you only had a circle and square? With only a circle and square, how many 3-place patterns are there? Here’s a start, you make the rest. How many are there?
5
Consider this… How large of numbers do you think this system can represent? How could we go higher?
6
Circle, Triangle, Square → Towards → The Binary Number System
7
1 place = 3, 1-shape patterns
Previously on CSP…. 1 place = 3, 1-shape patterns Who: baker @TeachCode | #TeacherCon | #CSforAll
8
2 places = 9, 2-shape patterns
Previously on CSP…. 2 places = 9, 2-shape patterns Who: baker @TeachCode | #TeacherCon | #CSforAll
9
2 places = 9, 2-shape patterns
Previously on CSP…. 2 places = 9, 2-shape patterns Who: baker @TeachCode | #TeacherCon | #CSforAll
10
3 places = 27, 3-shape patterns
Previously on CSP…. 3 places = 27, 3-shape patterns Who: baker @TeachCode | #TeacherCon | #CSforAll
11
3 places = 27, 3-shape patterns
Previously on CSP…. 3 places = 27, 3-shape patterns Who: baker @TeachCode | #TeacherCon | #CSforAll
12
Number each pattern to make a shape -> number mapping
Previously on CSP…. Number each pattern to make a shape -> number mapping 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 Who: baker @TeachCode | #TeacherCon | #CSforAll
13
What if we had 10 shapes? Previously on CSP….
Who: baker @TeachCode | #TeacherCon | #CSforAll
14
1 place = Ten 1-shape patterns
Previously on CSP…. 1 place = Ten 1-shape patterns 1 2 3 4 5 6 7 8 9 ← These are just shapes! Who: baker @TeachCode | #TeacherCon | #CSforAll
15
0 9 9 _ _ _ Quiz: What comes next? Previously on CSP…. Ten shapes 1 2
1 2 3 4 5 6 7 8 9 0 9 9 _ _ _ Who: baker @TeachCode | #TeacherCon | #CSforAll
16
0 9 9 _ _ _ 1 0 0 Quiz: What comes next? Previously on CSP….
Ten shapes 1 2 3 4 5 6 7 8 9 0 9 9 _ _ _ 1 0 0 Who: baker @TeachCode | #TeacherCon | #CSforAll
17
Place Values... Previously on CSP….
Who: baker @TeachCode | #TeacherCon | #CSforAll
18
__ __ __ __ __ __ Place Values...
Previously on CSP…. Place Values... With Ten “shapes” every time you add a place, you multiply by 10 the number of numbers... __ 10 possibilities (0 - 9) __ __ 100 possibilities ( ) __ __ __ 1000 possibilities ( ) Who: baker @TeachCode | #TeacherCon | #CSforAll
19
__ __ __ __ __ __ Place Values...
Previously on CSP…. Place Values... With Three “shapes” every time you add a place, you multiply by 3 the number of numbers... __ 3 possibilities ( ) __ __ 9 possibilities ( ) __ __ __ 27 possibilities ( ) Who: baker @TeachCode | #TeacherCon | #CSforAll
20
Four thousand and seventeen
Previously on CSP…. Write the number… Four thousand and seventeen Who: baker @TeachCode | #TeacherCon | #CSforAll
21
4 0 1 7 Place Values...Remember what it means? Previously on CSP….
1000s s s s 4 * * * * 1 Who: baker @TeachCode | #TeacherCon | #CSforAll
22
Where is this heading? ...binary... Previously on CSP….
Who: baker @TeachCode | #TeacherCon | #CSforAll
23
01 “Binary” is a number system with 2 shapes... Previously on CSP….
Who: baker @TeachCode | #TeacherCon | #CSforAll
24
__ __ __ __ __ __ __ __ __ __ The pattern holds...
Previously on CSP…. The pattern holds... With two “shapes” every time you add a place, you multiply by 2 the number of numbers... __ 2 possibilities (0 1) __ __ 4 possibilities ( ) __ __ __ 8 possibilities ( ) __ __ __ __ 16 possibilities ( ) Who: baker @TeachCode | #TeacherCon | #CSforAll
25
1 1 0 1 Place Values...powers of 2 Previously on CSP…. 8s 4s 2s 1s
8s 4s 2s 1s 1 * * * * 1 = 13 Who: baker @TeachCode | #TeacherCon | #CSforAll
26
Previously on CSP…. Constructing a binary number means figuring out which powers of 2 add up to the number you want Who: baker @TeachCode | #TeacherCon | #CSforAll
27
Previously on CSP…. Constructing a binary number means figuring out which powers of 2 add up to the number you want 32 = 41 Who: baker @TeachCode | #TeacherCon | #CSforAll
28
To the flippy do! Previously on CSP….
Who: baker @TeachCode | #TeacherCon | #CSforAll
29
Previously on CSP…. Flippy Do Quiz: What’s the binary number? 5 17 63 64 100 127 What’s the decimal number? 100 101 1101 1 0000 Who: baker @TeachCode | #TeacherCon | #CSforAll
30
Binary Odometer Go to the Binary Odometer ( See how it works… What’s the largest number you can make in binary with the binary odometer?” What happens when the odometer run out of numbers?
31
Activity Guide Complete the Activity Guide and turn it in.
32
Stage 5 Complete Stage 5.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.