English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do I convert Octal to Decimal, and Decimal to Octal???
Please explain.

2007-02-17 21:54:20 · 7 answers · asked by Peter H 1 in Science & Mathematics Mathematics

7 answers

~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~ ~~~ ~~~
This method will be very clear once you practice with a couple of numbers. I learned how to convert number systems several ways and THIS IS THE EASIEST, THE CLEAREST...so you can remember years later.

First convert octal to decimal:
The octal number system consists of digits that multiply powers of 8. For example, the octal number 172 means 1 X 8² + 7 X 8¹ + 2 X 8º . If you add these up, you have the decimal representation of the octal number 172.

1 X 8² = 1 X 64 = 64 ... ... ... ... ... ... ... ..THIS IS
7 X 8¹ = 7 X 8 = 56 ... ... ... ... ... ... ... ... OCTAL (172)
2 X 8º = 2 X 1 = 2 ... ... ... ... ... ... ... ... ...TO DECIMAL (122)
-----------------------------
... ... ... ... ... ... 122
Add the decimal numbers on the right of the = sign above:
64 + 56 + 2 = ***122***, the decimal representation of octal 172.

Now convert decimal to octal by first converting decimal to binary, then binary to octal, because you can understand it better than plugging into a formula: (To convert between ANY number systems, remember that you can always convert to binary first. This may seem like an extra step or two, but if you practice it a few times, you will always remember it.)

Example: Convert decimal number 122 to octal.
[This means convert 1 X 10² + 2 X 10¹ + 2 X 10º...to...
(1st octal digit) X 8² + (2nd octal digit) X 8¹ + (3rd octal digit) X 8º.]

Solution: Write 122 in binary.
64 32 16 8 4 2 1 <== Binary Heading.
.1... 1...1..1.0.1.0 <== Binary representation of dec #122. *Line 1*
[ Ignore the periods, ... . I use them for spacing in this word processor.]

Now group the binary representation into groups of 3, starting from the right, adding zeros to the left to make three digits if there are less than three, because any octal digit, 0 - 7, can be represented by three binary digits. ( You use groups of three to represent octal digits because the largest digit in the octal system is 7 and that is
1 X 2² + 1 X 2¹ + 1 X 2º = 4 + 2 + 1 = 7 in the binary system. )

001 111 010 <=Binary number from *Line 1* above grouped into 3s.
Now put your little binary heading (4 2 1) above each group of three binary digits, and add up the 3-digit groups:

4 2 1 Binary Heading
0 0 1 = 1

4 2 1 Binary Heading
1 1 1 = 7

4 2 1 Binary Heading
0 1 0 = 2

The digits to the right of the equal signs form the octal number.

172 = Octal number representing decimal 122.<==***Answer***
1 X 8² + 7 X 8¹ + 2 X 8º ...=...1 X 10² + 2 X 10¹ + 2 X 10º
... ... (172 octal)... ... ... ... ... = ... ... (122 decimal)

Practice, practice will make this clear as a bell. \0/
~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~ ~~~ ~~~

2007-02-17 23:24:29 · answer #1 · answered by H. Scot 4 · 0 0

The octal system is based off powers of 8; the decimal is based off powers of 10. So:

"145" in decimal means 1(10^2) + 4(10^1) + 5(10^0) = 145
But "145" in octal means 1(8^2) + 4(8^1) + 5(8^0) = 64+32+5 = 101.

This second line shows how to convert a number in octal to a number in decimal: take the last number and multiply it by 8^0 (which is just 1), add this to the product of the second to last number and 8^1, add this sum to the product of the third to last number and 8^3, etc.

Converting decimal to octal, you need to try and work this in reverse. Subtract the biggest power of 8 you can from the number. Subtract the next biggest power of 8 from the result. Keep on doing this until you're left with a number less than 8. String up all the multiples you found and stick this remainder on the end.

Using "101" for example, to convert this number into octal, we note that 8^3=512 and 8^2 = 64. So 64 is the biggest power of 8 we can subtract from 101. We subtract it once and get 37. This gives us a number less than 101, so we move on to the next lowest power, 8^1. 8*4 = 32, which when subtracted from 37 gives us 5. We stop here because 5 is less than 8.

So 101 = 1(8^2) + 4(8^1) + 5(8^0). This means in octal the number 101 is "145".

