Topic 2.1: Binary Numbers | AP CSP Big Idea 2 | APCSExamPrep.com

AP CSP Course Big Idea 2 2.1 Binary Numbers
2.1
Big Idea 2 • Data (DAT)

Binary Numbers

🕐 ~25 min FREE 📖 4 MCQ practice questions 🎮 Binary Switch game + timer DAT-1.A • DAT-1.B • DAT-1.C

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
📈 Exam weight: Topic 2.1 is the calculation-heavy topic of BI2. Expect 2–3 direct binary conversion questions on the AP exam — one of the few topics with actual math.
💡 Think about this first

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.

🎯 Exam tip

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.

⚠ Classic AP exam trap: values vs. maximum value

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
📋 Create Task connection

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 →

📈
MCQ Practice
4 questions • AP exam difficulty • Instant feedback
Question 1 of 4
A system uses 4 bits to store non-negative integers. Which of the following is true?
Incorrect. 4 bits can represent 2^4 = 16 values, but those values range from 0 to 15. The maximum value is 15, not 16.
Incorrect. 4 bits can represent 2^4 = 16 unique values. The maximum value is 15, but the count of values is 16.
Correct. 4 bits = 2^4 = 16 unique values: 0 through 15. The count is 16. The maximum value is 15. Both facts must be correct.
Incorrect. Place values for 4 bits are 8, 4, 2, 1. Maximum value (all bits = 1) is 8+4+2+1 = 15.
Question 2 of 4
Which of the following correctly converts the binary number 10101 to decimal?
Incorrect. Reading binary digits as decimal gives 10101, not the converted value.
Correct. 10101: (1x16)+(0x8)+(1x4)+(0x2)+(1x1) = 16+0+4+0+1 = 21.
Incorrect. This is double the correct answer. Check place values: 16, 8, 4, 2, 1 for 5 bits.
Incorrect. Verify each bit: bit4=16, bit3=0, bit2=4, bit1=0, bit0=1. Total = 21.
Question 3 of 4
A game runs at 60 fps. A filmmaker argues 60 fps digital video cannot perfectly replicate real motion. Which BEST explains why?
Incorrect. Processing speed is not the reason. The issue is discrete vs. continuous.
Correct. Real motion is continuous (analog). Digital video captures discrete still frames. No matter how many fps, infinite states between frames are lost. Digital is always an approximation.
Incorrect. Whether humans perceive the difference is separate from whether information is lost. Information is always lost in analog-to-digital conversion.
Incorrect. Compression is separate. Even uncompressed digital video is an approximation of analog.
Question 4 of 4
The binary number 11111111 represents what decimal value?
Incorrect. 128 is just the leftmost bit. Add all 8: 128+64+32+16+8+4+2+1.
Incorrect. 127 = 01111111. You are missing the leftmost bit (128).
Correct. 128+64+32+16+8+4+2+1 = 255. Maximum for 8 bits. Remember: 8 bits = 256 values (0-255), max = 255.
Incorrect. 256 = 100000000 which requires 9 bits. 11111111 (8 bits) maxes at 255.
🎮 Lesson Game
Binary Switch
Toggle bits to build numbers • Fill-in-the-blank conversions • Count-up timer
0
Correct
0:00
⏱ Time
1/10
Question
📈 Place Value Reference
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
128 64 32 16 8 4 2 1
Convert this number to binary by flipping the switches:
Click a switch to toggle it ON (1) or OFF (0)
Your value: 0
00000000
What is the decimal value of this binary number?
0/10
⏱ 0:00
correct • your time

Frequently Asked Questions

N bits stores 2^N unique values. Maximum value = 2^N − 1 (values start at 0). 4 bits = 16 values (0–15), max = 15. 8 bits = 256 values (0–255), max = 255. This distinction is a classic AP trap.
Use place values (128, 64, 32, 16, 8, 4, 2, 1 from left to right). Multiply each bit by its place value, add results. For 10110: (1x16)+(0x8)+(1x4)+(1x2)+(0x1) = 22. The Binary Switch game drills this faster than any other method.
Analog is continuous, infinite precision. Digital captures discrete samples at intervals. Information between samples is permanently lost. Higher sampling rates (more fps, higher Hz) produce better approximations but never exact copies.
60fps gaming = 60 still images per second assembled into the illusion of motion. Your brain fills the gaps. Digital audio works the same: a sound wave (analog) sampled thousands of times per second (digital). More samples = better approximation = more data. This is exactly how analog-to-digital conversion works.
📦
AP CSP Teacher SuperpackSlides, lesson plans, tests + answer keys for all 5 Big Ideas — $249
Get the Superpack →
🏫
For teachers

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.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]