Home

Tutoring

Subjects

Live Classes

Study Coach

Essay Review

On-Demand Courses

Colleges

Games


Sign up

Log in

Opening subject page...

Loading your content

Practice

  • All Subjects
  • Algebra Flashcards
  • SAT Math Practice Tests
  • Math Question of the Day
  • Live Classes
  • On-Demand Courses

Varsity Tutors

  • Find a Tutor
  • Test Prep
  • Online Classes
  • K-12 Learning
  • College Search
  • VarsityTutors.com

© 2026 Varsity Tutors. All rights reserved.

← Back to quizzes

AP Computer Science Principles Quiz

AP Computer Science Principles Quiz: Binary Numbers

Practice Binary Numbers in AP Computer Science Principles with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.

Question 1 / 20

0 of 20 answered

A program stores a fractional number like 2/32/32/3 using a fixed number of bits. Because 2/32/32/3 is a repeating decimal (0.666...), it is stored as an approximation. This type of inaccuracy is best described as which of the following?

Select an answer to continue

What this quiz covers

This quiz focuses on Binary Numbers, giving you a quick way to practice the rules, question types, and explanations that matter most for AP Computer Science Principles.

How to use this quiz

Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.

All questions

Question 1

A program stores a fractional number like 2/32/32/3 using a fixed number of bits. Because 2/32/32/3 is a repeating decimal (0.666...), it is stored as an approximation. This type of inaccuracy is best described as which of the following?

  1. An overflow error, because the number is too large to store.
  2. A round-off error, because the number cannot be precisely represented. (correct answer)
  3. A logic error, because the programmer made a mistake in the algorithm.
  4. A compilation error, because the programming language does not support fractions.

Explanation: A round-off error occurs when a value cannot be stored with perfect precision due to the limitations of a fixed-bit representation. This is common for real numbers with repeating decimal expansions.

Question 2

The 8-bit sequence 01000001 is stored in a computer's memory. Which of the following statements is most accurate about what this bit sequence represents?

  1. It definitively represents the decimal number 65, as this is the direct mathematical conversion.
  2. It must represent the character 'A', as this is its standard ASCII encoding.
  3. It is a processor instruction and cannot be interpreted as a data value like a number or character.
  4. It could represent the number 65, the character 'A', or a color component, depending on the program's context. (correct answer)

Explanation: The same sequence of bits can represent different types of data. The interpretation depends entirely on the context provided by the software that is reading the memory. While 01000001 is the binary for decimal 65 and the ASCII code for 'A', it could also be part of an image file, a machine instruction, or other data type.

Question 3

Which of the following describes a limitation of representing analog data, such as a photograph, with a finite number of bits?

  1. The digital representation can be exactly identical to the original analog data.
  2. The digital data can only be an approximation of the original analog data. (correct answer)
  3. The digital representation is always larger in file size than the original analog source.
  4. The digital data cannot be compressed without completely losing the original information.

Explanation: Analog data is continuous, while digital data is discrete. When converting from analog to digital (e.g., scanning a photo), the process involves sampling and quantization, which uses a finite number of bits. This means the digital version is an approximation, and some information from the original continuous source is inherently lost.

Question 4

A digital music file is created by measuring the amplitude of an analog sound wave at regular time intervals and storing these measurements as binary values. What is this process called?

  1. Compression
  2. Sampling (correct answer)
  3. Encryption
  4. Binary searching

Explanation: Sampling is the process of converting a continuous analog signal into a discrete sequence of digital values by taking measurements at regular intervals. This is a fundamental step in digitizing analog data like audio or video.

Question 5

Binary Basics passage: Binary is a base-2 system using only 0 and 1, while decimal is base-10 using digits 0–9. For instance, decimal 6 is binary 110. Computers use binary states (off/on) as bits, and group bits into bytes to store and process data. According to the text, How does binary differ from the decimal system?

  1. Binary uses digits 0–9 like decimal
  2. Binary is base-2 using only 0 and 1 (correct answer)
  3. Binary is base-10, but written with fewer digits
  4. Binary always writes digits in reverse order

Explanation: This question tests understanding of binary numbers and their application in computing, specifically the fundamental differences between binary and decimal number systems. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage clearly states that binary is base-2 using only 0 and 1, while decimal is base-10 using digits 0-9, establishing the key distinction between these systems. Choice B is correct because it accurately identifies binary as a base-2 system using only digits 0 and 1, which directly matches the passage's explanation. Choice A is incorrect because it suggests binary uses the same digits (0-9) as decimal, which contradicts the fundamental definition of binary as using only two digits. To help students: Emphasize the concept of different number bases and how the base determines the available digits. Use comparison charts showing decimal (base-10) versus binary (base-2) to reinforce the limited digit set in binary and practice identifying which digits are valid in each system.

