We are all familiar with the decimal system, which is the standard way of writing numbers using digits 0 to 9. This system is called base 10 because it uses 10 different digits and each digit's position represents a power of 10.
But did you know that numbers can be represented in other bases as well? For example, computers use binary (base 2), which only has digits 0 and 1. Other common bases include octal (base 8) and hexadecimal (base 16). Understanding these number bases is crucial for competitive exams and fields like computer science.
In this section, we will explore how numbers are represented in different bases, how to convert between them, and how to perform arithmetic operations in these systems.
Every number in any base is made up of digits, each having a place value determined by its position and the base. The rightmost digit is the least significant digit (units place), and the place value increases as we move left.
For example, consider the decimal number 345. It can be expanded as:
\[ 345 = 3 \times 10^2 + 4 \times 10^1 + 5 \times 10^0 \]
Here, the digit 3 is in the hundreds place (\(10^2\)), 4 is in the tens place (\(10^1\)), and 5 is in the units place (\(10^0\)).
Similarly, in binary (base 2), the number 1011 represents:
\[ 1011_2 = 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0 \]
Calculating this gives \(8 + 0 + 2 + 1 = 11\) in decimal.
Converting numbers between bases is a common task. There are two main types of conversions:
Let's understand the step-by-step methods for each.
graph TD A[Start] --> B{Is number in base n?} B -- Yes --> C[Multiply each digit by n^position] C --> D[Sum all values] D --> E[Decimal number obtained] B -- No --> F[Divide decimal number by n] F --> G[Record remainder] G --> H{Is quotient 0?} H -- No --> F H -- Yes --> I[Write remainders in reverse order] I --> J[Number in base n obtained]Multiply each digit by the base raised to the power of its position (starting from 0 at the right) and add all results.
Example: Convert \(234_5\) to decimal.
\[ 234_5 = 2 \times 5^2 + 3 \times 5^1 + 4 \times 5^0 = 2 \times 25 + 3 \times 5 + 4 \times 1 = 50 + 15 + 4 = 69 \]
Repeatedly divide the decimal number by the target base \(n\), record the remainders, and write them in reverse order.
Example: Convert decimal 69 to base 5.
Write remainders in reverse: \(234_5\).
Arithmetic in bases other than 10 follows the same principles as decimal arithmetic but uses the base's digit set and carry rules.
For addition and multiplication:
| Binary Addition | 0 | 1 |
|---|---|---|
| 0 | 0 | 1 |
| 1 | 1 | 10 (carry 1) |
| + | 0 | 1 | 9 | A (10) | F (15) |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 9 | A | F |
| 1 | 1 | 2 | A | B | 10 (carry 1) |
| 9 | 9 | A | 12 (carry 1) | 13 (carry 1) | 18 (carry 1) |
Step 1: Write the place values for each digit from right to left:
\(1 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0\)
Step 2: Calculate each term:
\(1 \times 8 + 1 \times 4 + 0 \times 2 + 1 \times 1 = 8 + 4 + 0 + 1\)
Step 3: Add the results:
\(8 + 4 + 0 + 1 = 13\)
Answer: \(1101_2 = 13_{10}\)
Step 1: Divide 254 by 16:
254 / 16 = 15 remainder 14
Step 2: Divide quotient 15 by 16:
15 / 16 = 0 remainder 15
Step 3: Write remainders in reverse order:
15 (F), 14 (E) -> \(FE_{16}\)
Answer: \(254_{10} = FE_{16}\)
Step 1: Add digits from right to left, base 8:
7 + 3 = 10 decimal = 12 octal -> Write 2, carry 1
5 + 6 + 1 (carry) = 12 decimal = 14 octal -> Write 4, carry 1
1 + 2 + 1 (carry) = 4 decimal = 4 octal -> Write 4, carry 0
Step 2: Combine digits:
\(442_8\)
Answer: \(157_8 + 263_8 = 442_8\)
Step 1: Write multiplication like decimal but use binary rules:
101
x 11
-------
Step 2: Multiply 101 by rightmost digit 1:
101
Step 3: Multiply 101 by next digit 1 (shifted one place left):
1010
Step 4: Add the two results in binary:
101 + 1010 = 1111
Answer: \(101_2 \times 11_2 = 1111_2\)
Step 1: Convert each hex digit to decimal:
1 = 1, A = 10, 3 = 3, F = 15
Step 2: Expand using powers of 16:
\(1 \times 16^3 + 10 \times 16^2 + 3 \times 16^1 + 15 \times 16^0\)
Calculate powers:
\(1 \times 4096 + 10 \times 256 + 3 \times 16 + 15 \times 1 = 4096 + 2560 + 48 + 15\)
Step 3: Sum all:
\(4096 + 2560 = 6656\), \(6656 + 48 = 6704\), \(6704 + 15 = 6719\)
Step 4: Convert bytes to kilobytes:
\(\frac{6719}{1024} \approx 6.56 \text{ KB}\)
Answer: \(1A3F_{16} = 6719_{10}\) bytes ≈ 6.56 KB
When to use: During base conversion and arithmetic in binary, octal, and hexadecimal.
When to use: Converting between binary and octal/hexadecimal.
When to use: Solving arithmetic problems in non-decimal bases.
When to use: Converting between two non-decimal bases.
When to use: Working with hexadecimal numbers.
Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.
Go to practice →