AP Computer Science Principles Practice Quiz: Binary Numbers
Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026
Test your understanding with short quizzes. This quiz has 16 questions to check your progress.
Question 1 of 16
All Questions (16)
A) Byte
B) Bit
C) Decimal
D) Analog
Correct Answer: B
The provided content states, 'Bit is shorthand for binary digit and is either 0 or 1.'
A) 2
B) 8
C) 10
D) 16
Correct Answer: B
The content explicitly defines a byte: 'A byte is 8 bits.'
A) 9
B) 11
C) 13
D) 14
Correct Answer: C
To convert 1101 from binary to decimal, we use place values: (1 * 2^3) + (1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 8 + 4 + 0 + 1 = 13.
A) 1001
B) 1010
C) 1100
D) 0101
Correct Answer: B
The decimal number 10 can be represented in binary as the sum of powers of 2: 8 + 2, which corresponds to 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0, or 1010 in binary.
A) Round-off error
B) Sampling error
C) Abstraction error
D) Overflow error
Correct Answer: D
The content states that when using a fixed number of bits for integers, 'This limitation can result in overflow or other errors.' This happens when the result of a mathematical operation exceeds the maximum value that can be represented.
A) Sampling
B) Abstraction
C) Overflow
D) Conversion
Correct Answer: B
The content defines abstraction as 'the process of reducing complexity by focusing on the main idea. By hiding details irrelevant to the question at hand... abstraction reduces complexity'.
A) The number of students in a class.
B) The text in a book.
C) The volume of music, which changes smoothly.
D) A value represented by a sequence of 0s and 1s.
Correct Answer: C
The content states that 'Analog data have values that change smoothly, rather than in discrete intervals, over time.' It provides 'pitch and volume of music' as a specific example.
A) All data is ultimately analog.
B) Overflow errors are unavoidable.
C) The same sequence of bits may represent different types of data in different contexts.
D) A byte must always represent a number.
Correct Answer: C
This scenario is a direct application of the principle that 'The same sequence of bits may represent different types of data in different contexts.' The context (image file vs. executable file) determines the meaning of the bits.
A) Abstraction
B) Overflowing
C) Rounding-off
D) Sampling
Correct Answer: D
The content defines this process directly: 'Analog data can be closely approximated digitally using a sampling technique, which means measuring values of the analog signal at regular intervals called samples.'
A) Overflow error
B) Round-off error
C) Syntax error
D) Analog error
Correct Answer: B
The content explains that 'the fixed number of bits used to represent real numbers limits the range and mathematical operations on these values; this limitation can result in round-off and other errors.' Representing an infinitely repeating decimal is a classic example of this.
A) 10111
B) 11001
C) 11010
D) 10011
Correct Answer: C
To compare binary numbers, we compare them from the leftmost bit. B and C both start with '110', so they are larger than A and D. Comparing B (11001) and C (11010) at the fourth bit, C has a '1' while B has a '0', making C the larger number. (Values are A=23, B=25, C=26, D=19).
A) Overflow
B) Integer limitation
C) Abstraction
D) Byte-ordering
Correct Answer: C
The content explicitly states, 'The use of digital data to approximate real-world analog data is an example of abstraction.' It simplifies the smooth, infinite detail of the analog world into manageable digital components.
A) 2^0, which is 1
B) 2^1, which is 2
C) 2^2, which is 4
D) 2^3, which is 8
Correct Answer: D
Positions are numbered starting at the rightmost position with 0. In 1010, the positions from right to left are 0, 1, 2, 3. The leftmost '1' is in position 3. The place value is the base (2) raised to the power of the position (3), which is 2^3 or 8.
A) A form of sampling
B) An analog representation
C) A data constant
D) An abstraction
Correct Answer: D
The content states that 'Other programming languages provide an abstraction through which the size of representable integers is limited only by the size of the computer’s memory'. This hides the complexity of fixed-size hardware registers, which is the essence of abstraction.
A) Binary (base 2)
B) Decimal (base 10)
C) Analog (base A)
D) Byte (base 8)
Correct Answer: A
The provided text clearly states, 'Binary (base 2) uses only combinations of the digits zero and one.'
A) It allows for perfect representation of all real-world analog data.
B) It removes the need for abstraction in programming.
C) It limits the range of values that can be represented, which can lead to errors like overflow or round-off.
D) It ensures that every sequence of bits has only one possible meaning.
Correct Answer: C
The content explicitly discusses the consequences of fixed-bit representations for both integers and real numbers, stating that these limitations can result in 'overflow' for integers and 'round-off and other errors' for real numbers.