Tutorial Lengkap: Konversi Bilangan Biner, Oktal, Desimal, dan Heksadesimal

3 min read 8 hours ago
Published on Feb 13, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the process of converting numbers between binary, decimal, octal, and hexadecimal systems. Understanding these conversions is essential for various applications in programming and computer science. By following this step-by-step guide, you will gain confidence in performing these conversions for your needs.

Step 1: Understanding Number Systems

Before diving into conversions, it's crucial to understand the four number systems:

  • Binary (Base 2): Uses only two digits, 0 and 1.
  • Decimal (Base 10): The standard numbering system we use daily, consisting of digits from 0 to 9.
  • Octal (Base 8): Uses digits from 0 to 7.
  • Hexadecimal (Base 16): Uses digits from 0 to 9 and letters A to F (where A = 10, B = 11, C = 12, D = 13, E = 14, F = 15).

Step 2: Converting Binary to Decimal

To convert a binary number to decimal, follow these steps:

  1. Write down the binary number.
  2. Assign powers of 2 to each digit, starting from the rightmost digit (which is 2^0).
  3. Multiply each binary digit by its corresponding power of 2.
  4. Sum all the results.

Example: Convert binary 1011 to decimal.

  • 1 × 2^3 = 8
  • 0 × 2^2 = 0
  • 1 × 2^1 = 2
  • 1 × 2^0 = 1

Total = 8 + 0 + 2 + 1 = 11 (Decimal)

Step 3: Converting Binary to Octal

To convert a binary number to octal, use the following method:

  1. Group the binary digits into sets of three, starting from the right. Add leading zeros if necessary.
  2. Convert each group to its octal equivalent.

Example: Convert binary 101110 to octal.

  • Group into sets: 10 111 0 becomes 010 111 000 (adding leading zeros)
  • Convert each group:
    • 010 = 2
    • 111 = 7
    • 000 = 0

Result: 270 (Octal)

Step 4: Converting Binary to Hexadecimal

For converting binary to hexadecimal, follow these steps:

  1. Group the binary digits into sets of four, starting from the right. Add leading zeros if necessary.
  2. Convert each group to its hexadecimal equivalent.

Example: Convert binary 10110101 to hexadecimal.

  • Group into sets: 1011 0101
  • Convert each group:
    • 1011 = B
    • 0101 = 5

Result: B5 (Hexadecimal)

Step 5: Practice with Examples

To solidify your understanding, practice with these conversions:

  • Convert binary 111000 to decimal.
  • Convert binary 110101 to octal.
  • Convert binary 11110010 to hexadecimal.

Conclusion

You have now learned how to convert numbers between binary, decimal, octal, and hexadecimal systems. Understanding these conversions is vital in programming and computer science. Practice these methods with various examples to enhance your skills. For further learning, explore more complex conversions and applications in programming languages.