In this lesson, students create their own system for representing text in binary and explore how their newfound ability to convert between binary and decimal numbers helps in this process. In the activity students will create a system for representing text using only numbers. At the end of the main activity they briefly review the ASCII system. The wrap up discussion introduces the concept of abstraction and its connection to the chapter. Following this lesson there is a chapter assessment that reviews the contents of this and the previous lessons.



Students will be able to:


This lesson concludes students' initial study of data representation. After this lesson students will understand the ways the most common types of information, text and numbers, are stored using binary. More importantly they should understand the challenges or principles that led to the creation of these systems. For example, in the previous lesson they saw that representing more numbers means you need more bits for each number. In this lesson they will see that needing to represent more symbols (in this case characters), similarly necessitates using more bits. They should also see the importance of shared protocols for communicating successfully with bits. The only reason a pattern of bits represents the letter "A" for example, is that everyone agreed to that system. Students should develop the important understanding that representation systems are somewhat arbitrarily created to solve a shared problem, and they work not because there was "one right answer" but because many people agreed to use them.

The wrap up discussion begins to explore the concept of abstraction. This is a challenging concept to understand and one that students will return to many times throughout the course. In this case their understanding only need be that, while we know everything on a computer is represented with patterns of binary electric symbols, we create abstractions (in this case decimal numbers) to allow us to more easily reason about what those patterns mean.



Place students in pairs. Give each pair lined sheets of paper, have them open a blank page of a physical journal, or find other resources that they can use to write down notes for a shared protocol.

Prompt: When we communicate on the Internet we're not usually sending numbers back and forth, we're sending text! Although we will only be using numbers in our communication, that doesn't mean we can't figure out our own way to send text.

We'll be doing a series of challenges. Before each one I will give you a chance to talk to your partner. Then I'll give one member of each group a short message like "hey" or "ttyl". Your job will be to create an encoding system that will allow you to send that message. As always this will need to be done silently, with no communication except through your shared piece of paper.

Discuss: Give students a chance to discuss with their partner how they will accomplish this task. Afterwards bring the group back together to run the 4 challenges below.

Challenge 1 - Spaces: Silently give one member of each group the message "oh no" (or another short message that uses a space). Tell them to silently start communicating using only their shared piece of paper. Once they're done have them check whether they successfully communicated it.

Challenge 2 - Capitals and Punctuation: Silently give one member of each group the message "Great!" or something similar that uses capitals and punctuation.

Challenge 3 - Numbers: Silently give one member of each group the message "Free at 5?" or something similar that uses capitals, spaces, punctuation, and numbers.

Challenge 4 - Review: Silently give one member of each group the message "Cya 2nite!" or something similar that uses capitals, spaces, punctuation, and numbers. This shouldn't introduce new types of characters and is a chance for all groups to succeed.

Teacher Tip:

Increasing the Challenge: Each challenge here adds a slight layer of challenge. The first introduces the need for spaces and capitals. The second introduces the need for punctuation marks. The third introduces the need for number characters. The last is a review, and a chance for all groups to succeed.
Send What You Can!: Because of the design of these challenges, many groups probably won't be able to send the full message for challenges 1 - 3. Encourage groups to send as much of it as they can given the system they worked out. Encourage them that the whole point is to keep making it better as they go.
Mapping Numbers to Characters: The primary goal here is to have students get in the habit of mapping numbers to other important information, in this case characters. The actual systems they develop are less important and may not even need to be collected for assessment.

Prompt: Find another group. Discuss with them the following:

Discuss: Have groups compare with each other. Then move to a full group discussion. Aim to remind students of the insights in the warm up.

Introduce ASCII

You just invented your own scheme for encoding text with numbers. Given we use text on our phones and computers all the time, we should assume there is a standard encoding for most of the symbols you can type on an American keyboard. Today we're going to be looking at one called or ASCII (pronounced: "Ask-ee") or the American Standard Code for Information Interchange.

Distribute the ASCII reference sheet and quickly read the overview text at the beginning of the sheet.

Compare ASCII to the system that you developed. Ask yourself:

Discuss: Briefly discuss these prompts as a class. At this point the main features of the system should be familiar but use this discussion to reinforce previous points.

Wrap Up

Prompt: An interesting point of this lesson is that sometimes when representing information on a computer we can "forget the bits" even though we know that's how all information is being represented.

Discuss: Have students quietly come up with an answer, share with a partner, and then discuss with the whole class.

In computer science we deal with multi-layered systems so we need to create easier ways for humans to keep it all straight in our heads. To do this we create an abstraction, a simpler way of representing something complex. This lets us temporarily ignore underlying complexity.

For example, we know that computers can represent text since we see it every day. Under the hood each character is really just a number, which itself is really a binary number, which itself is really just a bunch of electric impulses in a wire. We saw this over the last few lessons, but we don't need to remember it all the time. We can just do what we did today and say "A is 65", and worry about the details only when we need to.

Use the following goals to wrap up this discussion and chapter:


  1. What is the minimum number of bits you need to encode the 26 letters of the alphabet plus a space?
    • 2 bits
    • 3 bits
    • 4 bits
    • 5 bits
    • 6 bits
  2. The standard QWERTY keyboard has 47 keys that can place characters on the screen. Each of these keys can also display a second character by holding the "Shift" key at the same time. How many bits would you need to encode everything that could be typed on this keyboard?
    • 3 bits
    • 4 bits
    • 5 bits
    • 6 bits
    • 7 bits
    • 12 bits
  3. ASCII has an encoding for every character of the alphabet as well as encodings for numbers -- that is, encodings for the symbols of the digits 0-9. So here is a trick question: How many bits are required to store the text of the number "150" in ASCII?
    • 3 bits
    • 8 bits
    • 16 bits
    • 24 bits
    • 32 bits
  4. The binary pattern "01000001" represents the number "65." Write a brief response explaining whether you believe this statement is always true. Explain your reasoning.
  5. An abstraction is a simplified representation of something that is more complex. Decimal numbers were a useful abstraction in the context of today's lesson. Write a short response to both questions below.
    • What is the underlying complexity decimal numbers were used to represent?
    • How were decimal numbers helpful in designing a system to represent text in bits?

Standards Alignment