Lesson 7: Combining Representations
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.
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.
Warm Up (10 mins)
Activity (40 mins)
Wrap Up (5 mins)
Students will be able to:
- Use multiple binary systems to decode information.
- Determine the most appropriate encoding system for a given piece of information.
For the Teacher
- Pet Records - Exemplar
For the Students
Warm Up (10 mins)
Review: Quickly review the types of binary encoding systems that have been covered: ASCII, images, and binary numbers.
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: Show students the binary code on Code Studio Bubble 2.
Ask them to use what they know about binary codes to figure out what it means.
Give students a chance to think on their own, then talk in table groups before opening up to a full class discussion.
Goal: Students should come up with some different possible meanings of the number, such as an age, a temperature, etc. Again, without context, the number could mean many things.
Prompt: Next, tell students that the code is a number, and ask them whether they know what it means. Push them past the answer that the number is 67. If a stranger approached them and said "67" out of the blue, would they know what that person was talking about?
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.
Activity (40 mins)
Goal The goal of this discussion is just to get the students thinking about the different types of representation that could be used in a wider context, as well as to prime them for the example in Code Studio.
Prompt: Imagine that you were creating a system to hold information about students in the class. What types of information would you want to know about each student? What system would you use to encode those types of information into binary?
Display: Go to the third bubble in Code Studio, entitled "Student Record", and review the bulleted information on the left hand side of the screen.
7 versus 8 bit ASCII: In previous lessons, ASCII has used 7 bits, and numbers have used 8 bits. In this lesson, we begin to organize the information into sets of 8 bits, called a byte. This makes it easier for us to organize the information so that we can read it. Because ASCII only uses 7 bits, we add a 0 at the beginning of the code to fill the extra space.
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.
Model: Model the decoding of the student record with the class.
Group: Put students into pairs.
Distribute: Give a copy of Activity Guide - Pet Records - Activity Guide and ASCII to Binary Table - Reference to each pair. Ensure each group has access to the binary widget from earlier in the chapter.
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.
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.
On the second page, the image is replaced with a new integer and characters, because the image itself did not hold enough information to be very useful.
Prompt: On 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.
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 the next lesson, you're going to have a chance to make up your own representation of something and encode it in binary.
Wrap Up (5 mins)
Which type of information (number, character, image) did you find most useful?
What made it so useful?
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.
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.
CSTA K-12 Computer Science Standards (2017)
DA - Data & Analysis
- 2-DA-07 - Represent data using multiple encoding schemes.