Lesson 6: Combining Representations

Overview

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

In this lesson, students use all three types of binary representation systems (ASCII characters, binary number, 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.

Purpose

In previous lessons, students used different representation systems in isolation. Here, they see various representation systems used together within the same record. They should see that it's important not only to know the various codes, but to create rules about which codes are being used at which points in the record. Without this structure, it is impossible to decode a series of bits.

Assessment Opportunities

  1. Use multiple binary systems to decode information.

    Activity Guide, page 2: In the chart at the bottom of the page, the data should be decoded as in the answer key.

  2. Determine the most appropriate encoding system for a given piece of information.

    Activity Guide, page 2: The method of encoding the new information should be appropriate for the information type (e.g. numbers for height, ASCII for location).

Agenda

Warm Up (5 mins)

Activity (35 mins)

Wrap Up (5 mins)

View on Code Studio

Objectives

Students will be able to:

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

Preparation

  • Have the 8-Bit Binary Widget and Binary to ASCII Table ready to model with the class

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 mins)

Journal

Discussion Goal

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.

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

Goal: Push students past the answer that the number is just 67. One way to do this 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.

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?

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 mins)

Discussion Goal

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, and 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.

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 to a full group. Ask a few students to share their ideas before continuing to the student record example.

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.

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

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 Tabkle. Ensure each group has access to the 8-bit binary widget in Code Studio

Pet Records Activity Guide

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.

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.

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.

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!

Wrap Up (5 mins)

Journal

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

  • Combining Representations
  • 2
  • 3
  • (click tabs to see student view)
View on Code Studio

Student Instructions

Can you decode this binary string?

What information do you need to help you decode it?

View on Code Studio

Teaching Tip

Byte 0: The student is in Grade 9.

Byte 1: The student is 15 years old.

Byte 2 The student's first initial is "J".

Byte 3 The second initial is "H".

To hide this box when you display the level, click the teacher panel on the right hand side of this page and choose the "View as Student" option.

Student Instructions

Student record

0
1
2
3

The student record holds information according to the following rules:

  • The first eight bits store the student's grade as a binary number.

  • The second eight store the student's age as a binary number.

  • The next eight store the student's first initial in ASCII.

  • The last eight store the student's last initial in ASCII.



Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards (2017)

DA - Data & Analysis
  • 2-DA-07 - Represent data using multiple encoding schemes.