Octal conversion

Scroll down to ger pdf

What Is the Octal Number System?

The Octal (base-8) number system uses digits from 0 to 7. It's used in computing as a shorthand for binary because 1 octal digit = 3 binary digits (bits).

Example:

  • Octal: 237₈

  • This is different from Decimal (237₁₀) or Binary (101011₂).

 1. Octal to Decimal – Explained

We convert each octal digit into a power of 8.

Decimal (base-10) is what we normally use. So, we want to rewrite the base-8 number into base-10, by evaluating powers of 8.

 Integral Part

Let’s take: 237₈

Break it down:

  • 2 × 8² = 2 × 64 = 128

  • 3 × 8¹ = 3 × 8 = 24

  • 7 × 8⁰ = 7 × 1 = 7

Now, add them:
128 + 24 + 7 = 159
So, 237₈ = 159₁₀

Fractional Part

Example: 0.52₈
We apply powers of 8 in negative, starting from −1.

  • 5 × 8⁻¹ = 5 × 0.125 = 0.625

  • 2 × 8⁻² = 2 × 0.015625 = 0.03125

Add: 0.625 + 0.03125 = 0.65625
So, 0.52₈ = 0.65625₁₀


2. Decimal to Octal – Explained

We reverse the above process.

Integral Part

Let’s convert: 159₁₀

We divide by 8 and collect remainders:

159 ÷ 8 = 19 remainder 7  

19 ÷ 8 = 2 remainder 3  

2 ÷ 8 = 0 remainder 2

Now read remainders bottom to top: 237₈

So, 159₁₀ = 237₈

Fractional Part

Take: 0.65625

Multiply the fractional part by 8:

0.65625 × 8 = 5.25 → Take 5  

0.25 × 8 = 2.0 → Take 2

No more fraction left → Stop

So, 0.65625₁₀ = 0.52₈

3. Octal to Binary – Explained

Since 8 = 2³, each octal digit = 3 binary digits

Example: 237₈

2 → 010  
3 → 011  
7 → 111
Join: 010011111
So, 237₈ = 10011111₂

4. Binary to Octal – Explained

We group binary digits into 3s:

  • From right (for whole numbers)

  • From left (for fractions)

Example: 10011111₂

Group: 010 011 111
Now convert each group:

  • 010 → 2

  • 011 → 3

  • 111 → 7

So, 10011111₂ = 237₈

5. Octal to Hexadecimal – Explained

Octal to Hex is not direct — we go through binary:

Steps:

  1. Octal → Binary (3 bits each)

  2. Binary → Group into 4 bits

  3. Each 4-bit group → Hex digit

Example: 237₈

Convert:

2 → 010  

3 → 011  

7 → 111  

→ 010011111

2. Pad left with 0 to make groups of 4:    0001 0011 1111

3. Convert:
  • 0001 → 1

  • 0011 → 3

  • 1111 → F

So, 237₈ = 13F₁₆

Click down to download the document:


Comments

Popular posts from this blog

Decimal to BCD Conversion (8421, 5421, 2421 Codes) – Digital Electronics

Decimal Number Conversion

Excess-3 (XS-3) Code in Digital Electronics – Explained with Examples