Topic 2.1: Binary Numbers | AP CSP Big Idea 2 | APCSExamPrep.com
Binary Numbers
After this lesson, you will be able to:
- Convert between binary and decimal using place values
- Distinguish between how many values N bits stores vs. the maximum value (and avoid the 0-indexing trap)
- Explain analog vs. digital using the FPS / flip book analogy
- Identify when overflow errors occur
Netflix streams 4K video at roughly 15 GB per hour — 120 billion bits, every 60 minutes. Every pixel of every frame is binary numbers representing color values. Every song you stream, every message you send, every photo you post: sequences of 0s and 1s. Understanding binary is understanding the actual foundation of the digital world.
Why Binary? The Language of All Digital Data
Every piece of digital information — a photo, a song, a text message, a video game — is stored as a sequence of 0s and 1s. This isn't arbitrary. Computers are built from electrical circuits with two stable states: on and off. On = 1. Off = 0. That's it.
A single binary digit is called a bit. Eight bits form a byte. Every file, every image, every stream is ultimately billions of these switches. Binary is the universal language of digital information.
The AP exam tests two things: (1) the concept that all digital data is represented in binary, and (2) actual binary-to-decimal and decimal-to-binary conversion. Both appear. Use the Binary Switch game to drill conversions until they're automatic.
Place Values: The Key to Binary Conversion
Binary (base 2) works like decimal (base 10) — each position represents a power of its base. The 8-bit place value table — the most important thing to memorize in this topic:
| Bit position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value (2n) | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Example: 10110101 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
| Value | 128 | 0 | 32 | 16 | 0 | 4 | 0 | 1 |
128 + 32 + 16 + 4 + 1 = 181
Green cells = “on” bits. Add their place values. This is exactly how the Binary Switch game works — you toggle switches on and off and watch the decimal value update live.
How many values can 4 bits store? 24 = 16 values (0 through 15). What is the maximum value 4 bits can store? 15, not 16. Students constantly confuse these. The range always starts at 0. Maximum = 2N − 1. Eight bits = 256 values (0–255), maximum value = 255.
Analog vs. Digital: The FPS / Flip Book Analogy
Real motion is analog — continuous, smooth, infinite frames per second. A flip book is digital — discrete snapshots. Flip fast enough and your brain fills in the gaps. Video games running at 60 fps work the same way: 60 complete still images every second assembled into the illusion of motion.
Digital audio works identically: a continuous sound wave (analog) is sampled thousands of times per second. Each sample gets a binary number. More samples per second = smoother approximation = more data. Less = choppier = smaller file. This is exactly what fps is for video.
Key AP fact: the digital version is always an approximation of the original analog signal. No matter how high the sampling rate or fps, some information between samples is always lost. Converting analog to digital can never produce a perfect copy.
Key Vocabulary
| Term | AP Definition | Plain English |
|---|---|---|
| Bit | A single binary digit; the smallest unit of data, either 0 or 1 | One switch: on or off |
| Byte | 8 bits | The standard unit of storage |
| Binary (base 2) | A number system using only 0 and 1, where each position represents a power of 2 | The language computers use |
| Place value | The value of a digit based on its position | In binary: 1, 2, 4, 8, 16, 32, 64, 128 right to left |
| Analog data | Data that can take any value within a continuous range | Smooth and infinite, like a sound wave |
| Digital data | Data represented as discrete binary values | Stepped snapshots, like frames in a video |
| Sampling | Measuring an analog signal at regular intervals to create a digital approximation | Taking digital snapshots of an analog wave |
| Overflow error | An error when a number exceeds the maximum value representable with available bits | The number is too big for the bits to store |
Binary and data representation appear in the Create Task when you describe how your program stores or processes data. Understanding that all data is binary helps you articulate what your program does at a fundamental level. See the Create Task module →
Get a free AP CSP question every day
Join 3,000+ students. Daily practice questions, study tips, and exam strategies.
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Frequently Asked Questions
🔗 Continue studying AP CSP
The Superpack includes a lesson plan for binary numbers, editable slides with the place value table, and a unit test with answer key. View what's included →
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]