👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Computer Fundamentals
Study mode

Number systems

Introduction to Number Systems

Numbers are everywhere in our daily lives - from counting money to measuring distances. But have you ever wondered how computers understand and work with numbers? The answer lies in number systems. A number system is a way to represent numbers using a set of symbols (called digits) and rules. Different number systems use different bases, which determine how many unique digits they have and how numbers are formed.

In computing, number systems are crucial because computers operate using electrical signals that can be in one of two states: ON or OFF. This binary nature means computers use the binary number system internally. However, humans usually use the decimal system. To bridge this gap, other systems like octal and hexadecimal are also used as shorthand representations of binary numbers.

In this chapter, we will explore the main number systems used in computing, understand how to convert numbers between these systems, and learn their applications. By mastering these concepts, you will be well-prepared for competitive exams and have a solid foundation in computer fundamentals.

Decimal Number System

The decimal number system is the most familiar system to us. It is also called the base-10 system because it uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

Each digit in a decimal number has a place value depending on its position, which is a power of 10. The rightmost digit represents units (100), the next digit to the left represents tens (101), then hundreds (102), and so on.

3 4 5 100s (10²) 10s (10¹) Units (10⁰)

For example, the number 345 means:

  • 3 x 10² = 300
  • 4 x 10¹ = 40
  • 5 x 10⁰ = 5

Adding these gives 345.

Because of its intuitive nature and daily use, the decimal system is the starting point for understanding other number systems.

Binary Number System

The binary number system is the foundation of all modern computing. It is a base-2 system, meaning it uses only two digits: 0 and 1. These digits are called bits, short for binary digits.

Each bit in a binary number has a place value that is a power of 2, starting from the rightmost bit (20), then 21, 22, and so on.

1 0 1 1 8 (2³) 4 (2²) 2 (2¹) 1 (2⁰)

For example, the binary number 1011 means:

  • 1 x 2³ = 8
  • 0 x 2² = 0
  • 1 x 2¹ = 2
  • 1 x 2⁰ = 1

Adding these gives 8 + 0 + 2 + 1 = 11 in decimal.

Why binary? Because computers use switches that are either ON or OFF, representing 1 or 0. This makes binary the natural language of computers.

Octal and Hexadecimal Number Systems

While binary is essential for computers, long binary numbers can be hard to read and write. To simplify, we use octal and hexadecimal systems as shorthand representations of binary numbers.

The octal system is base-8, using digits 0 to 7. Each octal digit corresponds exactly to 3 binary bits.

The hexadecimal system is base-16, using digits 0 to 9 and letters A to F (where A=10, B=11, ..., F=15). Each hex digit corresponds exactly to 4 binary bits.

Octal and Hexadecimal Digits with Decimal Equivalents
Octal Digit Decimal Equivalent Hex Digit Decimal Equivalent
0000
1111
2222
3333
4444
5555
6666
7777
A10
B11
C12
D13
E14
F15

Because of this direct relationship, octal and hexadecimal numbers are easier to convert to and from binary, making them very useful in computer science.

Conversions Between Number Systems

Understanding how to convert numbers between decimal, binary, octal, and hexadecimal systems is essential. Let's look at the general methods.

graph TD    A[Start] --> B{Convert from?}    B -->|Decimal| C[Divide by base (2,8,16) repeatedly]    B -->|Binary| D[Sum powers of 2 for decimal]    B -->|Binary to Octal/Hex| E[Group bits (3 for octal, 4 for hex)]    C --> F[Collect remainders as digits]    D --> G[Multiply digits by powers of 2 and sum]    E --> H[Convert each group to octal/hex digit]    F --> I[Result in target base]    G --> I    H --> I

Let's break down some common conversions:

  • Decimal to Binary: Divide the decimal number by 2 repeatedly, noting the remainders. The binary number is the remainders read from bottom to top.
  • Binary to Decimal: Multiply each bit by its place value (power of 2) and sum all.
  • Binary to Octal: Group binary digits in sets of 3 from right to left, then convert each group to its octal digit.
  • Octal to Hexadecimal: Convert octal to binary (each octal digit to 3 bits), then group binary digits in 4s to convert to hex.

Formula Bank

Formula Bank

Binary to Decimal Conversion
\[ N_{10} = \sum_{i=0}^{n} b_i \times 2^i \]
where: \(N_{10}\) = decimal number, \(b_i\) = binary digit (0 or 1) at position \(i\), \(i\) = position index starting from 0 (rightmost bit)
Octal to Decimal Conversion
\[ N_{10} = \sum_{i=0}^{n} o_i \times 8^i \]
where: \(N_{10}\) = decimal number, \(o_i\) = octal digit (0-7) at position \(i\), \(i\) = position index
Hexadecimal to Decimal Conversion
\[ N_{10} = \sum_{i=0}^{n} h_i \times 16^i \]
where: \(N_{10}\) = decimal number, \(h_i\) = hex digit (0-9, A-F) at position \(i\), \(i\) = position index

Worked Examples

