Lab 4: Data Representation and Compression

This lab addresses representation of digital data as binary sequences. The first two pages introduce bits, bytes, and binary sequences and how they are used to store text, images, and other data. The following two pages explain how a binary sequence can represent numbers—both integers and non-integers—and in particular, explain floating point as an approximation for real numbers. These are followed by a page covering binary number representation. Binary is a place value system just like decimal representation; binary uses only two digits (0 and 1) instead of ten (0 through 9). The last page addresses data compression and the difference between lossy and lossless data compression formats, which lose and preserve original information respectively.

Note that there's no such thing as a "binary number." The way we represent a number—as XXXIRoman or 3110 or 111112 or 1F16 or "thirty-one" or "treinta y uno"—is language or notation. The number itself is the same regardless of how we express it. It helps the distinction to say "binary numerals" or "binary representation" instead of "binary numbers." Students understand the conversions better when they remain clear that only the notation, not the number, changes. Explicitly making the analogy with Roman numerals may help; students are likely to understand and be able to extend from the idea that XXXI and 31 are the same number written different ways.

Pacing

The 6 lab pages could be split across 4–7 days (150–300 minutes). Expected times to complete follow:

Lab Pages

BJC Videos from UC Berkeley

No YouTube access at your school?

Solutions

Correlation with 2020 AP CS Principles Framework 

Computational Thinking Practices: Skills

Learning Objectives:

Essential Knowledge: