AP CSP Topic 2.1 Guided Notes - Binary Numbers

Big Idea 2: Data · Topic 2.1 · Guided Notes (Student)

Binary Numbers — Guided Notes

Fill these in during class or catch up here if you were absent. Print this page or work on paper — then check yourself with the CFUs on the Topic 2.1 page.

Print these notesTopic 2.1 lesson pageAll CSP topics

Day 1: Everything Is a Number

Today’s objectives

  • Explain how all data — numbers, text, colors, sound — can be represented using sequences of bits, and why the same bits can mean different things in different contexts (LO DAT-1.A)
  • Explain the two consequences of using a fixed number of bits: integer overflow and round-off error (LO DAT-1.B)

Bell ringer

You must send a friend tomorrow's temperature — but your only communication channel is a row of 8 light switches, each either ON or OFF. The temperature will be a whole number between 0 and 100.

Write 3–5 sentences: design a scheme your friend could decode. Could your 8 switches handle a temperature of 300? What about 72.5? What breaks?

01. Representing Data with Bits

Key Vocabulary (LO DAT-1.A)

Term Definition (write it)
Bit
Byte
Abstraction
Analog data
Sampling

One Alphabet, Every Kind of Data

  • Bits are grouped to represent .
  • The same sequence of bits can mean different things because .
  • Renaming a .png file to .txt shows garbage because .

Analog World, Digital Machine

Analog

Digital (sampled)

  • Analog data changes .
  • Sampling means measuring the analog signal at .
  • Sampling more often makes the digital copy .

AP TIP: If a question says a real-world signal is 'measured at regular intervals,' it is describing sampling — the analog-to-digital bridge.

Watch out — “The Computer Stores a Tiny Picture”

Myth: Images, sounds, and videos are stored as miniature pictures and recordings inside the computer — only numbers are stored 'in binary.'

Explain why this is wrong:

Stop and think

  1. A friend claims their computer 'stores photos differently from numbers.' In two sentences, correct them using the word abstraction.
  2. The bit sequence 01000001 shows up in two different files. In one it displays as 'A'; in the other it contributes to a pixel. Explain how both can be true.
  3. A vinyl record is analog; a streaming file is digital. Describe what sampling does in the trip from one to the other.

Answer in complete sentences. Then check yourself with the matching CFUs on the Topic 2.1 page.

02. The Cost of Finite Bits

Two Failure Modes, One Root Cause

Integer overflow

Round-off error

  • Integer overflow: the value is too for its fixed number of bits.
  • Round-off error: many real numbers are stored as .
  • Both failures share one root cause: .

AP TIP: Overflow = too BIG for the bits. Round-off = too PRECISE for the bits. Name the failure mode by asking which limit was hit.

Finite Bits in the Wild

Same two failure modes, four real scenarios. For each: which consequence is it?

Complete the empty cells.

Scenario What happened Failure mode
A game stores your score in 8 bits; at 255 the next point shows 0 Value exceeded the maximum the bits can hold and wrapped
0.1 + 0.2 prints as 0.30000000000000004 0.1 and 0.2 have no exact binary form; tiny errors accumulated
A 2014 video's view counter froze at 2,147,483,647 until the site widened it The count hit the maximum of its fixed bit-width
A physics program's repeated calculations drift slightly from the exact answer Each floating-point step stored an approximation

Stop and think

  1. A fitness tracker stores daily steps in 16 bits (max 65,535). An ultramarathoner logs 70,000 steps and the app shows 4,464. Name the consequence and explain the number shown.
  2. A banking app computes interest and is off by a fraction of a cent after millions of accounts. Which consequence is this, and why does it grow with repetition?
  3. In one sentence: what single fact about binary representation causes BOTH failure modes?

Answer in complete sentences. Then check yourself with the matching CFUs on the Topic 2.1 page.

Today in one box

  • Everything a computer stores is bits — grouped bits represent numbers, text, colors, and sound
  • The same bits mean different things in different contexts — the format is the contract
  • Analog reality enters the digital world by sampling at regular intervals
  • Fixed bits buy two failure modes: overflow (too big) and round-off (too precise)

Before next class: Before tomorrow, try to crack it: your locker code is 1101 in binary. What number is it? Bring a guess — and your reasoning.

Day 2: Reading the Machine's Language

Today’s objectives

  • Convert a positive integer from decimal to binary AND from binary to decimal using place value (LO DAT-1.C)
  • Compare and order binary numbers — with and without full conversion (LO DAT-1.C)

Bell ringer

Yesterday's teaser: your locker code is 1101 in binary. Three classmates claim it's 13, 1,101, and 5.

Who's right? Write down how you decided — and what mistake each wrong classmate made.

01. Binary ↔ Decimal Conversion

Place Value: The Only Rule You Need

  • Binary is base 2 and uses only the digits .
  • Reading right to left, the binary place values are .

Both Directions, Worked

Direction 1: binary → decimal (add the place values under each 1). Direction 2: decimal → binary (subtract the largest power of 2 that fits, repeat).

Complete the empty cells.

Step Binary → Decimal: 1 1 0 1 Decimal → Binary: 22
1 Write place values under the bits: 8 4 2 1 Largest power of 2 ≤ 22 is 16 → write a 1 there
2 Keep the values under each 1: 8, 4, and 1 22 − 16 = 6. Largest power ≤ 6 is 4 → another 1
3 Skip the value under the 0 (the 2) 6 − 4 = 2. Largest power ≤ 2 is 2 → another 1
4 2 − 2 = 0 → fill unused places (8s, 1s) with 0
5

Watch out — “Binary 11 Is Eleven”

Myth: You read a binary number by pronouncing its digits as if they were decimal — so 11 is 'eleven' and 101 is 'one hundred one.'

Explain why this is wrong:

Deep Dive · Beyond the AP Exam

Deep Dive: Why Programmers Love Base 16

The problem with raw binary

The hexadecimal fix

  • One hexadecimal digit stands for exactly bits.
  • Web color codes like #FF0080 are really .

Every #RRGGBB color code you've ever seen in a web page is hexadecimal-wrapped binary.

Stop and think

  1. Convert binary 10110 to decimal. Write the place values under the bits before you add.
  2. Convert decimal 41 to binary using repeated subtraction of powers of 2. Show each subtraction.
  3. A classmate says binary 1000 is 'one thousand.' Give the correct value and name the habit that prevents this mistake.
  4. Without fully converting, order the binary numbers 1010, 111, and 1101 from least to greatest, and explain the place-value shortcut you used.

Show every step. Then check yourself with the matching CFUs on the Topic 2.1 page.

Common AP Traps

Three ways Topic 2.1 loses points on the exam — one minute now, real points in May.

Overflow vs. round-off — in your own words:

Reading binary as decimal — in your own words:

Same bits vs. same meaning — in your own words:

Binary Numbers, in One Slide

  • Computers store exactly one thing: bits. Grouped bits represent numbers, text, colors, sound — abstraction.
  • The same bits mean different things in different contexts — the file format is the contract.
  • Analog signals enter the digital world by sampling: measurements at regular intervals.
  • Fixed bits ⇒ two failure modes: overflow (too big) and round-off (too precise).
  • Conversion is place value: powers of 2 under the bits, add under the 1s; reverse with repeated subtraction (LO DAT-1.C).

Exit check — I can…

  • ☐  explain how bits represent every kind of data (LO DAT-1.A)
  • ☐  tell overflow from round-off and name which limit was hit (LO DAT-1.B)
  • ☐  convert between binary and decimal in both directions (LO DAT-1.C)
  • ☐  compare and order binary numbers (LO DAT-1.C)

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]