Introduction to Number Systems
Introduction to Number Systems
Have you ever wondered how computers understand the numbers you type? Or why programmers sometimes talk about "binary code" and "hexadecimal values"? The secret lies in understanding number systems — different ways of representing and working with numbers.
In our everyday life, we use the decimal system without even thinking about it. When you count "1, 2, 3, 4... 10," you're using a number system that has been the foundation of mathematics for thousands of years. But computers don't "think" in decimals. They use a completely different language called binary. And to make binary easier for humans to read, programmers invented two other systems: octal and hexadecimal.
In this chapter, you'll discover that the same quantity can be written in multiple ways, just like the same idea can be expressed in different languages. The number 25 in decimal is 11001 in binary, 31 in octal, and 19 in hexadecimal — all representing the exact same value! Understanding these different systems is essential for anyone who wants to understand how computers work at a fundamental level.
{{KEY: type=concept | title=What is a Number System? | text=A number system is a systematic way of representing numbers using a specific set of symbols or digits. It defines rules for counting, arithmetic operations, and the position-based value of digits. Every number system has a base (or radix) that determines how many unique digits are used.}}
The Concept of Base (Radix)
The most important concept in understanding number systems is the base or radix. The base tells us how many unique digits are available in that system, and it determines how the position of a digit affects its value.
Think of the base as the "size of the alphabet" for numbers. In English, we have 26 letters. In number systems, the base tells us how many "letters" (digits) we can use.
Positional Value System
All the number systems we'll study use a positional notation system. This means that the position of a digit determines its value, not just the digit itself.
For example, in the decimal number 555:
- The first 5 (from the right) means 5 × 1 = 5
- The second 5 means 5 × 10 = 50
- The third 5 means 5 × 100 = 500
Notice the pattern? Each position represents a power of 10 (the base). The rightmost position is 10⁰, the next is 10¹, then 10², and so on.
{{VISUAL: diagram: positional value system showing the number 555 with arrows pointing to each digit labeled with their place values (100s, 10s, 1s) and calculations}}
{{KEY: type=definition | title=Base or Radix | text=The base (or radix) of a number system is the total number of unique digits available in that system. It also represents the multiplier between consecutive positional values. For example, decimal has base 10, binary has base 2, octal has base 8, and hexadecimal has base 16.}}
The Four Number Systems
Let's explore the four number systems you'll master in this chapter:
1. Decimal Number System (Base 10)
The decimal system is the number system we use every day. It's called "decimal" because it uses 10 unique digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Key characteristics:
- Base: 10
- Digits used: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Position values: Powers of 10 (1, 10, 100, 1000, ...)
- Common use: Everyday arithmetic, commerce, general counting
When we write a decimal number like 1347, we automatically understand it as:
1 × 10³ + 3 × 10² + 4 × 10¹ + 7 × 10⁰= 1 × 1000 + 3 × 100 + 4 × 10 + 7 × 1= 1000 + 300 + 40 + 7 = 1347
2. Binary Number System (Base 2)
The binary system is the language of computers. It uses only 2 unique digits: 0 and 1. These are often called bits (binary digits).
Key characteristics:
- Base: 2
- Digits used: 0, 1 only
- Position values: Powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, ...)
- Common use: Computer processors, digital electronics, data storage
Why do computers use binary? Because digital circuits can easily represent two states: ON (1) and OFF (0). A transistor is either conducting electricity or it isn't — there's no middle ground.
For example, the binary number 1011 means:
1 × 2³ + 0 × 2² + 1 × 2¹ + 1 × 2⁰= 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1= 8 + 0 + 2 + 1 = 11(in decimal)
{{KEY: type=points | title=Why Binary Matters | text=- Every piece of data in a computer — numbers, text, images, videos — is ultimately stored as binary.
- A single binary digit (bit) can store one of two values: 0 or 1.
- 8 bits grouped together form a byte, which can represent 256 different values (0 to 255).
- Understanding binary is essential for computer science, programming, and digital electronics.}}
