Welcome to the World of Number Bases!

Hi there! Ever wondered how a computer, which is basically just a bunch of tiny switches, can handle complex things like games, videos, or social media? It all starts with how we represent numbers. In this chapter, we are going to explore different number bases. By the end of this, you’ll be "speaking computer" by understanding Binary and Hexadecimal, and you'll see why these systems are so much better for machines than the standard numbers we use every day.

Don't worry if math isn't your favorite subject! We’re going to break this down step-by-step using simple patterns and tricks.


1. Understanding the "Base"

Before we look at computers, let’s look at how humans count. We use Decimal (also called Denary or Base 10). This is because we have ten fingers!

In Base 10, we have ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Once we hit 9, we run out of symbols and have to "carry over" to a new column (the "tens" column).

Wait, what are other bases?

A "base" simply tells you how many different digits are available in that system. A computer doesn't have ten fingers; it has switches that are either ON or OFF. This is why computers use Base 2.

Quick Review: The Three Bases You Need to Know

  • Decimal (Base 10): Uses digits 0-9. (Example: \( 67_{10} \))
  • Binary (Base 2): Uses only 0 and 1. (Example: \( 10011011_2 \))
  • Hexadecimal (Base 16): Uses digits 0-9 and letters A-F. (Example: \( AE_{16} \))

Did you know? The little number written below the line (like the \( _{10} \) in \( 67_{10} \)) is called a subscript. It tells us which base we are using so we don't get confused!

Key Takeaway: The "base" defines how many digits are available. Humans love Base 10, but computers love Base 2.


2. Binary: The Language of Computers

In Binary, every column is worth double the one to its right. Instead of Hundreds, Tens, and Units, we use 128, 64, 32, 16, 8, 4, 2, and 1.

How to convert Binary to Decimal

To turn binary into a number you understand, just draw a table and add up the "ON" values.

Example: Convert \( 10101000_2 \) to Decimal

1. Draw the place value headers:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1

2. Put your binary number underneath:
1 | 0 | 1 | 0 | 1 | 0 | 0 | 0

3. Add up only the numbers that have a 1 under them:
\( 128 + 32 + 8 = 168 \)

So, \( 10101000_2 = 168_{10} \).

How to convert Decimal to Binary

This is like filling a bucket. Start with the biggest "weight" (128) and see if it fits in your number.

Example: Convert \( 45_{10} \) to Binary

1. Does 128 fit in 45? No (0)
2. Does 64 fit? No (0)
3. Does 32 fit? Yes! Put a 1. (Remaining: \( 45 - 32 = 13 \))
4. Does 16 fit in 13? No (0)
5. Does 8 fit in 13? Yes! Put a 1. (Remaining: \( 13 - 8 = 5 \))
6. Does 4 fit in 5? Yes! Put a 1. (Remaining: \( 5 - 4 = 1 \))
7. Does 2 fit in 1? No (0)
8. Does 1 fit in 1? Yes! Put a 1.
Result: \( 00101101_2 \)

Common Mistake: Forgetting to check the "1" column at the end. Always make sure you've gone all the way to the right!

Key Takeaway: Use a table with powers of 2 (1, 2, 4, 8, 16, 32, 64, 128) to convert back and forth.


3. Hexadecimal: The "Shorthand" for Humans

Binary is great for computers, but it's a nightmare for humans to read. Imagine trying to find a mistake in a page filled with 1011010111000101...!

This is why we use Hexadecimal (Base 16). It’s like a "nickname" for binary.

The Hex "Alphabet"

Because we need 16 different symbols but only have 10 digits (0-9), we use letters for the rest:

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

Memory Aid: Just remember A is 10. If you know that, you can count on your fingers to find the rest (B=11, C=12, etc.).

Why is Hex used as a shorthand?

One Hex digit represents exactly four bits (binary digits). This makes it very easy to convert between the two.

  • It is shorter and easier to remember.
  • Humans are less likely to make mistakes when typing it.
  • It’s easy for programmers to convert to binary in their heads.

Key Takeaway: Hexadecimal isn't "used" by the computer hardware; it's used by people to make binary easier to handle.


4. Converting Between Hex and Binary

This is the easiest conversion of all because we use the "Group of 4" rule.

Binary to Hex (Step-by-Step)

Example: Convert \( 11101011_2 \) to Hex

1. Split the binary number into two groups of 4 (starting from the right):
1110 | 1011

2. Calculate the value of each group using 8, 4, 2, 1:
Left side: \( 8 + 4 + 2 = 14 \). In Hex, 14 is E.
Right side: \( 8 + 2 + 1 = 11 \). In Hex, 11 is B.

3. Put them together: EB.

Hex to Binary (Step-by-Step)

Example: Convert \( 2F_{16} \) to Binary

1. Take each digit separately: 2 and F.

2. Convert each to a 4-bit binary number:
2 is \( 0010 \)
F (which is 15) is \( 1111 \)

3. Combine them: \( 00101111_2 \).

Quick Review Box:
4 bits = 1 Hex digit
Use the values 8, 4, 2, 1 for every conversion between Hex and Binary.

Key Takeaway: To convert Hex, always go through Binary first. It’s the safest "bridge" to use!


Summary Checklist

Can you do these things? If so, you're ready for the exam!

  • Explain what Base 2, 10, and 16 are.
  • Convert a binary number to decimal using a place-value table.
  • Convert a decimal number to binary by "subtracting weights."
  • Explain that Hexadecimal is used because it's easier for humans to read/write.
  • Convert between Binary and Hex by grouping bits into fours.

Great job! Data representation can feel like learning a secret code, but once you see the patterns, it becomes second nature. Keep practicing those 8, 4, 2, 1 tables!