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

Conversion

Introduction to Number Systems and Conversions

In the world of computers and digital electronics, numbers are represented in various forms called number systems. Unlike the everyday decimal system we use, computers primarily use the binary system. However, octal and hexadecimal systems are also widely used as shorthand forms for binary numbers. Understanding these number systems and how to convert between them is fundamental for anyone preparing for competitive exams in computer aptitude.

Why do we need conversions? Because different systems are useful in different contexts. For example, humans find decimal numbers easy to read, but computers operate using binary. Octal and hexadecimal simplify binary representation, making it easier to read and write large binary numbers.

This section will guide you step-by-step through the basics of number systems and teach you how to convert numbers between decimal, binary, octal, and hexadecimal systems with clear examples and practical tips.

Number Systems Overview

A number system is a way to represent numbers using a set of digits and a base (or radix). The base tells us how many unique digits, including zero, the system uses.

Number System Base (Radix) Digit Range Example Number
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 156
Binary 2 0, 1 10011100
Octal 8 0, 1, 2, 3, 4, 5, 6, 7 234
Hexadecimal 16 0-9, A(10), B(11), C(12), D(13), E(14), F(15) 2F

Note: In hexadecimal, letters A to F represent decimal values 10 to 15.

Conversion Methods

Converting numbers between different bases can be done using systematic methods. Two main approaches are:

  • Division-Remainder Method: Used to convert decimal numbers to other bases.
  • Positional Value Method: Used to convert numbers from any base to decimal.

Let's understand these methods with the help of a flowchart.

graph TD    A[Start] --> B{Conversion Type?}    B -->|Decimal to Other Base| C[Divide number by base]    C --> D[Record remainder]    D --> E{Is quotient zero?}    E -->|No| C    E -->|Yes| F[Write remainders in reverse order]    F --> G[Result: Number in new base]    B -->|Other Base to Decimal| H[Multiply each digit by base^position]    H --> I[Sum all products]    I --> J[Result: Decimal number]

Why these methods?

The division-remainder method works because when you divide a decimal number by the base repeatedly, the remainders represent the digits of the new base starting from the least significant digit (rightmost). The positional value method works because each digit in a number represents a value multiplied by the base raised to the power of its position.

Worked Examples

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

Step 1: Divide 156 by 2 and record the remainder.

156 / 2 = 78, remainder = 0

Step 2: Divide the quotient 78 by 2.

78 / 2 = 39, remainder = 0

Step 3: Continue dividing and recording remainders:

  • 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 4: Write the remainders in reverse order (from last to first):

Binary: 10011100

Answer: Decimal 156 = Binary 10011100

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

Step 1: Write the positional values of each binary digit from right to left, starting at position 0:

Positions: 5 4 3 2 1 0

Digits: 1 0 1 1 0 1

Step 2: Multiply each digit by \(2^{position}\):

  • 1 x \(2^5\) = 1 x 32 = 32
  • 0 x \(2^4\) = 0 x 16 = 0
  • 1 x \(2^3\) = 1 x 8 = 8
  • 1 x \(2^2\) = 1 x 4 = 4
  • 0 x \(2^1\) = 0 x 2 = 0
  • 1 x \(2^0\) = 1 x 1 = 1

Step 3: Add all the products:

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

Answer: Binary 101101 = Decimal 45

Example 3: Convert Hexadecimal 2F to Decimal Medium
Convert the hexadecimal number 2F to decimal.

Step 1: Identify the decimal values of each hex digit:

  • 2 = 2
  • F = 15

Step 2: Write the positional values (right to left, starting at 0):

Positions: 1 0

Digits: 2 F

Step 3: Multiply each digit by \(16^{position}\):

  • 2 x \(16^1\) = 2 x 16 = 32
  • 15 x \(16^0\) = 15 x 1 = 15

Step 4: Add the results:

32 + 15 = 47

Answer: Hexadecimal 2F = Decimal 47

Example 4: Convert Decimal 255 to Hexadecimal Medium
Convert the decimal number 255 to its hexadecimal equivalent.

