Binary Number System
Binary Number System
- The Binary Number System is a base-2 numeral system that uses only two digits: 0 and 1 to represent all numerical values.
- It is the fundamental number system used in digital electronics and computing, where each digit (called a bit) represents an on (1) or off (0) state of a switch or transistor.
Why Binary Number Systems is important?
- Computers use transistors (tiny switches) that can only be ON (1) or OFF (0).
- Binary number systems simplify hardware design:
- Reliability: Easier to distinguish between two states (voltage levels).
- Error resistance: Less prone to misinterpretation than multiple voltage levels.
Binary Number Structure (Place Values in Binary)
- Each digit in a binary number represents a power of 2, starting from the right (least significant bit, LSB) to the left (most significant bit, MSB).
- Rightmost digit is at position
- Each position represents a power of 2
Position (n) | Power Of 2 |
---|---|
0 | 20 = 1 |
1 | 21 = 2 |
2 | 22 = 4 |
3 | 23 = 8 |
4 | 24 = 16 |
5 | 25 = 32 |
6 | 26 = 64 |
7 | 27 = 128 |
8 | 28 = 256 |
9 | 29 = 512 |
Example 1: Binary 1011 is equivalent to (?) decimal number
Solution:
= (1×23) + (0×22) + (1×21) + (1×20)
= (1×8) + (0×4) + (1×2) + (1×1)
= 8 + 0 + 2 + 1
= 11 (Decimal)
Given Binary Digits: | 1 | 0 | 1 | 1 |
---|---|---|---|---|
Position in Binary Number System: | 3 | 2 | 1 | 0 |
Powers of 2: | 23 | 22 | 21 | 20 |
Values: | 8 | 0 | 2 | 1 |
Total: | 8 + 0 + 2 + 1 = 11 |
Binary number 1011 is equivalent to decimal number 11.
Binary Number to Decimal number Conversion
Steps of Conversion:
- Write down the binary number.
- Assign powers of 2 from right to left.
- Multiply each binary digit by its power of 2.
- Add up the results.
Example 2: Convert 1101₂ to Decimal
Solution:
= (1×23) + (1×22) + (0×21) + (1×20)
= (1×8) + (1×4) + (0×2) + (1×1)
= 8 + 4 + 0 + 1
= 13 (Decimal)
Given Binary Digits: | 1 | 1 | 0 | 1 |
---|---|---|---|---|
Position in Binary Number System: | 3 | 2 | 1 | 0 |
Powers of 2: | 23 | 22 | 21 | 20 |
Values: | 8 | 4 | 0 | 1 |
Total: | 8 + 4 + 0 + 1 = 13 |
Example 3: Convert 1101₂ to Decimal
Solution:
To convert the binary number 11011.1010 to decimal, we’ll break it into two parts:
- Integer part (11011) → Convert using powers of 2 (left of the point).
- Fractional part (0.1010) → Convert using negative powers of 2 (right of the point).
Step 1: Convert the Integer Part (11011) to Decimal
Each digit represents a power of 2, starting from the rightmost bit (LSB = 2⁰).
Binary Digit | 1 | 1 | 0 | 1 | 1 |
---|---|---|---|---|---|
Position (n) | 4 | 3 | 2 | 1 | 0 |
Power of 2 | 24 = 16 | 23 = 8 | 22 = 4 | 21 = 2 | 20 = 1 |
Calculation:
= (1×16) + (1×8) + (0×4) + (1×2) + (1×1)
= 16 + 8 + 0 + 2 + 1
= 27
∴ 11011 (Binary) = 27 (Decimal)
Step 2: Convert the Fractional Part (0.1010) to Decimal
Each digit represents a negative power of 2, starting from the leftmost bit (2⁻¹).
Binary Digit | 1 | 0 | 1 | 0 |
---|---|---|---|---|
Position (n) | -1 | -2 | -3 | -4 |
Power of 2 | 0.5 | 0.25 | 0.125 | 0.0625 |
Calculation:
= (1×0.5) + (0×0.25) + (1×0.125) + (0×0.0625)
= 0.5 + 0 + 0.125 + 0
= 0.625
∴ 0.1010 (Binary) = 0.625 (Decimal)
Step 3: Combine Both Parts
Integer part: 27
Fractional part: 0.625
Answer: Final Decimal Value is
11011.1010 (Binary)=27.625 (Decimal)
Decimal to Binary Conversion
Step-by-Step (Division-by-2 Method):
- Divide the decimal number by 2.
- Write down the remainder (0 or 1).
- Repeat the division with the quotient until it becomes 0.
- The binary number is the remainders read in reverse order.
Example 4: Convert 19₁₀ to Binary
Solution:
9 ÷ 2 = 4, remainder = 1
4 ÷ 2 = 2, remainder = 0
2 ÷ 2 = 1, remainder = 0
1 ÷ 2 = 0, remainder = 1
Binary: Read remainders in reverse = 10011₂
Answer: 19₁₀ = 10011₂
Example 5: Convert 25₁₀ to Binary
Solution:
12 ÷ 2 = 6, remainder = 0
6 ÷ 2 = 3, remainder = 0
3 ÷ 2 = 1, remainder = 1
1 ÷ 2 = 0, remainder = 1
Binary: Read remainders in reverse = 11001₂
Answer: 25₁₀ = 11001₂
Example 6: Convert 107.25₁₀ to Binary
Solution:
To convert the decimal number 107.25 into binary, we’ll break it into two parts:
- Integer part (107) → Convert using division by 2
- Fractional part (0.25) → Convert using multiplication by 2
Step 1: Convert Integer Part (107) to Binary
Method: Repeated division by 2, recording remainders.
Division | Quotient | Remainder |
---|---|---|
107 ÷ 2 | 53 | 1 (LSB) |
53 ÷ 2 | 26 | 1 |
26 ÷ 2 | 13 | 0 |
13 ÷ 2 | 6 | 1 |
6 ÷ 2 | 3 | 0 |
3 ÷ 2 | 1 | 1 |
1 ÷ 2 | 0 | 1 (MSB) |
Binary Representation (Bottom to Top): 1101011 |
Read remainders from bottom to top:
107 (Decimal) = 1101011 (Binary)
Step 2: Convert Fractional Part (0.25) to Binary
Method: Repeated multiplication by 2, recording integer parts.
Multiplication | Result | Integer Part |
---|---|---|
0.25 × 2 | 0.5 | 0 (MSB) |
0.5 × 2 | 1.0 | 1 (LSB) |
Fractional Binary Representation (Top to Bottom): .01 |
Read integer parts from top to bottom:
0.25 (Decimal) = 0.01 (Binary)
Step 3: Combine Both Parts
Integer part: 107 (Decimal) = 1101011 (Binary)
Fractional part: 0.25 (Decimal) = 0.01 (Binary)
Answer: Final Binary Representation is
107.25 (Decimal) = 1101011.01 (Binary)