2007-02-17 22:09:04 · answer #2 · answered by Anonymous · 0 0

Base decimal numbers are 10,000 1,000 100 10 and 1
Base Octal numbers are 4096 512 64 8 and 1
Convert decimal number 1234 to Octal. Divide 1234 by highest base octal number that can divide, that is (512.) So 1234/512=2.4101562....Ignore all non significant digits past the decimal point, just work with the integer of 2., the first digit of your Octal answer. 2X512=1024 and 1234-1024=210. Divide 210 by next highest Base Octal number, that is (64)
210/64=3.26125 again ignoring non-significant digits and 3 is 2nd digit of Octal answer, multiplied by the (64) is 3X64=192. Now subtract the 192 from the 210-192=18. Divide the 18 by next highest base octal no, that is (8) 18/8=2 . 2 is the 3rd digit of your Octal answer. Now 8X2=16 and 18-16=2 the last digit of the octal answer... So decimal 1234 = Octal 2322.
To convert from Octal to decimal is easier, No non-significant digits to worry about. Just multiply the Octal digits by the corresponding Base Octal numbers.
2322 is.... 2X512=1024 plus 3X64=192 plus 2X8 =16 plus 1X2=2
So Octal 2322 = 1024+192+16+2= decimal 1234. hope this helps.

2007-02-18 00:09:59 · answer #3 · answered by Anonymous · 0 0

write down the given number in decimal system and keep dividing it by 8. after dividing, whatever the remainder write on the side.... just furthur keep dividing the quotients by 8, until u get 0.
Then write the remailnders in order from bottom 2 top. Ex.
convert 123 in decimal sys 2 octal.
123/8
Quotient ------------------ Remainder
15--(123/8) ------------------ 3
1--(15/8) ------------------ 7
0---(1/8) --------------------- 1
therefore, 123 in decimal = 173 in octal

2 convert octal 2 decimal
write down the number and write 8^0, 8^1.... from left 2 right above the number... multiply the powet of 8, by the digit that comes below it, and add the products.
ex;- convert 173 in octal 2 decimal.
8^2 --------8^1----------- 8^0
1----------- 7 ------------- 3
_________________________________
64* 1--------- 8*7 ---------- 1*3
= 64 + 56 + 3 =
=123...
thats it!
we've got the number both ways....
its d same way 2 convert any number system into decimal and back

2007-02-17 22:16:48 · answer #4 · answered by methegr8 1 · 0 0

Fall back on the idea of positional notation. Like, in decimal, 123 actually means (1 times 10^2) + (2 times 10^1) + (3 times 10^0).
So, in octal, the positions for 123 would be (1 times 8^2) + (2 times 8^1) + (3 times 8^0). If you can get that down, you can handle binary and hexadecimal. Alternatively, my Radio Shack calculator will do it all for me out to a bunch of places.

2007-02-17 22:01:41 · answer #5 · answered by ZORCH 6 · 0 0

If you have your number N in base 8 (or any other bases like r ) in the form
N= ( a n-1 a n-2 … a1 a0 . a -1 a -2 …. a –m )r

You can use this expansion to convert it to base 10 :
N = ( a n-1 * r^n-1 + … + a0 * r ^0 + a -1 * r^-1 + … + a-m * r^-m)10

So i.e for converting (274)8 to base 10 you have :
N = 2 * 8^2 + 7 * 8 + 4 * 8^0 = (128)10 + (56)10 + (4)10 = (188)10

And for converting from base 10 to other bases (like r that is 8 here)you should use sequential divisions by r until the quotient is 0

(234)10 =(?)8

Dividend-----quotient----Remainder

234-----------29-----------2
29-------------3------------5
3--------------0-------------3

So the answer is the remainders from below = (352)8

2007-02-17 22:21:05 · answer #6 · answered by Anonymous · 0 0

You can learn theory easily. Difference in counting is,
0,1,2,3,4,5,6,7,8,9,10,11 Decimal
0,1,2,3,4,5,6,7,10,11,12, Octal

There is no 8 & 9 in octal. The simplest way to convert numbers is using the Scientific calculator that comes with Windows. For exams you have to learn though.

2007-02-17 22:33:37 · answer #7 · answered by nayanmange 4 · 0 0

fedest.com, questions and answers