👁 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 Basics and Hardware
Study mode

Number Systems Binary Octal Hex

Introduction to Number Systems

Numbers are everywhere-in counting money, measuring distances, or telling time. The system we use daily to represent numbers is called the decimal system, which is based on ten digits (0 to 9). But why do computers use different number systems like binary, octal, and hexadecimal instead of decimal?

Computers operate using electrical signals that are either ON or OFF, which naturally fits a system with only two digits: 0 and 1. This is the binary number system. To make working with binary easier, related systems like octal (base 8) and hexadecimal (base 16) are also used.

In this chapter, we will explore these number systems, understand how they work, and learn how to convert numbers between them. This knowledge is fundamental for understanding how computers process and store data.

Positional Number Systems and Bases

A positional number system is a way of representing numbers where the position of each digit affects its value. The value of a digit depends on two things:

  • The digit itself (which must be between 0 and one less than the base)
  • The position of the digit in the number

The base or radix of a number system tells us how many unique digits are available and how place values increase.

For example, in the decimal system (base 10), digits range from 0 to 9. Each position represents a power of 10:

3 5 7 2 10³ = 1000 10² = 100 10¹ = 10 10⁰ = 1

Here, the number 3572 means:

  • 3 x 10³ = 3000
  • 5 x 10² = 500
  • 7 x 10¹ = 70
  • 2 x 10⁰ = 2

Adding these gives the total value: 3000 + 500 + 70 + 2 = 3572.

This principle applies to all positional number systems, but the base changes the place values and the allowed digits.

Binary Number System

The binary number system uses base 2, meaning it has only two digits: 0 and 1. Each position represents a power of 2, starting from 2⁰ at the rightmost digit.

For example, the binary number 1011 represents:

  • 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.

Binary Place Values and Example
Binary Digit Position (Right to Left) Power of 2 Decimal Value
1 3 8
0 2 0
1 1 2
1 0 2⁰ 1

Converting Binary to Decimal

To convert a binary number to decimal, multiply each binary digit by 2 raised to its position index (starting from 0 at the right) and sum all results.

Converting Decimal to Binary

To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainders. The binary number is the remainders read from bottom to top.

Octal Number System

The octal number system uses base 8, with digits from 0 to 7. Each digit represents a power of 8.

For example, the octal number 345 means:

  • 3 x 8² = 3 x 64 = 192
  • 4 x 8¹ = 4 x 8 = 32
  • 5 x 8⁰ = 5 x 1 = 5

Total decimal value = 192 + 32 + 5 = 229.

Octal is closely related to binary because each octal digit corresponds exactly to three binary digits (bits). This makes conversion between octal and binary straightforward.

Octal Digits and Binary Triplets
Octal Digit Binary Equivalent (3 bits)
0000
1001
2010
3011
4100
5101
6110
7111

Converting Octal to Binary

Replace each octal digit with its 3-bit binary equivalent.

Converting Binary to Octal

Group binary digits into sets of three (starting from the right) and convert each group to its octal digit.

Hexadecimal Number System

The hexadecimal number system uses base 16. It has 16 digits: 0-9 and letters A-F, where A=10, B=11, C=12, D=13, E=14, and F=15.

Each position represents a power of 16.

For example, the hexadecimal number 2F means:

  • 2 x 16¹ = 2 x 16 = 32
  • F x 16⁰ = 15 x 1 = 15

Total decimal value = 32 + 15 = 47.

Hexadecimal is related to binary because each hex digit corresponds to exactly four binary digits (bits).

Hexadecimal Digits and Binary Nibbles
Hex Digit Decimal Value Binary Equivalent (4 bits)
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Converting Hexadecimal to Binary

Replace each hex digit with its 4-bit binary equivalent.

Converting Binary to Hexadecimal

Group binary digits into sets of four (starting from the right) and convert each group to its hex digit.

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 78 by 2.

78 / 2 = 39, remainder = 0

Step 3: Divide 39 by 2.

39 / 2 = 19, remainder = 1

Step 4: Divide 19 by 2.

19 / 2 = 9, remainder = 1

Step 5: Divide 9 by 2.

9 / 2 = 4, remainder = 1

Step 6: Divide 4 by 2.

4 / 2 = 2, remainder = 0

Step 7: Divide 2 by 2.

2 / 2 = 1, remainder = 0

Step 8: Divide 1 by 2.

1 / 2 = 0, remainder = 1

Step 9: Write the remainders from bottom to top:

1 0 0 1 1 1 0 0

Answer: 156 in decimal = 10011100 in binary.

