< Unit 5 - Data and Society ('24-'25)

Lesson 6: Combining Representations

45 minutes

Overview

In this lesson, students use all three types of binary representation systems (ASCII characters, binary numbers, and images) to decode information in a record. After seeing a series of bits and being asked to decode them, students are introduced to the idea that in order to understand binary information, they must understand both the system that is being used and the meaning of the information encoded. They then decode a record representing a pet based on a given structure.

Question of the Day: How do computers tell the difference between binary codes for letters, numbers, or images?

CSTA K-12 Computer Science Standards (2017)
    • 2-DA-07 - Represent data using multiple encoding schemes.

Agenda

Objectives

Students will be able to:
  • Determine the most appropriate encoding system for a given piece of information.
  • Use multiple binary systems to decode information.

Preparation

  • Have the 8-Bit Binary Widget and Binary to ASCII Table ready to model with the class
  • Check the "Teacher's Lounge" forum for verified teachers to find additional strategies or resources shared by fellow teachers
  • If you are teaching virtually, consider checking our Virtual Lesson Modifications

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Teaching Guide

Warm Up (5 minutes)

Journal

Display: Show students the binary code in the slides

Prompt: A friend sent you the binary message above but did not send any encoding system to help you decide what it means. Using what you already know about binary systems: write down at least 2 things that this message could represent

Discuss: Give students a chance to think on their own, then talk in table groups before opening up to a full class discussion.

Discussion Goal: Students should note that without knowing which code is being used, they can't know for sure what the binary means. Specifically, they may see that the code could be the character "C" in ASCII or the number 67 as a binary number. In fact, it could be a code that they haven't seen before, in which case it could mean anything.

Prompt: Tell students that this friend has told you that this code represents a number, but nothing else. What do you think this number could represent for your friend?

Discussion Goal: Push students past the answer that the number is just 67. One way to do this is to note that if a stranger approached them and said "67" out of the blue, would they know what that person was talking about?

Students should come up with some different possible meanings of the number, such as an age, a temperature, an address, etc. The larger realization should be that, without context, the number could mean many things.

Remarks

When we use codes, we need to know two things: The system that is being used and the meaning of the information itself. That means that when we store something in a computer, we have to organize it so that we know these things for each part of our binary code.

Question of the Day: How do computers tell the difference between binary codes for letters, numbers, or images?

Activity (35 minutes)

Remarks

In our last lesson, we made binary profile's by answering a few questions about ourselves. Imagine that we now work for our school and we need to come up with a similar system to hold information about students in the class.

Prompt: What types of information would the school want to know about each student? How should it keep track of all this information?

Discuss: Let students talk with a partner before bringing them to a full group. Ask a few students to share their ideas before continuing to the student record example.

Discussion Goal: Encourage students to make connections between the previous lesson, where they made numerical binary profiles as practice, and this more realistic scenario of keeping track of student information for a school. Encourage students to think beyond just numerical data - for example, a school may need to keep a picture of you for your ID, your name and address, and other information.

It’s okay for students to be less sure about how the information should be tracked. Students may suggest keeping a long list or having a large table. When punchcards are introduced later, make connections back to these suggestions and note any similarities between students’ ideas and the punchcard.

Display: Display the binary student record and the rules for encoding it. Explain that this is one possible student record system

Content Corner

8-Bit Consistency: In previous lessons, ASCII has used 7 bits and numbers were between 4 and 8 bits. In this lesson, we begin to organize the information into sets of 8 bits, called a byte. This is a standard unit for binary information that is used in many different contexts.

Starting at 0: In our records, we start at row 0 rather than row 1. This is a common way of numbering in Computer Science.

Punchcards in History: Punchcards were used frequently in the early days of computer science - stories of their use can be researched online. Remnants of this technology can still be found when students fill in bubble sheets for standardized tests - the way these exams are graded mimics how a computer decodes a punchcard.

Model: Show students how to decode this record as a class. You should use the new 8-bit binary widget in Code Studio for the numerical rows, and the ASCII to Binary Table for the letter rows. Encourage the class to assist you with the correct steps in using these resources.

Remarks

This is a pretty good start for a student record, and there are many different rows we can add to this. Let’s look at another example where keeping a record is important: keeping track of information for animals when we take them to the vet.

Group: Put students into pairs.

Distribute: Give a copy of the activity guide and Binary to ASCII Table. Ensure each group has access to the 8-bit binary widget in Code Studio

Pet Records Activity Guide

Display: Read through the first section of the activity guide as a class and clarify any questions from students.

Do This: Students should use the binary widget to decode the numbers and their ASCII to Binary tables to decode the letters. There is no need to decode the image because it is already in the correct formatting to see it directly.

Content Corner

Because the name does not fill up all the space it has available, student may wonder why bytes 06 and 07 exist. Remind them that without the structure of the record, the computer will not know where to look. If the image were to start at Byte 06, the computer would interpret it as a character in the name.

Circulate: Make sure students are using their resources to help solve this problem, especially the Binary widget and the ASCII to Binary Table. Students can check their answers to the first page with you before continuing to the second page.

Display: As students finish up the first page, discuss the new record on the second page of the activity guide. The image is replaced with a new integer and characters, because the image itself did not hold enough information to be very useful. Clarify any questions about this new record before having students continue.

Do This: Have students decode the second punchcard.

Circulate: Monitor student progress to check on how they are decoding the punchcard. This can also be an opportunity to ask students about their own pets and what a punchcard for their animals might look like.

Share Out: On the bottom of the worksheet, students are also asked to think of a new piece of information and how it will be encoded. Ask students to share out their ideas and write them on the board.

Assessment Opportunity

You can check the chart at the bottom of the second page to ensure that the data is decoded as in the answer key.

You can also check that the method of encoding the new information is appropriate for the information type (e.g. numbers for height, ASCII for location).

Remarks

When we represent something on the computer, we have to make decisions about what aspects we want to record and how those aspects will be recorded. In this lesson, we looked at two topics that could involve personal information - your student data and medical history. In the next lesson, we’ll look at how we can keep that information safe and protected. We don’t want just anyone to be able to look up sensitive information about ourselves!

Levels

Wrap Up (5 minutes)

Journal

Prompt: Which type of information (number, character, image) did you find most useful? What made it so useful?

Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.