Konversi Sistem Bilangan (Biner, Oktal, Desimal dan Hexadesimal) bag. 1

3 min read 2 months ago
Published on Aug 25, 2024 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 between different numeral systems: binary, octal, decimal, and hexadecimal. Understanding these conversions is essential for various applications in computer science, programming, and digital electronics.

Step 1: Understanding Number Systems

Before diving into conversions, it's important to grasp the basics of each number system:

  • Binary (Base 2): Uses two digits, 0 and 1. Each digit represents a power of 2.
  • Octal (Base 8): Uses eight digits, from 0 to 7. Each digit represents a power of 8.
  • Decimal (Base 10): The most common system, using ten digits, from 0 to 9. Each digit represents a power of 10.
  • Hexadecimal (Base 16): Uses sixteen symbols, from 0 to 9 and A to F. Each digit represents a power of 16.

Step 2: Converting Binary to Decimal

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

  1. Write down the binary number. For example, 1011.
  2. List the powers of 2 from right to left:
    • (2^3, 2^2, 2^1, 2^0) → (8, 4, 2, 1)
  3. Multiply each binary digit by the corresponding power of 2:
    • 1 × 8 = 8
    • 0 × 4 = 0
    • 1 × 2 = 2
    • 1 × 1 = 1
  4. Add the results together:
    • 8 + 0 + 2 + 1 = 11
  5. The decimal equivalent is 11.

Step 3: Converting Decimal to Binary

To convert from decimal to binary, use these steps:

  1. Start with the decimal number. For example, 11.
  2. Divide the number by 2 and record the quotient and the remainder.
  3. Repeat the division with the quotient until it equals 0.
  4. Write down the remainders in reverse order.

Example for 11:

  • 11 ÷ 2 = 5 (remainder 1)
  • 5 ÷ 2 = 2 (remainder 1)
  • 2 ÷ 2 = 1 (remainder 0)
  • 1 ÷ 2 = 0 (remainder 1)
  • Remainders: 1, 0, 1, 1 → Binary is 1011.

Step 4: Converting Octal to Binary

To convert an octal number to binary, follow these steps:

  1. Take each octal digit and convert it to a 3-digit binary equivalent:
    • 0 = 000
    • 1 = 001
    • 2 = 010
    • 3 = 011
    • 4 = 100
    • 5 = 101
    • 6 = 110
    • 7 = 111
  2. Combine the binary representations. For example, octal 57:
    • 5 = 101
    • 7 = 111
    • Combined: 101111.

Step 5: Converting Binary to Octal

To convert binary to octal, follow these steps:

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

Example for binary 101111:

  • Group: 101 111
  • 101 = 5
  • 111 = 7
  • Octal is 57.

Conclusion

You've learned how to convert between binary, decimal, and octal number systems. Mastering these conversions is crucial for programming and working with digital systems. Next, you might want to explore hexadecimal conversions or practical applications in coding projects.

Table of Contents

Recent