Konversi Sistem Bilangan (Biner, Oktal, Desimal dan Hexadesimal) bag. 1
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:
- Write down the binary number. For example,
1011
. - List the powers of 2 from right to left:
- (2^3, 2^2, 2^1, 2^0) → (8, 4, 2, 1)
- Multiply each binary digit by the corresponding power of 2:
- 1 × 8 = 8
- 0 × 4 = 0
- 1 × 2 = 2
- 1 × 1 = 1
- Add the results together:
- 8 + 0 + 2 + 1 = 11
- The decimal equivalent is 11.
Step 3: Converting Decimal to Binary
To convert from decimal to binary, use these steps:
- Start with the decimal number. For example,
11
. - Divide the number by 2 and record the quotient and the remainder.
- Repeat the division with the quotient until it equals 0.
- 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:
- 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
- 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:
- Group the binary number into sets of three digits starting from the right. Add leading zeros if necessary.
- 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.