Question 6

Binary in Computing passage: Computers represent information with bits that can be 0 or 1, like switches that are off or on. Eight bits make a byte, and bytes can encode numbers and characters. For example, decimal 10 is binary 1010. This base-2 structure makes storage and processing reliable in hardware. Based on the passage, Why are binary numbers used in computer systems?

  1. They match off/on hardware states for bits (correct answer)
  2. They are more accurate than decimal numbers
  3. They use digits 0–9, so they are faster
  4. They are used only for graphics and images

Explanation: This question tests understanding of binary numbers and their application in computing, specifically why computers use binary representation for data storage and processing. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage explains that computers represent information with bits that can be 0 or 1, like switches that are off or on, making binary ideal for hardware implementation. Choice A is correct because it accurately reflects how binary digits (0 and 1) correspond to the physical on/off states in computer hardware, making data storage and processing reliable. Choice C is incorrect because it claims binary uses digits 0-9, which is false - binary only uses 0 and 1, and this fundamental misunderstanding would lead to confusion about why computers use binary. To help students: Emphasize the connection between binary digits and physical hardware states (voltage levels, magnetic fields, etc.). Use hands-on demonstrations with switches or LEDs to show how binary states map to physical on/off conditions in computer circuits.

Question 7

Binary in Computing passage: In memory, data is stored as bits with values 0 or 1, grouped into bytes. These bit patterns can represent numbers (like decimal 10 as binary 1010) and characters, letting the CPU store and process information efficiently. Based on the passage, In the passage, how is data represented in binary?

  1. As letters directly, without any bit patterns
  2. As bits (0/1) grouped into bytes (correct answer)
  3. As decimal digits 0–9 stored in memory cells
  4. As reversed digits so hardware can read them

Explanation: This question tests understanding of binary numbers and their application in computing, specifically how computers store and represent data using binary systems. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage clearly states that data is stored as bits with values 0 or 1, grouped into bytes, and these bit patterns can represent both numbers and characters. Choice B is correct because it accurately describes how data is represented as bits (0/1) grouped into bytes, which aligns with the passage's explanation of binary data storage. Choice C is incorrect because it suggests data is stored as decimal digits 0-9, which contradicts the fundamental principle that computers use binary (base-2) representation, not decimal (base-10). To help students: Emphasize the hierarchical organization of binary data from bits to bytes to larger units. Use visual representations showing how groups of 8 bits form a byte and how these bytes can encode different types of information like numbers and text characters.

Question 8

Binary in Computing passage: A computer stores information as bits, each bit being 0 or 1. Bits are grouped into bytes, and these patterns can represent numbers and characters; for example, decimal 10 is binary 1010. The CPU processes these bit patterns to run programs. According to the text, In the passage, how is data represented in binary?

  1. As base-10 digits stored exactly as typed
  2. As bits (0/1) arranged into bytes (correct answer)
  3. As pictures that the CPU reads directly
  4. As symbols that do not need any encoding

Explanation: This question tests understanding of binary numbers and their application in computing, specifically how computers internally represent and store various types of data. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage explains that computers store information as bits (each being 0 or 1) that are grouped into bytes, and these bit patterns can represent both numbers and characters. Choice B is correct because it accurately describes data representation as bits (0/1) arranged into bytes, which matches the passage's description of how computers store information. Choice A is incorrect because it suggests data is stored as base-10 digits exactly as typed, which contradicts the fundamental principle that all data in computers is ultimately stored in binary format. To help students: Emphasize that ALL data in computers, regardless of how it appears to users, is stored as binary patterns. Use encoding examples to show how text, numbers, and other data types are converted to and from binary representation.

Question 9

Binary Arithmetic passage: Binary addition follows base-2 rules: 0+0=0, 0+1=1, and 1+1=10 (carry 1). Example in the text: 101 + 110 = 1011. This is similar to decimal carrying, but with only two digits. According to the text, What is the result of the binary addition of 101 and 110?

  1. 1000
  2. 1011 (correct answer)
  3. 1111
  4. 211

