zuai-logo

Binary Numbers

Chloe Evans

Chloe Evans

9 min read

Listen to this study note

Study Guide Overview

This AP Computer Science Principles study guide covers data representation concepts, including: number bases (decimal, binary, hexadecimal), bit representation (ASCII and Unicode), abstraction, analog vs. digital data (sampling), and overflow/rounding errors. It also provides practice questions and exam tips.

AP Computer Science Principles: Data Representation Study Guide

Hey there! Let's get you prepped for the AP CSP exam. This guide is designed to be your go-to resource, especially the night before the test. We'll break down the key concepts, highlight important connections, and make sure you're feeling confident. Let's do this!

💾 Data Basics and Number Systems

What is Data?

Data is simply a collection of facts. It's everywhere, from lab results to your favorite videos. Computers run on data, but how do they store it? Let's dive in!

How Computers Store Data

Computers store data in bits, which are binary digits (0s and 1s). To understand this, we need to talk about number bases.

Number Bases

A number base is the number of digits or digit combinations a system uses to represent values.

  • Decimal (Base-10): Uses 0-9. This is what we use in everyday life.
  • Binary (Base-2): Uses only 0 and 1. This is what computers use at their core.
  • Hexadecimal (Base-16): Uses 0-9 and A-F. Often used for color codes and representing binary in a more human-friendly way.
Key Concept

Computers use binary (base-2) at their core, but we often use hexadecimal (base-16) to represent binary values in a more human-friendly way.

Decimal System (Base-10)

Remember place values? Ones, tens, hundreds, thousands, etc. Each place is a power of 10. markdown-image

For example, 5,729 = (5 x 1000) + (7 x 100) + (2 x 10) + (9 x 1)

Binary System (Base-2)

Each place can only hold a 0 or 1. The place values are powers of 2: ones, twos, fours, eights, etc.

markdown-image

For example, binary 0101 = (0 x 8) + (1 x 4) + (0 x 2) + (1 x 1) = 5

Memory Aid

Binary Place Values: Remember the powers of 2: 1, 2, 4, 8, 16, 32, 64, 128... Each 'place' in a binary number represents one of these values.

  • Bit: A single binary digit (0 or 1).
  • Byte: 8 bits.

markdown-image

Hexadecimal System (Base-16)

Uses 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Place values are powers of 16. ![](https://zupay.blob.core.windows.net/resources/files/0baca4f69800419293b4c75aa2870acd_76ff10_3948.png?alt=media&token=3c84188d-e352-43e8-8793-541aa3d9e3b9...