Example 2: Convert Binary 110101 to Decimal Easy
Convert the binary number 110101 to decimal.

Step 1: Write the place values (powers of 2) from right to left:

Positions: 5 4 3 2 1 0

Powers: 2⁵ 2⁴ 2³ 2² 2¹ 2⁰

Values: 32 16 8 4 2 1

Step 2: Multiply each binary digit by its power of 2:

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

Step 3: Add all the results:

32 + 16 + 0 + 4 + 0 + 1 = 53

Answer: Binary 110101 = Decimal 53.

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

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

101 110

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

  • 101 = 1x4 + 0x2 + 1x1 = 4 + 0 + 1 = 5
  • 110 = 1x4 + 1x2 + 0x1 = 4 + 2 + 0 = 6

Step 3: Write the octal digits in the same order:

Octal = 65

Answer: Binary 101110 = Octal 65.

Example 4: Convert Hexadecimal 2F to Binary and Decimal Medium
Convert the hexadecimal number 2F to binary and decimal.

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

  • 2 = 0010
  • F = 1111

Binary equivalent = 00101111

Step 2: Convert hex to decimal:

  • 2 x 16¹ = 2 x 16 = 32
  • F (15) x 16⁰ = 15 x 1 = 15

Decimal = 32 + 15 = 47

Answer: Hexadecimal 2F = Binary 00101111 = Decimal 47.

Example 5: Convert Octal 745 to Decimal Easy
Convert the octal number 745 to decimal.

Step 1: Write the place values (powers of 8):

Positions: 2 1 0

Values: 8² = 64, 8¹ = 8, 8⁰ = 1

Step 2: Multiply each digit by its place value:

  • 7 x 64 = 448
  • 4 x 8 = 32
  • 5 x 1 = 5

Step 3: Add the results:

448 + 32 + 5 = 485

Answer: Octal 745 = Decimal 485.

Formula Bank

Decimal to Base-N Conversion
\[ N = \sum_{i=0}^{k} d_i \times b^i \]
where: \(N\) = decimal number, \(d_i\) = digit at position \(i\), \(b\) = base, \(k\) = highest digit position
Base-N to Decimal Conversion
\[ N_{decimal} = \sum_{i=0}^{k} d_i \times b^i \]
where: \(N_{decimal}\) = decimal equivalent, \(d_i\) = digit at position \(i\), \(b\) = base, \(k\) = highest digit position

Tips & Tricks

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

When to use: Simplifies conversion between binary and octal/hexadecimal.

Tip: Memorize hexadecimal digits A-F as 10-15.

When to use: Quick conversion of hex digits to decimal or binary without confusion.

Tip: Use repeated division for decimal to binary/oct/hex conversions.

When to use: Manual conversion of decimal numbers to other bases.

Tip: Remember place values increase from right to left starting at 0.

When to use: Understanding positional value in all number systems.

Tip: Use the shortcut: 1 hex digit = 4 binary bits, 1 octal digit = 3 binary bits.

When to use: Quick conversions between binary and hex or octal.

Common Mistakes to Avoid

❌ Using digit 8 or 9 in octal numbers
✓ Remember octal digits range only from 0 to 7
Why: Students often apply decimal digit rules to other bases.
❌ Incorrect grouping of binary digits when converting to octal or hex
✓ Always group binary digits from right to left in sets of 3 (octal) or 4 (hex)
Why: Grouping from left or wrong group size leads to wrong conversions.
❌ Forgetting to multiply digits by correct power of base during conversion
✓ Assign positional powers starting at 0 from rightmost digit carefully
Why: Misalignment of powers leads to incorrect decimal values.
❌ Mixing up digit values in hexadecimal (e.g., writing B as 12 instead of 11)
✓ Memorize hex digit values: A=10, B=11, C=12, D=13, E=14, F=15
Why: Letter-digit mapping errors cause wrong conversions.
❌ Skipping steps in division or multiplication during conversions
✓ Write down all intermediate steps to avoid errors
Why: Rushing leads to calculation mistakes.

Key Takeaways

  • Number systems are based on a base (radix) defining digit range and place values.
  • Binary (base 2) uses digits 0 and 1, fundamental for computers.
  • Octal (base 8) digits range 0-7; each octal digit maps to 3 binary bits.
  • Hexadecimal (base 16) digits 0-9 and A-F; each hex digit maps to 4 binary bits.
  • Conversions rely on positional values and grouping binary digits for octal/hex.
  • Memorize hex digit values and use grouping shortcuts for quick conversions.
Key Takeaway:

Mastering these number systems and conversions is essential for understanding computer data representation.

✨ 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 Binary Octal Hex · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.