Example 1: Convert Decimal 156 to Binary Easy
Convert the decimal number 156 to its binary equivalent.

Step 1: Divide 156 by 2 and write down the remainder.

  • 156 / 2 = 78, remainder 0
  • 78 / 2 = 39, remainder 0
  • 39 / 2 = 19, remainder 1
  • 19 / 2 = 9, remainder 1
  • 9 / 2 = 4, remainder 1
  • 4 / 2 = 2, remainder 0
  • 2 / 2 = 1, remainder 0
  • 1 / 2 = 0, remainder 1

Step 2: Write the remainders from bottom to top:

10011100

Answer: Decimal 156 = Binary 10011100

Example 2: Convert Binary 101101 to Decimal Easy
Find the decimal equivalent of the binary number 101101.

Step 1: Label each bit with its place value (powers of 2):

Bits: 1 0 1 1 0 1

Place values: 32 16 8 4 2 1

Step 2: Multiply each bit by its place value and sum:

  • 1 x 32 = 32
  • 0 x 16 = 0
  • 1 x 8 = 8
  • 1 x 4 = 4
  • 0 x 2 = 0
  • 1 x 1 = 1

Sum = 32 + 0 + 8 + 4 + 0 + 1 = 45

Answer: Binary 101101 = Decimal 45

Example 3: Convert Binary 110101 to Octal Medium
Convert the binary number 110101 to its octal equivalent.

Step 1: Group the binary digits into sets of 3 from right to left:

110 101

Step 2: Convert each group to decimal (octal digit):

  • 110 = 6 (4 + 2 + 0)
  • 101 = 5 (4 + 0 + 1)

Answer: Binary 110101 = Octal 65

Example 4: Convert Hexadecimal 3F to Binary Medium
Convert the hexadecimal number 3F to binary.

Step 1: Convert each hex digit to 4-bit binary:

  • 3 = 0011
  • F = 1111 (F = 15 decimal)

Step 2: Combine the binary groups:

0011 1111

Answer: Hexadecimal 3F = Binary 00111111

Example 5: Add Two Binary Numbers 1011 + 1101 Medium
Add the binary numbers 1011 and 1101.

Step 1: Write the numbers aligned by place value:

      1 0 1 1    + 1 1 0 1    ---------    

Step 2: Add bit by bit from right to left, carrying over when sum exceeds 1:

  • 1 + 1 = 0 carry 1
  • 1 + 1 + carry 1 = 1 carry 1
  • 0 + 0 + carry 1 = 1 carry 0
  • 1 + 1 = 0 carry 1

Step 3: Write down the carry if any:

Carry 1 at the leftmost position.

Result: 11000

Answer: 1011 + 1101 = 11000 (binary)

Summary: Number Systems in Computing

  • Decimal (Base-10): Used by humans; digits 0-9.
  • Binary (Base-2): Used by computers; digits 0 and 1.
  • Octal (Base-8): Shorthand for binary; digits 0-7; groups of 3 bits.
  • Hexadecimal (Base-16): Shorthand for binary; digits 0-9 and A-F; groups of 4 bits.
  • Conversions rely on division, grouping, and summing powers of the base.
  • Binary arithmetic follows special rules for carrying over.

Tips & Tricks

Tip: Group binary digits in sets of 3 for octal and 4 for hexadecimal conversions.

When to use: When converting binary numbers to octal or hexadecimal to simplify the process.

Tip: Remember that hexadecimal digits A-F correspond to decimal 10-15.

When to use: When converting between hexadecimal and decimal or binary.

Tip: Use repeated division by the base (2, 8, or 16) for decimal to other base conversions.

When to use: When converting decimal numbers to binary, octal, or hexadecimal.

Tip: Practice binary addition by aligning bits and carrying over when sum exceeds 1.

When to use: When performing binary arithmetic operations.

Tip: Memorize powers of 2 up to 28 to speed up conversions and calculations.

When to use: During conversions and arithmetic involving binary numbers.

Common Mistakes to Avoid

❌ Confusing place values when converting binary to decimal.
✓ Always label each bit with its corresponding power of 2 before summing.
Why: Students often forget to assign correct place values, leading to wrong sums.
❌ Incorrect grouping of binary digits for octal or hexadecimal conversion.
✓ Group bits starting from the right in sets of 3 (octal) or 4 (hex), adding leading zeros if needed.
Why: Misalignment causes incorrect digit conversion.
❌ Forgetting that hexadecimal digits include alphabets A-F.
✓ Remember that A=10, B=11, ..., F=15 in decimal.
Why: Leads to wrong decimal or binary conversion.
❌ Not carrying over correctly in binary addition.
✓ Follow binary addition rules carefully: 1+1=0 carry 1.
Why: Binary addition differs from decimal and requires practice.
❌ Mixing up bases during conversion steps.
✓ Keep track of the base you are converting from and to, and follow the correct method accordingly.
Why: Confusion between bases leads to wrong answers.
✨ AI exam tools — try them free (included in every plan)
Tip: select any text above to Explain / Example / Simplify it.
Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Number systems · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.