Step 1: Divide 255 by 16 and record the remainder.

255 / 16 = 15, remainder = 15

Step 2: Divide the quotient 15 by 16.

15 / 16 = 0, remainder = 15

Step 3: Write the remainders in reverse order:

Remainders: 15, 15

Step 4: Convert remainders to hex digits:

  • 15 = F
  • 15 = F

Answer: Decimal 255 = Hexadecimal FF

Example 5: Convert Octal 345 to Binary Hard
Convert the octal number 345 to its binary equivalent.

Step 1: Understand that each octal digit corresponds to exactly 3 binary digits (bits).

Step 2: Convert each octal digit to its 3-bit binary equivalent:

  • 3 (octal) = 011 (binary)
  • 4 (octal) = 100 (binary)
  • 5 (octal) = 101 (binary)

Step 3: Concatenate the binary groups:

011 100 101

Answer: Octal 345 = Binary 011100101 (or simply 11100101 without leading zero)

Formula Bank

Formula Bank

Decimal to Base-n Conversion
\[ N_{base-n} = \sum_{i=0}^{k} d_i \times n^i \]
where: \(N_{base-n}\) = number in base-n, \(d_i\) = digit at position \(i\), \(n\) = base, \(k\) = highest power
Used to convert decimal number to any base-n by repeated division and remainder collection.
Base-n to Decimal Conversion
\[ N_{decimal} = \sum_{i=0}^{k} d_i \times n^i \]
where: \(N_{decimal}\) = decimal number, \(d_i\) = digit at position \(i\), \(n\) = base, \(k\) = highest power
Used to convert number from base-n to decimal by multiplying each digit by its positional value and summing.

Tips & Tricks

Tip: Group binary digits in sets of 3 (for octal) or 4 (for hexadecimal) to convert quickly without intermediate decimal conversion.

When to use: When converting between binary and octal or hexadecimal to save time and reduce errors.

Tip: Remember octal is base 8 and hexadecimal is base 16; use powers of 2 (3 bits for octal, 4 bits for hex) to simplify conversions.

When to use: During base conversions involving octal and hexadecimal.

Tip: For decimal to binary conversion, always write remainders from last division to first to get the correct binary number.

When to use: When converting decimal numbers to binary using division-remainder method.

Tip: Use mnemonic "PEMDAS" (Parentheses, Exponents, Multiplication, Division, Addition, Subtraction) to remember the order of operations in Boolean algebra simplification.

When to use: While simplifying Boolean expressions to avoid mistakes.

Common Mistakes to Avoid

❌ Confusing the base during conversion, e.g., treating hexadecimal digits as decimal digits.
✓ Always remember the digit range for each base; hexadecimal digits include A-F representing 10-15.
Why: Students often apply decimal thinking to other bases leading to incorrect conversions.
❌ Incorrectly ordering remainders when converting decimal to binary.
✓ Write remainders from last division to first to form the correct binary number.
Why: Students write remainders in the order they are obtained instead of reverse.
❌ Not grouping binary digits correctly when converting to octal or hexadecimal.
✓ Group binary digits from right to left in sets of 3 (octal) or 4 (hexadecimal) before conversion.
Why: Improper grouping leads to wrong digit values in the target base.
❌ Skipping zero padding in binary groups during base conversions.
✓ Add leading zeros to make complete groups of 3 or 4 bits.
Why: Incomplete groups cause incorrect conversion results.

Decimal to Base-n Conversion

\[N_{base-n} = \sum_{i=0}^{k} d_i \times n^i\]

Convert decimal number to base-n by repeated division and remainder collection

\(N_{base-n}\) = Number in base-n
\(d_i\) = Digit at position i
n = Base
k = Highest power

Base-n to Decimal Conversion

\[N_{decimal} = \sum_{i=0}^{k} d_i \times n^i\]

Convert number from base-n to decimal by multiplying digits by positional values and summing

\(N_{decimal}\) = Decimal number
\(d_i\) = Digit at position i
n = Base
k = Highest power
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
Conversion · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.