### Converting Octal to Decimal
**Octal** is a base-8 numbering system, meaning it uses eight digits: 0, 1, 2, 3, 4, 5, 6, and 7. **Decimal** is a base-10 system, using ten digits: 0 through 9. To convert an octal number to its decimal equivalent, follow these steps:
1. **Identify the octal number** and its digits.
2. **Multiply each digit** of the octal number by \(8\) raised to the power of its positional index (starting from 0 for the rightmost digit).
3. **Sum** all the products to get the decimal equivalent.
#### Example 1: Convert Octal 157 to Decimal
1. Write the octal number: \(157\).
2. Break it down by each digit:
- \(1 \times 8^2\)
- \(5 \times 8^1\)
- \(7 \times 8^0\)
3. Calculate each term:
- \(1 \times 8^2 = 1 \times 64 = 64\)
- \(5 \times 8^1 = 5 \times 8 = 40\)
- \(7 \times 8^0 = 7 \times 1 = 7\)
4. Sum all the products:
- \(64 + 40 + 7 = 111\)
So, the decimal equivalent of the octal number \(157\) is **111**.
#### Formula Recap
Given an octal number \(O\), its decimal equivalent \(D\) is:
\[
D = \sum_{i=0}^{n} O_i \times 8^i
\]
where \(O_i\) is the \(i\)-th digit of the octal number starting from the right (with \(i = 0\)).
### Converting Decimal to Octal
To convert a decimal number to an octal number, use the following steps:
1. **Divide** the decimal number by 8.
2. **Record the remainder**.
3. **Divide the quotient** by 8 again and record the next remainder.
4. **Repeat** this process until the quotient becomes 0.
5. The **octal number** is the sequence of remainders read in reverse (from last to first).
#### Example 2: Convert Decimal 111 to Octal
1. Divide 111 by 8:
- Quotient: \(111 \div 8 = 13\)
- Remainder: \(111 \mod 8 = 7\)
2. Divide the quotient 13 by 8:
- Quotient: \(13 \div 8 = 1\)
- Remainder: \(13 \mod 8 = 5\)
3. Divide the quotient 1 by 8:
- Quotient: \(1 \div 8 = 0\)
- Remainder: \(1 \mod 8 = 1\)
4. Since the quotient is now 0, stop the division.
5. Read the remainders in reverse order: **157**.
So, the octal equivalent of the decimal number \(111\) is **157**.
### Summary
- **Octal to Decimal:** Multiply each digit by \(8^n\) where \(n\) is the position of the digit, starting from 0 on the right.
- **Decimal to Octal:** Divide the decimal number by 8 repeatedly, record the remainders, and read them in reverse order.