Explanation: This question tests understanding of binary numbers and their application in computing, specifically performing binary arithmetic operations with carrying. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage provides the exact calculation showing that 101 + 110 = 1011, demonstrating the binary addition rules including the carry operation when 1+1=10. Choice B is correct because it matches the result 1011 given in the passage for the binary addition of 101 and 110. Choice D (211) is incorrect because it contains the digit 2, which is impossible in binary - this error suggests the student added without considering that binary only uses digits 0 and 1. To help students: Emphasize that binary can only contain digits 0 and 1, never 2 or higher. Practice binary addition step-by-step, showing how carries work differently than in decimal, and have students check their answers for invalid digits.

Question 10

Binary Basics passage: Binary is base-2 and uses only 0 and 1, unlike decimal base-10. A quick example is decimal 10 written as binary 1010. Computers use these 0/1 states as bits for storage and processing, often grouping bits into bytes. According to the text, What is the binary representation of the decimal number 10?

  1. 1010 (correct answer)
  2. 10
  3. 10010
  4. 0101

Explanation: This question tests understanding of binary numbers and their application in computing, specifically converting between decimal and binary number systems. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage explicitly states that decimal 10 is written as binary 1010, providing a direct example of decimal-to-binary conversion. Choice A is correct because it shows 1010, which the passage specifically identifies as the binary representation of decimal 10. Choice B is incorrect because it shows 10, which is the decimal representation, not the binary representation - this is a common error when students forget to perform the conversion. To help students: Emphasize the importance of carefully reading whether a number is in decimal or binary format. Practice conversion techniques using division by 2 or place value methods, and always verify conversions by converting back to check the answer.

Question 11

Binary in Computing passage: Binary is base-2, so each bit is either 0 or 1, like a light switch off or on. Computers store many bits in memory and process them in the CPU; eight bits form a byte. For example, decimal 3 is binary 11. Based on the passage, Why are binary numbers used in computer systems?

  1. They allow storing data as off/on bit states (correct answer)
  2. They require no memory because they are shorter
  3. They are base-10, matching everyday counting
  4. They can represent any character directly as a letter

Explanation: This question tests understanding of binary numbers and their application in computing, specifically the practical reasons why computers utilize binary number systems. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage explains that binary digits correspond to physical states like a light switch being off (0) or on (1), making it ideal for electronic circuits. Choice A is correct because it accurately identifies that binary allows storing data as off/on bit states, which directly relates to the passage's switch analogy and hardware implementation. Choice C is incorrect because it claims binary is base-10, which is fundamentally wrong - binary is base-2, and this misconception would prevent understanding of why computers use binary. To help students: Emphasize the physical nature of computer hardware and how binary maps to electrical states. Use analogies like light switches, transistors, or voltage levels to help students understand why binary is the natural choice for digital systems.

Question 12

Binary Arithmetic passage: Binary uses base-2 digits 0 and 1. When adding, 1+1 becomes 10 (write 0, carry 1). Example: 101 + 110 equals 1011. Computers perform this bit-by-bit addition to process data stored in memory. According to the text, What is the result of the binary addition of 101 and 110?

  1. 111
  2. 1011 (correct answer)
  3. 1100
  4. 11

Explanation: This question tests understanding of binary numbers and their application in computing, specifically how to perform binary addition operations. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage provides a specific example showing that 101 + 110 equals 1011, demonstrating the binary addition process with carrying. Choice B is correct because it matches the result given in the passage for the binary addition of 101 and 110, which is 1011. Choice A (111) is incorrect because it represents a different value and suggests the student may have made errors in the carrying process during binary addition. To help students: Emphasize the importance of understanding binary addition rules, especially that 1+1=10 in binary (write 0, carry 1). Provide step-by-step practice problems showing column addition with carrying, and use visual aids to track carries across place values.

Question 13

Binary Basics passage: Decimal is base-10 with digits 0–9, while binary is base-2 with digits 0 and 1. For example, decimal 4 is binary 100. Computers rely on binary because circuits can easily represent two states, storing data as bits and bytes. Based on the passage, How does binary differ from the decimal system?

  1. Binary uses base-2 with only 0 and 1 (correct answer)
  2. Binary uses base-10 with digits 0–9
  3. Binary stores numbers without place value
  4. Binary is a coding system used only in networks

Explanation: This question tests understanding of binary numbers and their application in computing, specifically the fundamental characteristics that distinguish binary from decimal number systems. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. The passage clearly contrasts decimal as base-10 with digits 0-9 against binary as base-2 with only digits 0 and 1, establishing the core difference. Choice A is correct because it accurately states that binary uses base-2 with only 0 and 1, which directly reflects the passage's explanation of the binary system. Choice B is incorrect because it claims binary uses base-10 with digits 0-9, which actually describes the decimal system, not binary - this represents a complete reversal of the concepts. To help students: Emphasize the relationship between a number system's base and its available digits (base-2 uses 2 digits, base-10 uses 10 digits). Create comparison tables showing valid digits for each system and practice identifying which number system is being used based on the digits present.

