PrepGo

AP Computer Science Principles Flashcards: Binary Numbers

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026

Review key ideas with interactive flashcards. This set includes 36 cards to help you master important concepts.

How are bits used to create abstractions?
Bits are grouped together to represent abstractions, such as numbers, characters, and colors.
Card 1 of 36

All Flashcards (36)

How are bits used to create abstractions?
Bits are grouped together to represent abstractions, such as numbers, characters, and colors.
In binary, what does a digit's position in the sequence determine?
As with decimal, a digit’s position in the binary sequence determines its numeric value through its place value (a power of 2).
What are three ways data values can be stored in a program?
Data values can be stored in variables, lists of items, or as standalone constants.
Why might a digital photo of a painting not capture the exact colors of the original?
The colors of a painting are analog data. A digital photo approximates these colors using a finite set of bits, which is an abstraction that can result in loss of precision.
What is analog data?
Analog data has values that change smoothly, rather than in discrete intervals, over time.
What is sampling in the context of data?
Sampling is a technique that measures values of an analog signal at regular intervals to approximate it digitally.
What is the decimal number system?
Decimal is a base-10 number system that uses combinations of the digits 0 through 9.
What is a round-off error?
A round-off error occurs because some real numbers must be stored as approximations due to the limited number of bits available.
If a specific sequence of 8 bits represents the number 65, what else could it represent in a different context?
The same sequence of bits could represent a different type of data, such as the character 'A' in the ASCII standard or a specific color.
How can data values be moved between different parts of a program?
Data values can be passed as input to procedures or returned as output from procedures.
Give an example of analog data from the real world.
Examples of analog data include the pitch and volume of music, the colors of a painting, or the position of a sprinter during a race.
How is the place value of a digit determined in a number system?
The place value is the base raised to the power of the position, where the rightmost position is 0.
How do computing devices represent data?
Computing devices represent data digitally, meaning that the lowest-level components of any value are bits.
What is a bit?
A bit is shorthand for a binary digit and can have a value of either 0 or 1.
Calculate the binary (base 2) equivalent of the positive integer 10 (base 10).
The binary equivalent is 1010.
What is the place value of the leftmost '1' in the binary number 10000?
The place value is 16. The position is 4 (counting from 0 on the right), so the value is 2^4.
What is the binary number system?
Binary is a base-2 number system that uses only combinations of the digits zero and one.
What is an overflow error?
An overflow error occurs when a computed result is too large to fit into the fixed number of bits allocated for it.
What is a consequence of using a fixed number of bits for real numbers?
The fixed number of bits limits the range and precision of real numbers, which can result in round-off and other errors.
What is a consequence of using a fixed number of bits to represent integers?
Using a fixed number of bits limits the range of integer values, which can result in overflow or other errors.
How is the numeric value of a binary sequence calculated?
The numeric value is the sum of each bit's value (0 or 1) multiplied by the place value of its position.
A system uses 4 bits to represent positive integers. What happens when it tries to calculate 10 + 7 (1010 + 0111)?
An overflow error will occur. The result is 17 (10001), which requires 5 bits and cannot be stored in the 4 bits available.
What is the fundamental building block for all digitally represented data?
The bit (binary digit) is the lowest-level component and fundamental building block of any digitally represented value.
What is a byte?
A byte is a sequence of 8 bits.
How do some programming languages handle large integers to avoid overflow?
They provide an abstraction where the size of representable integers is limited only by the computer’s memory, not a fixed number of bits.
Explain the relationship between bits and data representation.
All data in a computer is represented using bits. Groups of bits are used as an abstraction to represent more complex data like numbers and text.
What is abstraction?
Abstraction is the process of reducing complexity by focusing on the main idea and hiding details irrelevant to the question at hand.
Calculate the decimal (base 10) equivalent of the binary number 1101.
The decimal equivalent is 13. (1*2^3) + (1*2^2) + (0*2^1) + (1*2^0) = 8 + 4 + 0 + 1 = 13.
How is the digital approximation of analog data an example of abstraction?
The use of digital data to approximate real-world analog data is an example of abstraction because it simplifies the continuous nature of the data into discrete values.
Can the same sequence of bits represent different types of data?
Yes, the same sequence of bits may represent different types of data in different contexts.
Does the language defined in the AP exam reference sheet use a fixed number of bits for integers?
No, it provides an abstraction where integer size is limited only by the computer's memory to avoid overflow.
What is the main purpose of abstraction when representing data?
Abstraction reduces complexity by hiding the low-level details of bits and bytes, allowing one to focus on the data's meaning, like a number or character.
A program stores the result of 1/3. Why might this value be slightly inaccurate when used in later calculations?
This can cause a round-off error. Since 1/3 is a repeating decimal, it must be stored as an approximation due to the fixed number of bits used to represent real numbers.
Which binary number is larger: 10110 or 10011?
10110 is larger. Comparing from the left, the third bit (1) in 10110 is greater than the third bit (0) in 10011.
Why are number bases like binary and decimal important for representing data?
Number bases are used to represent data; binary is the fundamental system for computers, while decimal is more commonly used by humans.
What does it mean for data to be represented 'digitally'?
Data is represented digitally when its lowest-level components are discrete values, specifically bits (0s and 1s).