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

Number Systems Binary Decimal Octal Hexadecimal

Introduction to Number Systems

Numbers are a fundamental part of our daily lives, whether we are counting money in INR, measuring distances in metres, or telling time. But have you ever wondered how computers understand numbers? Computers use different number systems to represent and process data efficiently. A number system is a way to express numbers using a set of symbols and a base, also called radix.

The base or radix of a number system tells us how many unique digits or symbols it uses before starting to count with an additional digit. For example, the decimal system (which we use every day) has a base of 10, meaning it uses digits from 0 to 9. When we reach 9, we add another digit to represent 10.

Computers, however, work differently. They use electronic circuits that recognize two states: ON and OFF. This binary nature makes the binary number system (base 2) the most natural choice for computers. Besides binary, other number systems like octal (base 8) and hexadecimal (base 16) are also used in computing for convenience and compact representation.

Understanding these number systems and how to convert between them is essential for grasping how computers store, process, and display information.

Binary Number System

The binary number system uses only two digits: 0 and 1. Each digit in a binary number is called a bit (short for binary digit). Since computers operate using two voltage levels (high and low), binary is the most fundamental number system in computing.

Groups of 8 bits form a byte, which is a basic unit of data storage in computers. Each bit in a binary number has a place value that is a power of 2, starting from the rightmost bit (least significant bit).

Binary Place Values in an 8-bit Number
Bit Position 8 7 6 5 4 3 2 1 0
Place Value 128 64 32 16 8 4 2 1

For example, the binary number 10110010 can be understood by adding the place values of bits set to 1:

1x128 + 0x64 + 1x32 + 1x16 + 0x8 + 0x4 + 1x2 + 0x1 = 128 + 32 + 16 + 2 = 178 (in decimal)

Decimal Number System

The decimal number system is the most familiar system, used in everyday counting and calculations. It has a base of 10, using digits from 0 to 9. Each digit's place value is a power of 10, starting from the rightmost digit.

For example, the decimal number 345 can be expanded as:

3x10² + 4x10¹ + 5x10⁰ = 300 + 40 + 5 = 345

Because humans are used to decimal, it is often the starting point for understanding other number systems.

Octal Number System

The octal number system has a base of 8 and uses digits from 0 to 7. It was historically used in computing because it provides a more compact way to represent binary numbers. Each octal digit corresponds exactly to three binary digits (bits).

For example, the octal number 725 represents:

7x8² + 2x8¹ + 5x8⁰ = 7x64 + 2x8 + 5x1 = 448 + 16 + 5 = 469 (in decimal)

Octal is less common today but still useful in some programming and computing contexts.

Hexadecimal Number System

The hexadecimal number system has a base of 16 and uses sixteen symbols: digits 0-9 and letters A-F, where A=10, B=11, ..., F=15. Hexadecimal is widely used in computing because it represents binary data compactly - each hex digit corresponds to exactly four binary digits (bits).

For example, the hexadecimal number 3F represents:

3x16¹ + 15x16⁰ = 48 + 15 = 63 (in decimal)

Hexadecimal is commonly used in memory addresses, color codes in web design (like #FF5733), and low-level programming.

Conversions Between Number Systems

Converting numbers from one system to another is essential in computer knowledge. There are two main methods:

  • Division-Remainder Method: Used to convert from decimal to another base.
  • Positional Value Method: Used to convert from any base to decimal by summing each digit multiplied by its place value.

Let's look at how to convert between decimal, binary, octal, and hexadecimal with clear steps.

graph TD    A[Start with Decimal Number] --> B[Divide by 2 (for binary)]    B --> C[Write down remainder]    C --> D[Divide quotient by 2 again]    D --> E{Is quotient 0?}    E -- No --> B    E -- Yes --> F[Write remainders in reverse order]    F --> G[Binary Number obtained]    G --> H[Group binary digits in 4 bits]    H --> I[Convert each group to Hex digit]    I --> J[Hexadecimal Number obtained]

Summary of Conversion Steps

  • Decimal to Binary: Divide the decimal number by 2 repeatedly, noting the remainders. The binary number is the remainders read in reverse order.
  • Binary to Decimal: Multiply each bit by 2 raised to its position index and sum all values.
  • Octal to Binary: Convert each octal digit to its 3-bit binary equivalent.
  • Hexadecimal to Binary: Convert each hex digit to its 4-bit binary equivalent.

Applications of Number Systems in Computing

Number systems are not just theoretical concepts; they have practical uses in computing:

  • Data Representation: All data in computers, including text, images, and sound, is stored as binary numbers.
  • Memory Addressing: Memory locations are often represented in hexadecimal for readability.
  • Color Codes: Hexadecimal numbers are used to define colors in web design and graphics.
Number SystemBase (Radix)Digits UsedExample NumberCommon Use
Binary20,11011Data representation in computers
Decimal100-9156Everyday counting
Octal80-7725Legacy computing, compact binary
Hexadecimal160-9, A-F3FMemory addresses, color codes

Formula Bank

Binary to Decimal Conversion
\[ N_{10} = \sum_{i=0}^{k} 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}^{k} o_i \times 8^i \]
where: \(N_{10}\) = decimal number, \(o_i\) = octal digit (0-7) at position \(i\), \(i\) = position index starting from 0 (rightmost digit)
Hexadecimal to Decimal Conversion
\[ N_{10} = \sum_{i=0}^{k} h_i \times 16^i \]
where: \(N_{10}\) = decimal number, \(h_i\) = hex digit (0-9, A-F) at position \(i\), \(i\) = position index starting from 0 (rightmost digit)
Example 1: Convert Decimal 156 to Binary Easy
Convert the decimal number 156 into its binary equivalent using the division-remainder method.

