PrepGo

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

What is the term for a single binary digit, which can be either a 0 or a 1?

All Questions (16)

What is the term for a single binary digit, which can be either a 0 or a 1?

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.'

According to the provided information, how many bits are in a single byte?

A) 2

B) 8

C) 10

D) 16

Correct Answer: B

The content explicitly defines a byte: 'A byte is 8 bits.'

What is the decimal (base 10) equivalent of the binary (base 2) number 1101?

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.

What is the binary (base 2) equivalent of the positive integer 10 (base 10)?

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 program uses a fixed number of bits to represent integers. When an operation results in a number that is too large to be represented, an error occurs. What is this type of error called?

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.

The process of reducing complexity by hiding irrelevant details and focusing on the main idea is known as:

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'.

Which of the following is an example of analog data?

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 digital image file and a program's executable file can both contain the exact same sequence of bits, yet they represent completely different things (a color and a machine instruction). This illustrates which key concept?

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.

The technique of measuring values of an analog signal at regular intervals to approximate it digitally is called:

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.'

In a computer program, a calculation involving a real number like 1/3.0 results in the stored value 0.333333333. This is not the exact value, but a close approximation. This limitation is a consequence of using a fixed number of bits and can lead to what kind of error?

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.

Which of the following binary numbers has the largest numeric value?

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).

Using a digital representation, such as pixels for a painting or samples for a sound wave, to approximate a real-world analog phenomenon is a powerful application of which computing concept?

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.

In the binary number 1010, what is the place value of the leftmost '1'?

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.

Some programming languages, like the one on the exam reference sheet, allow integers to grow as large as the computer's memory can hold, thus avoiding overflow errors. This feature, which hides the underlying fixed-bit hardware limitations from the programmer, is best described as:

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.

Which number base uses only combinations of the digits 0 and 1?

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.'

Which of the following statements best explains a consequence of using a fixed number of bits to represent data?

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.