answersLogoWhite

0


Best Answer

Repeatedly divide the number by 8 until the number is zero. Take the remainders from each division (the remainders will always be in the range 0 to 7 inclusive). The first division finds the lowest-order digit, the last finds the highest-order digit.

Example:

Decimal value: 421

421 / 8 = 52 r 5

52 / 8 = 6 r 4

6 / 8 = 0 r 6

The remainders are 6, 4 and 5, so 421 decimal is 645 octal.

To convert from octal to decimal, multiply each octal digit by 8^n, where n is the zero-based order of the digit (0 being the lowest order), then sum the products.

Example:

Octal number: 645

5 * (8^0) = 5 * 1 = 5

4 * (8^1) = 4 * 8 = 32

6 * (8^2) = 6 * 64 = 384

384 + 32 + 5 = 421

Note that n^0 = 1 for all n>=0.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert a decimal number to its octal What is the algorithm for it?
Write your answer...
Submit
Still have questions?
magnify glass
imp