Step 1: Divide 156 by 2.

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 in reverse order:

1 0 0 1 1 1 0 0

Answer: The binary equivalent of decimal 156 is 10011100.

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

Step 1: Write the place values for each bit (from right to left):

Bits: 1 0 1 1 0 1

Place values: 32 16 8 4 2 1

Step 2: Multiply each bit by its place value:

1x32 + 0x16 + 1x8 + 1x4 + 0x2 + 1x1 = 32 + 0 + 8 + 4 + 0 + 1 = 45

Answer: The decimal equivalent of binary 101101 is 45.

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

Step 1: Identify the decimal values of hex digits:

3 = 3, F = 15

Step 2: Write place values (16^1 and 16^0):

3 x 16 + 15 x 1 = 48 + 15 = 63

Answer: The decimal equivalent of hexadecimal 3F is 63.

Example 4: Convert Octal 725 to Binary Medium
Convert the octal number 725 to its binary equivalent.

Step 1: Convert each octal digit to 3-bit binary:

  • 7 (octal) = 111 (binary)
  • 2 (octal) = 010 (binary)
  • 5 (octal) = 101 (binary)

Step 2: Combine the binary groups:

111 010 101

Answer: The binary equivalent of octal 725 is 111010101.

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

Step 1: Write the numbers aligned:

1011

+ 1101

Step 2: Add bit by bit from right to left:

  • 1 + 1 = 10 (write 0, carry 1)
  • 1 + 1 + carry 1 = 11 (write 1, carry 1)
  • 0 + 0 + carry 1 = 1 (write 1, carry 0)
  • 1 + 1 = 10 (write 0, carry 1)

Step 3: Write down the final carry:

Carry 1

Step 4: Final sum:

11000

Answer: 1011 + 1101 = 11000 in binary.

Tips & Tricks

Tip: Group binary digits in sets of 3 (for octal) or 4 (for hexadecimal) starting from the right to simplify conversions.

When to use: When converting between binary and octal or hexadecimal to avoid errors and speed up the process.

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

When to use: When interpreting or converting hexadecimal numbers to decimal or binary.

Tip: Use repeated division by the base (2, 8, or 16) to convert decimal numbers to other bases quickly.

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

Tip: Memorize key place values such as \(2^0=1\), \(2^3=8\), \(16^2=256\) to speed up mental conversions.

When to use: During quick calculations or when a calculator is not allowed.

Tip: In binary addition, remember that 1 + 1 = 10 (write 0 and carry 1).

When to use: When adding binary numbers to avoid common mistakes.

Common Mistakes to Avoid

❌ Confusing place values when converting between number systems.
✓ Always write down place values explicitly before starting conversion.
Why: Forgetting positional weights leads to incorrect results.
❌ Misinterpreting hexadecimal letters as decimal digits.
✓ Recall that A=10, B=11, ..., F=15 in decimal.
Why: Lack of familiarity with hex digits causes errors.
❌ Skipping carry in binary addition.
✓ Carefully add bits and carry over when sum exceeds 1.
Why: Binary addition rules differ from decimal and can be overlooked.
❌ Incorrect grouping of binary digits when converting to octal or hexadecimal.
✓ Group bits from right to left in groups of 3 (octal) or 4 (hex).
Why: Improper grouping leads to wrong conversion.
❌ Using decimal subtraction methods directly on binary numbers.
✓ Use binary subtraction rules or convert to decimal first.
Why: Binary arithmetic requires different handling than decimal.
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 Decimal Octal Hexadecimal · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.