Unit 1. Your Virtual World
Revision Date: Jun 11, 2020 (Version 3.0)Summary
A bit is a single unit of information. Bits are the fundamental building blocks of digital computing. There are many different ways to represent a single bit physically, and collections of bits can be combined to represent everything from numbers to electronic books, to control programs for interstellar probes. In this lesson, students will learn how bits are stored and how they can be used to represent information. Students will further explore how numbers can be represented in binary form, how to convert numbers between these different forms, and how they are used by different applications.
This lesson should be repeated with increasing levels of expectations. The first time this lesson is taught the emphasis is on binary and conversion to decimal, and representation of letters and colors using binary - ASCII and RGB colors.
The second time it is taught should be during Unit 2. The previous topics should be reviewed with the emphasis this time on conversion to hexadecimal and representations of decimal values to support the idea of different number types in Python.
The final time it should be taught - perhaps at the beginning of the Internet Unit - the emphasis should be on comparing binary and hexadecimal values without converting them to binary. This should support students understanding of the formatting and use of internet packets.
Outcomes
Overview
Session One
Session Two
Session Three - New for 2020-2021
Optional Activities
Source
Parts of this lesson were adapted from code.org.
The students will...
Student computer usage for this lesson is: required
For the Student
For the Teacher
In the Lesson Resources folder:
Available on the Web for Teachers:
Jacquard loom: early computer programming
The teacher will introduce the "Jacquard Loom," an early machine that made use of punch cards to make complicated textiles.
Represent Values as a Light Switch
Teaching Tip: Guiding the students toward understanding that the number of switches determines how many numbers can be represented. The pattern is 1 switch = 2 (or 2^{1}) numbers, 2 switches = 4 (or 2^{2}), 3 switches = 8 (or 2^{3}), etc.
Use the "JustBits" presentation in the lesson folder to explore different ways to represent bits, and different ways in which bits can be used to store different kinds of information.
General Presenting Tips:
Presentation Guide:
9 + 4 as 1001 00 0100
11 – 3 as 1101 01 0011
2 * 5 as 0010 10 0101
15 / 5 as 1111 11 0101
Say: In this course, we will use the Python programming language. In Python the size of an integer we represent is not limited to 32 or 64 bits as some programming languages. Python integers are limited in size only be the memory space the computer has. The exam reference sheet produced by the College Board for this course invisions integers the same way that Python does - only limited in size by the computer's memory.
Converting between decimal and binary
Use the "BinaryConversionWorksheet" in the lesson folder (from Code.org) to let students explore (individually or in pairs/small groups) how to build an algorithm for converting binary to decimal. As you progress through the activity, answer questions as they arise, or ask students to explain how they arrived at the answer to check for understanding.
Other extensions and activities that may be useful:
Introduction
Option 1:
Option 2:
Extension: If you want to give your students more practice problems for in-class practice or homework, you can use the worksheet generator at http://www.worksheetworks.com/math/numbers/systems.html
How are text, colors and images saved in hexadecimal format? Select some of the following to present and discuss with the class.
Journal
Students should consider the following prompt, and record their thoughts in their journals:
Introduction
Have students discuss with elbow partners then add to their journals a description of how the computer represents a collection of bits as:
Herding Bits Activity 1 (20 min)
Open Google Drive and create a new Google Sheet. Copy the URL of this New York Times article into cell A1. We will use the software in Google Sheets to find the author of this article and then you will use it to find the author(s) of two other New York Times articles of your choice.
Find how the New York Times identifies the author of its articles.
View the New York Times article on the web page.
Highlight the name of the author, right click and select inspect (the element) that contains the author’s name.
Find the itemprop property in the element and verify that it is assigned the same value as in the formula below.
=IMPORTXML(A1,"//span[@itemprop='name']")
Configure and use the IMPORTXML function in Google Sheets.
Copy the formula above into cell H1 and press enter.
Verify that the name of the author is displayed in cell H1.
Working with elbow partners identify two other New York Times articles and use this technique to have the software in Google Sheets round up the author of each article.
Herding Bits Activity 2(20 min)
Sometimes the information is contained in a larger structure (herd) called a table. This time we will use the software in Google Sheets to copy a table from a web page then use the table values to find information.
Collect the bits contained in the World’s Tallest Buildings table found on Wikipedia.
Copy the URL from the link above to cell A1 on a new Google Sheet.
Copy the formula below into cell A3 to herd the bits from the second table on the web page to your spreadsheet.
=importhtml(A1,"table",2)
Copy the table values to a new sheet.
Select lines 3 through the end of the table and copy them to the clipboard (ctrl-c).
Create a new Google Sheet.
Use ctrl-space-c to paste the values into the new sheet starting at cell A2.
Select column D and use the Data menu to sort the data into alphabetical order by country name.
Find the three countries with the most buildings listed among the world’s tallest buildings.
Discuss with elbow partners what other tables might be interesting to scrape from the internet. Try and find one of those tables online and herd those bits into a spreadsheet.
Elbow partners share the results of their attempts with the class students should explain in thirty seconds:
What table they tried to find.
Their success at scraping or herding the bits.
What information they might extract fromt their table.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A computer program uses 3 bits to represent int...
An online store uses 6-bit binary sequences to ...
Part 1 - Exploring Physical Bit Representations
Teaching note: The research and writing activity in this lesson presents an opportunity to talk about copyright laws and emphasize that copied content must be credited to the rightful author or organization.
Part 2 - Sharing the research
Teaching note: Model writing skills through a variety of writing opportunities and prompts. Encourage students to write complete sentences that clearly communicate their ideas.
The Extension section above gives a variety of outside activities, some of which are appropriate for verbal and others for tactile learners.
Note: If there are students in the class with physical limitations who are unable to stand, stretch, or squat, the game can be modified appropriately:
Visual - Decimal, Binary, Octal, and Hexadecimal Number Systems Video - http://whyu.org/whyUPlayer.php?currentchapter=3¤tbook=1&youtubeid=5sS7w-CMHkU
OR - https://www.youtube.com/watch?v=_oaBT-TndCs
Kinesthetic - Hexadecimal Drum Machine - http://www.mathsisfun.com/games/hex-drums.html
Auditory - Hexadecimal File Music - https://www.youtube.com/watch?v=fyBf4Y2mVzs
Extension Activity 1. Students that have mastered the conversion techniques can peer-tutor students [one-on-one] that are having difficulty solving the conversions.
Extension Activity 2. Students can observe their computer’s network interface card (NIC) MAC address in hexadecimal, and convert the MAC address to binary and decimal.
See algorithms of number system conversions:
Alternative presentation for Gifted Students doing Decimal to Hexadecimal Conversion:
For decimal number x:
Convert x=603 to hex:
n=2, 16^{2}=256 < 603
n=3, 16^{3}=4096 > 603
So
n = 2
d_{2} = int(603 / 16^{2}) = 2
Δ = 603 - 2×16^{2} = 91
n = 1, x = Δ = 91
d_{1} = int(91 / 16^{1}) = 5
Δ = 91 - 5×16^{1} = 11
n = 0, x = Δ = 11
d0 = int(11 / 16^{0}) = 11_{10} = B_{16}
Δ = 11 - 11×16^{0} = 0
(d_{2}d_{1}d_{0}) = 25B
Answer: x = 603_{10} = 25B_{16}
Learn to Count in Binary and Hexadecimal - http://webelfin.com/webelfindesign/counthex.html
ADDITIONAL/ALTERNATE FORMATIVE ASSESSMENT MATERIAL or Class Activity if time permits - from unplugged.com
http://csunplugged.org/binary-numbers
Brainstorm reasons for storing and communicating secret messages. Challenge students to think of both helpful and problematic reasons. Students record at least two of each.
View steganography presentation. Presentations are available on YouTube.
Abdullah Seddiq (MIT Blossoms) has Counting Systems with teacher's guides and additional resources. This video aims to explain counting systems (Decimal, Binary, Hexadecimal). Students will get to know how to convert numbers between these systems. Also students will learn how to do some byte and bit level operations. They will use a Visual Basic (VB) application that changes colors through logical operation on numbers. See also The Magic Picture: Steganography in Bitmap Files
Assessment Questions:
Journal check - questions presented as described in the lesson plan
ASSESSMENT QUESTIONS
Getting Started section: questions on converting between bases and describing the purpose of hexadecimal numbers.