DE Notes
Complete guide to the octal number system (base-8) covering octal counting, conversions between octal-binary-decimal, arithmetic operations, and applications in computing.
The octal (base-8) number system uses eight digits and provides a compact way to represent binary numbers, with each octal digit corresponding to exactly three binary bits.
Fundamentals
Octal Counting
Positional Value
Octal to Decimal Conversion
Example: Convert 745₈ to decimal
Example: Convert 36.5₈ to decimal
Decimal to Octal Conversion
Example: Convert 259₁₀ to octal
259 ÷ 8 = 32 remainder 3 (LSD)
32 ÷ 8 = 4 remainder 0
4 ÷ 8 = 0 remainder 4 (MSD)
Read bottom to top: 259₁₀ = 403₈
Verify: 4×64 + 0×8 + 3×1 = 256 + 0 + 3 = 259 ✓
Fractional part: Convert 0.6875₁₀ to octal
| 0.6875 × 8 = 5.5 | integer part = 5 |
| 0.5 × 8 = 4.0 | integer part = 4 |
| Result | 0.6875₁₀ = 0.54₈ |
Octal to Binary Conversion (Direct Method)
Each octal digit maps to exactly 3 binary bits:
Example: Convert 572₈ to binary
Example: Convert 64.31₈ to binary
Binary to Octal Conversion
Group binary digits in sets of 3 (from the decimal point outward):
Example: Convert 10110101₂ to octal
Example: Convert 1101.10112 to octal
| Integer part (group from right): 001 101 | pad with leading zeros |
| Fraction part (group from left): 101 100 | pad with trailing zeros |
| Result | 1101.1011₂ = 15.54₈ |
Octal Arithmetic
Octal Addition
| Rules | Same as decimal but carry occurs at 8 instead of 10 |
| Example | 73₈ + 25₈ |
| Result | 73₈ + 25₈ = 120₈ |
| Verify | 59₁₀ + 21₁₀ = 80₁₀ = 120₈ ✓ |
Octal Subtraction
| Example | 52₈ - 17₈ |
| 2 - 7 | borrow 1 from next (2+8=10₁₀=12₈, 12-7=3₈... wait) |
| Actually | 2₈ < 7₈, borrow: (8+2)-7 = 3, borrow 1 |
| Result | 52₈ - 17₈ = 33₈ |
| Verify | 42₁₀ - 15₁₀ = 27₁₀ = 33₈ ✓ |
Applications of Octal System
- Unix/Linux File Permissions:
- Older Computer Systems: PDP-8 (12-bit words displayed as 4 octal digits)
- Aviation Transponder Codes: Squawk codes are 4-digit octal (0000-7777)
- Compact Binary Notation: Shorter than binary for documentation
Why Octal is Less Common Today
With 8-bit bytes becoming standard, hexadecimal (base-16) became more practical since each hex digit represents exactly 4 bits (one nibble), and two hex digits represent one byte perfectly. Octal's 3-bit grouping doesn't align cleanly with 8-bit bytes.
Interview Questions
Q1: Why does each octal digit correspond to exactly 3 binary bits? Because 8 = 2³. The octal system has 8 symbols (0-7), and 3 binary bits can represent exactly 8 values (000 to 111). This mathematical relationship makes conversion direct and trivial — no arithmetic needed, just group and substitute.
Q2: Convert 255₁₀ to octal without converting to binary first. 255 ÷ 8 = 31 remainder 7; 31 ÷ 8 = 3 remainder 7; 3 ÷ 8 = 0 remainder 3. Reading remainders upward: 255₁₀ = 377₈. (Note: 3×64 + 7×8 + 7 = 192 + 56 + 7 = 255 ✓)
Q3: Why is hexadecimal preferred over octal in modern computing? Modern computers use 8-bit bytes. Hexadecimal (base-16, 4 bits per digit) divides evenly into bytes (2 hex digits = 1 byte), while octal (3 bits per digit) does not cleanly represent bytes. A 16-bit address is 4 hex digits but requires 5+ octal digits with awkward boundaries.
Q4: In Unix, what does chmod 644 mean in binary? 6 = 110 (rw-), 4 = 100 (r--), 4 = 100 (r--). Full binary: 110 100 100. Owner has read+write, group has read-only, others have read-only.
Q5: Can you have a fractional octal number that doesn't terminate when converted to decimal? No. Every finite octal fraction converts to a terminating decimal fraction because 8 = 2³ and the only prime factor of 8 is 2, which is also a factor of 10. However, some terminating decimal fractions (like 0.1₁₀) do NOT terminate in octal.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Octal Number System — Digital Electronics.
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, octal, system
Related Digital Electronics Topics