Binary conversion
What is a Number System?
A number system is a way to represent numbers using a consistent set of symbols or digits. The base (or radix) of a number system determines how many unique digits it uses.
Types of Number Systems
1. Binary Number System (Base-2)
-
Digits Used: 0, 1
-
Base: 2
-
Application: Widely used in digital electronics, computers, and communication systems.
2. Octal Number System (Base-8)
-
Digits Used: 0 to 7
-
Base: 8
-
Application: Sometimes used in computing as a compact form of binary.
3. Decimal Number System (Base-10)
-
Digits Used: 0 to 9
-
Base: 10
-
Application: Most commonly used in daily human activities and calculations.
4. Hexadecimal Number System (Base-16)
-
Digits Used: 0–9 and A–F (where A=10, B=11, ..., F=15)
-
Base: 16
-
Application: Used in programming and debugging as a human-friendly representation of binary-coded values.
1. Decimal to Binary (Integral Part)
Steps:
-
Divide the decimal number by 2.
-
Record the remainder.
-
Repeat the process until the quotient becomes 0.
-
The binary number is the remainder sequence read in reverse.
Example: Convert 13 to binary
13 ÷ 2 = 6 → R1
6 ÷ 2 = 3 → R0
3 ÷ 2 = 1 → R1
1 ÷ 2 = 0 → R1
Binary = 1101
2. Decimal to Binary (Fractional Part)
Steps:
-
Multiply the fractional part by 2.
-
Record the whole number part of the result.
-
Repeat with the new fractional part.
-
Stop when the fraction becomes 0 or repeats.
-
The binary result is read in sequence after the decimal point.
Example: Convert 0.625 to binary
0.625 × 2 = 1.25 → 1
0.25 × 2 = 0.5 → 0
0.5 × 2 = 1.0 → 1
Binary = .101
3. Decimal to Binary (Integral + Fraction)
Example: Convert 13.625 to binary
-
Integer part (13) →
1101 -
Fractional part (.625) →
.101
Binary = 1101.101
4. Binary to Decimal Conversion
For Integer: Multiply each bit by 2ⁿ, where n is its position from the right (starting from 0).
For Fraction: Multiply each bit after the decimal by 2⁻ⁿ (starting from 1).
Example: Convert 1101.101 to decimal
= 1×2³ + 1×2² + 0×2¹ + 1×2⁰ → 8 + 4 + 0 + 1 = 13
+ 1×2⁻¹ + 0×2⁻² + 1×2⁻³ → 0.5 + 0 + 0.125 = 0.625
Decimal = 13.625


Comments
Post a Comment