• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar

JavaTutorOnline

1-on-1 Online Java Training by a Senior Software Engineer

  • Home
  • AP CSA
    • FRQ Practice
      • Arrays
      • ArrayList
      • Strings
      • 2D Arrays
    • MCQ Practice
      • Booleans
      • Iteration
      • Arrays
      • View all Units
  • Courses
  • Tutorials
    • Java
    • Servlets
    • Struts
    • Spring
    • Webservice
  • FAQ
  • Testimonials
  • Blog
  • CONTACT US

AP CSA Binary, Decimal & Hex Practice MCQs | JavaTutorOnline

Home » AP CSA MCQ » Number Systems

AP CSA Practice: Binary, Decimal & Hexadecimal

🔢 Logic Foundations ⏱️ 15 Min Practice ✅ Exam Readiness

Understanding underlying number systems is a crucial prerequisite for computer science. While Java handles decimal numbers for you natively, understanding exactly how data is represented in memory—specifically Binary (Base-2) and Hexadecimal (Base-16)—is essential for grasping integer limits, bitwise operations, and memory bounds.

In this interactive module, you will practice rapid conversions, identify overflow boundaries, and translate machine-level data logic. These 12 questions will solidify the numerical foundations you need for complex AP CSA algorithms.

Crash Course: Expand the sections below for a quick step-by-step refresher before starting the quiz.

1. Binary (Base-2) Rules & Tricks

Each position in a binary number represents a power of 2. Read from right to left, starting at 20 (which is 1) and double the value for each step left.

Example: Convert 10110 to Decimal

  • 16s place: 1 → 16
  • 8s place: 0 → 0
  • 4s place: 1 → 4
  • 2s place: 1 → 2
  • 1s place: 0 → 0

Total: 16 + 4 + 2 = 22

Quick AP Exam Tricks:

  • The Even/Odd Trick: If a binary number ends in 0, it is even. If it ends in 1, it is odd.
  • Max Values: The maximum decimal value for an n-bit unsigned binary number is always (2^n) - 1.
2. Hexadecimal (Base-16) Quick Reference

Hexadecimal uses 16 symbols: numbers 0-9 and letters A-F. It is heavily used in Java to represent memory addresses and object hash codes.

Hex LetterABCDEF
Decimal Value101112131415

Example: Convert 2B to Decimal

The right column is the 1s place. The left column is the 16s place.

  • 2 in the 16s place → 2 * 16 = 32
  • B (11) in the 1s place → 11 * 1 = 11

Total: 32 + 11 = 43

Binary, Decimal & Hexadecimal

