Download presentation
Presentation is loading. Please wait.
Published byMildred Whitehead Modified over 9 years ago
1
What are these?
3
Binary Clock ICE3M May 7, 2007 Ms. Nelson
4
Telling Time in Binary 1 or 0 2 or 0 4 or 0 8 or 0 16 or 0 32 or 0 1 + 4 + 8 + 32 = 45 seconds! Similarly, the clock is currently showing 4 + 8 = 12 for the hour, and 4 + 2 + 1 = 7 for the minutes Therefore the current time is 12:07 and 45 seconds.
5
Computers and Storage Everything inside your computer is boiled down to tiny on/off switches Traditionally, we use 0 for off and 1 for on Ever noticed this on on/off switches? Numbers are stored this way too
6
Counting with 0’s and 1’s Pretend we only had 0’s and 1’s to work with, and not 2, 3, 4, 5, 6, 7, 8, 9. How many numbers can you come up with? 0, 1, 10, 11 (but not 12, 13, 14… have to skip all the way up to 99) 100, 101, 110, 111 1000…. can you continue this pattern?
7
Matching Up 00 11 210 311 4100 5101 6110 7111 8100091001101010 111011 121100 131101 141110 151111 1610000 1710001 18100101910011 2010100 2110101 2210110 2310111 2411000 2511001 2611010
8
The Power of the Powers of 2 1 (decimal) ≈ 1 (binary) ≈ 2 0 10 (decimal) ≈ 2 (binary) ≈ 2 1 100 (decimal) ≈ 4 (binary) ≈ 2 2 1000 (decimal) ≈ 8 (binary) ≈ 2 3 Any number can be expressed as a sum of powers of 2 e.g. 13 = 8 + 4 + 1 = 2 3 + 2 2 + 2 0 ≈ 1101 (bin) This is your shortcut!
9
Back to the Time It’s now 2:26 and 34 seconds How do we represent that? 2 becomes 10 26 becomes 11010 34 becomes 100010 The current time is: 10 11010 100010
10
Your Task… Write a program in Turing that… Gets the current time from the system Look in the command reference for “Time” Prints it out to the console in binary format e.g., 2:26:34 prints out as: 10 11010 100010 Our next project will involve LED lights
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.