Question 14

Binary Basics passage: Binary is a base-2 system using only 0 and 1, unlike decimal (base-10) using 0–9. For example, decimal 10 equals binary 1010. Computers store and process data as bits (0/1) grouped into bytes, representing numbers and characters. Based on the passage, What is the binary representation of the decimal number 10?

  1. 10
  2. 1010 (correct answer)
  3. 1001
  4. 1100

Explanation: This question tests understanding of binary numbers and their application in computing, specifically how binary represents data and performs operations. Binary is a base-2 numeral system that uses only two digits, 0 and 1, to represent all numbers, which is essential for digital computing. In the passage, binary representation of the decimal number 10 is demonstrated as 1010, showing the conversion process. Choice B is correct because it accurately reflects the binary representation of the given decimal number as per the passage's explanation. Choice A is incorrect because it shows the decimal representation (10) instead of the binary representation, which is a common mistake when students forget to convert between number systems. To help students: Emphasize the importance of understanding base-2 operations and provide practice with converting between decimal and binary. Encourage the use of visual aids like binary charts and place value tables to reinforce learning and check work for common conversion errors.

Question 15

A counter is represented by a 4-bit binary number. If the current value of the counter is 0111, what will be its value after it is incremented by one?

  1. 0110
  2. 1000 (correct answer)
  3. 1001
  4. 1111

Explanation: The binary number 0111 is equivalent to the decimal number 7. Incrementing this value by one results in 8. The 4-bit binary representation of the decimal number 8 is 1000. In binary addition, adding 1 to 0111 causes a carry to propagate through all bits.

Question 16

A computer uses a fixed 4 bits to represent positive integers. Which of the following operations would result in an overflow error?

  1. Adding 0111 and 0100
  2. Adding 1010 and 0110 (correct answer)
  3. Adding 1100 and 0011
  4. Adding 0101 and 1000

Explanation: With 4 bits, the largest representable positive integer is 1111, which is 15 in decimal. The operation in choice B is adding 1010 (decimal 10) and 0110 (decimal 6). The sum is 16, which requires 5 bits (10000) to represent. Since the computer only uses 4 bits, this operation causes an overflow error.

Question 17

What is the 4-bit binary representation of the decimal number 13?

  1. 1011
  2. 1110
  3. 0111
  4. 1101 (correct answer)

Explanation: The decimal number 13 is represented in binary by finding the powers of 2 that sum to 13. The places in a 4-bit number are 8, 4, 2, 1 (which are 23,22,21,202^3, 2^2, 2^1, 2^023,22,21,20). The number 13 can be expressed as 8+4+0+18 + 4 + 0 + 18+4+0+1. This corresponds to the binary representation 1101.

Question 18

What is the decimal equivalent of the binary number 10110?

  1. 22 (correct answer)
  2. 14
  3. 20
  4. 11

Explanation: To convert the binary number 10110 to decimal, we multiply each digit by its corresponding power of 2, starting from the right (position 0). The calculation is 1×24+0×23+1×22+1×21+0×201 \times 2^4 + 0 \times 2^3 + 1 \times 2^2 + 1 \times 2^1 + 0 \times 2^01×24+0×23+1×22+1×21+0×20, which equals 16+0+4+2+0=2216 + 0 + 4 + 2 + 0 = 2216+0+4+2+0=22.

Question 19

A computer system uses a 6-bit sequence to represent different commands. What is the maximum number of unique commands that can be represented with this system?

  1. 12
  2. 32
  3. 36
  4. 64 (correct answer)

Explanation: The number of unique values that can be represented with N bits is 2N2^N2N. For a 6-bit sequence, the maximum number of unique commands is 262^626, which equals 64.

Question 20

What is the decimal value of the 8-bit binary number 10110011?

  1. 179 (correct answer)
  2. 163
  3. 187
  4. 83

Explanation: The binary number 10110011 is calculated by summing the powers of 2 for each position with a '1': 1×27+0×26+1×25+1×24+0×23+0×22+1×21+1×201 \times 2^7 + 0 \times 2^6 + 1 \times 2^5 + 1 \times 2^4 + 0 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^01×27+0×26+1×25+1×24+0×23+0×22+1×21+1×20 = $128+0+32+16+0+0+2+1=179\$128 + 0 + 32 + 16 + 0 + 0 + 2 + 1 = 179$128+0+32+16+0+0+2+1=179.