DE Notes
Master all number system conversions between binary, decimal, octal, and hexadecimal with step-by-step examples, shortcut methods, and practice problems.
Being able to fluently convert between binary, decimal, octal, and hexadecimal is an essential skill in digital electronics. This guide covers all conversion paths with detailed methods.
Conversion Map
┌─────────┐
│ DECIMAL │
│(Base 10)│
└────┬────┘
÷/×10 │ ÷/×10
┌─────────┼─────────┐
↓ ↓ ↓
┌───────┐ ┌──────┐ ┌───────┐
│BINARY │ │OCTAL │ │ HEX │
│(Base 2)│ │(Base8)│ │(Base16)│
└───┬───┘ └──┬───┘ └───┬───┘
│ 3bits│ │4bits │
└─────────┴─────────┘
Direct (group bits)
1. Decimal to Binary
Method: Repeated Division by 2
Convert 156₁₀ to binary:
156 ÷ 2 = 78 remainder 0 (LSB)
78 ÷ 2 = 39 remainder 0
39 ÷ 2 = 19 remainder 1
19 ÷ 2 = 9 remainder 1
9 ÷ 2 = 4 remainder 1
4 ÷ 2 = 2 remainder 0
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1 (MSB)
Answer: 156₁₀ = 10011100₂
Verify: 128+16+8+4 = 156 ✓
Fractional Part: Repeated Multiplication by 2
Convert 0.3125₁₀ to binary:
| 0.3125 × 2 = 0.625 | 0 |
| 0.625 × 2 = 1.25 | 1 |
| 0.25 × 2 = 0.5 | 0 |
| 0.5 × 2 = 1.0 | 1 |
| Answer | 0.3125₁₀ = 0.0101₂ |
| Verify | 0×0.5 + 1×0.25 + 0×0.125 + 1×0.0625 = 0.3125 ✓ |
2. Binary to Decimal
Method: Positional Weight Addition
Convert 11010110₂ to decimal:
| Position | 7 6 5 4 3 2 1 0 |
| Binary | 1 1 0 1 0 1 1 0 |
| Weight | 128 64 32 16 8 4 2 1 |
3. Decimal to Octal
Method: Repeated Division by 8
Convert 500₁₀ to octal:
500 ÷ 8 = 62 remainder 4 (LSD)
62 ÷ 8 = 7 remainder 6
7 ÷ 8 = 0 remainder 7 (MSD)
Answer: 500₁₀ = 764₈
Verify: 7×64 + 6×8 + 4 = 448+48+4 = 500 ✓
4. Decimal to Hexadecimal
Method: Repeated Division by 16
Convert 1000₁₀ to hex:
1000 ÷ 16 = 62 remainder 8 (LSD)
62 ÷ 16 = 3 remainder 14 (E)
3 ÷ 16 = 0 remainder 3 (MSD)
Answer: 1000₁₀ = 3E8₁₆
Verify: 3×256 + 14×16 + 8 = 768+224+8 = 1000 ✓
5. Binary to Octal (Direct)
Group binary bits in 3s from right:
Convert 110101011₂ to octal:
6. Binary to Hexadecimal (Direct)
Group binary bits in 4s from right:
Convert 110101011110₂ to hex:
7. Octal to Hexadecimal
Convert through binary:
Example: Convert 372₈ to hexadecimal
| Step 1: Octal | Binary (expand each digit to 3 bits) |
| Binary | 011111010 |
| Step 2: Binary | Hex (group by 4 from right) |
| Answer | 372₈ = FA₁₆ (or 0FA₁₆) |
8. Hexadecimal to Octal
Example: Convert 2AC₁₆ to octal
| Step 1: Hex | Binary (expand each digit to 4 bits) |
| Binary | 001010101100 |
| Step 2: Binary | Octal (group by 3 from right) |
| Answer | 2AC₁₆ = 1254₈ |
Quick Conversion Table
Conversion with Fractional Numbers
Example: Convert 25.75₁₀ to all bases
Integer part (25)
Binary: 25 → 11001₂
Octal: 25 → 31₈
Hex: 25 → 19₁₆
Fractional part (0.75):
Binary: 0.75×2=1.5→1, 0.5×2=1.0→1 → 0.11₂
Octal: 0.75×8=6.0→6 → 0.6₈
Hex: 0.75×16=12.0→C → 0.C₁₆
Results
25.75₁₀ = 11001.11₂ = 31.6₈ = 19.C₁₆
Common Mistakes to Avoid
- Grouping direction: Always group from the decimal point outward
- Padding: Add leading/trailing zeros when groups are incomplete
- Hex letters: Remember A=10, B=11, C=12, D=13, E=14, F=15
- Octal digits: Never use 8 or 9 in octal (max digit is 7)
- Verification: Always verify by converting back to decimal
Interview Questions
Q1: What is the fastest way to convert between hex and octal? Convert through binary as an intermediate. Hex→Binary (4-bit groups)→Octal (3-bit groups) or vice versa. This avoids decimal arithmetic entirely and is a mechanical process of expanding and regrouping bits.
Q2: Convert 0.1₁₀ to binary. What do you observe? 0.1×2=0.2→0; 0.2×2=0.4→0; 0.4×2=0.8→0; 0.8×2=1.6→1; 0.6×2=1.2→1; 0.2×2=0.4→0; (repeats). Result: 0.000110011001100... It's a non-terminating repeating binary fraction. This is why floating-point representation of 0.1 introduces rounding errors in computers.
Q3: How many hex digits are needed to represent an n-bit binary number? Ceil(n/4) hex digits. For example, a 32-bit number needs exactly 8 hex digits, a 10-bit number needs 3 hex digits (with the leading digit using only 2 of its 4 bits).
Q4: Convert 777₈ to hexadecimal. 777₈ → 111 111 111₂ → 0001 1111 1111₂ → 1FF₁₆. Alternatively, 777₈ = 7×64+7×8+7 = 511₁₀ = 1×256+15×16+15 = 1FF₁₆.
Q5: Why can some decimal fractions not be represented exactly in binary? A decimal fraction terminates in binary only if its denominator (in lowest terms) has only 2 as a prime factor. For example, 0.5=1/2 terminates, 0.25=1/4 terminates, but 0.1=1/10 has 5 as a factor in the denominator, so it cannot be represented exactly in binary.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Number System Conversions.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Digital Electronics topic.
Search Terms
digital-electronics, digital electronics, digital, electronics, number, systems, system, conversions
Related Digital Electronics Topics