Question 1 of 12 | Score: 0
1. What is the decimal (Base-10) equivalent of the binary number 10110?
Correct Answer: B To convert binary to decimal, calculate the place values from right to left (1, 2, 4, 8, 16). The number 10110 has a 1 in the 16s place, the 4s place, and the 2s place.
16 + 4 + 2 = 22.
2. Which of the following is the correct binary representation of the decimal number 45?
Correct Answer: C Find the largest power of 2 that fits into 45, which is 32.
45 – 32 = 13.
Next is 8 (13 – 8 = 5).
Next is 4 (5 – 4 = 1).
Next is 1 (1 – 1 = 0).
Putting a ‘1’ in the 32, 8, 4, and 1 columns gives us 101101.
3. What is the decimal equivalent of the hexadecimal number 2B?
Correct Answer: A In hexadecimal, ‘B’ represents the decimal number 11. The column to its left is the 16s place.
So, 2B = (2 * 16) + (11 * 1) = 32 + 11 = 43.
4. Which of the following is the hexadecimal representation of the decimal number 175?
Correct Answer: A To convert decimal to hex, divide by 16.
175 ÷ 16 = 10 with a remainder of 15.
In Hex, 10 is ‘A’ and 15 is ‘F’. Therefore, the result is AF.
5. What is the result of adding the binary numbers 1101 and 1010?
Correct Answer: B You can convert to decimal first: 1101 is 13, and 1010 is 10.
13 + 10 = 23.
Converting 23 back to binary (16 + 4 + 2 + 1) gives us 10111.
6. How is the hexadecimal value C4 represented in binary?
Correct Answer: A The fastest way to convert Hex to Binary is to treat each hex digit as a 4-bit binary group (a nibble).
‘C’ is 12, which is 1100.
‘4’ is 0100.
Combine them directly to get 11000100.
7. In the binary number 10010, what is the decimal place value of the leftmost ‘1’?
Correct Answer: B Working from right to left, the columns in base-2 are 1, 2, 4, 8, 16. The leftmost digit (the 5th digit from the right) resides in the 16s place.
8. Which of the following representations holds the largest numerical value?
Correct Answer: D Let’s convert them all to decimal to compare:
A) Binary 1111 = 15
B) Decimal 14 = 14
C) Hexadecimal E = 14
D) Binary 10000 = 16. Therefore, D is the largest.
9. If a binary number ends with the digit ‘1’, its decimal equivalent must be:
Correct Answer: C The rightmost place value in binary is 20, which equals 1. Every other column to the left is an even number (2, 4, 8, 16…). The sum of any combination of even numbers is always even. The only way to make a binary number odd is to have a ‘1’ in the rightmost column.
10. What is the maximum decimal value that can be represented by 8 unsigned bits (1 byte)?
Correct Answer: B An 8-bit number can hold 256 unique combinations (from 00000000 to 11111111). Because we start counting at 0, the maximum value is 256 – 1 = 255.
11. Shifting all digits of a binary number one position to the left (e.g., 101 becomes 1010) has what mathematical effect?
Correct Answer: B Just like shifting a decimal number one place to the left multiplies it by its base (10), shifting a binary number left multiplies it by its base (2). 101 is 5. 1010 is 10.
12. In standard Java, how many bits are used in memory to store a primitive int?
Correct Answer: C A standard int in Java is a 32-bit signed integer. This is why the maximum positive value for an `int` on the AP exam is roughly 2.14 billion (which is 231 – 1, using one bit for the positive/negative sign).

Number Systems Practice Complete!

0 / 12

Why Number Systems Matter for AP CSA

On the AP exam, you rarely have to convert massive binary numbers by hand, but you must understand the constraints of Java’s primitive data types. Knowing that a standard 32-bit signed int maxes out at roughly 2.14 billion (231 – 1) helps you instantly identify potential integer overflow errors in multiple-choice code traces.

Additionally, hexadecimal frequently appears when discussing object memory references. If you ever try to print a Java object without writing a proper .toString() method, the output includes a hexadecimal hash code representing its location in memory.

Ready for the Next Step?

Now that you are comfortable with base conversions and memory representation, it is time to apply numerical logic directly to Java’s control flow.

Continue your AP CSA review by moving on to the Truth Tables & Booleans Practice, where we break down complex logical operators, short-circuit evaluation, and De Morgan’s Laws.

← Back to MCQ Practice Hub
Next: Truth Tables & Booleans →

Primary Sidebar

Mr Chinmay

Chinmay Patel
Book a Demo Class

Phone & Whatsapp +919853166385
javatution@gmail.com

Recent Posts

  • Learn Java in One Day: 10-Hour 1-on-1 Crash Course | JavaTutorOnline
  • Constructor in Java: Examples, Types & Constructor Overloading
  • Important Interview Questions on Java Multithreading
  • React Spring Boot Web Services React Integration
  • Spring Boot RESTful Web Services Example
  • Top Spring MVC Interview Questions and Answers for Developers
  • Top Spring Core Interview Questions and Answers for Developers
  • Host Java Web Apps for Free on Mobile with Tomcat and Termux
  • How to Deploy Java Web Application on Aws EC2 with Elastic IP
  • Simple Jsp Servlet Jdbc User Registration using Tomcat Mysql and Eclipse

Additional Resources

  • AP Computer Science A Summer Prep
Copyright © 2026 JavaTutorOnline