File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to think in Octal?

 
DD
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
can anybody tell me how to think (and count) in Octal?
I mean...what if I get a question which asks me to tell the diff. b/w a decimal no. and an octal one I just realized that I'll be stumped!
-Deb
 
sean cee
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It's simple..
Decimal 0 1 2 3 4 5 6 7 8 9 then 10
Octal 0 1 2 3 4 5 6 7 8 then 10
how to convert Dec 113 to Oct?
113 div 8 = 14 with remainder 1
14 div 8 = 1 with remainder 6
1 div 8 = 0 with remainder 1
divide until you get 0 ... then look at the remainders ...
read them up from bottom..
so Decimal 113 = Octal 161
How do you convert Octal 161 to Dec 113?
gotta memorise one thing :
right most digit means 8 to the power of 0
2nd to right most digit means 8 to the power of 1
3rd to right most digit means 8 to the power of 2
so on...
take 161 ..
multiply right most 1 by 8 to the power of 0 which is 1 .
multiply 6 by 8 to the power of 1 which is 48.
multiply left most 1 by 8 to the power of 2 wichi is 64 .
add those three results which is 113 .. back to our octal number.
I don't know if I make any sense.. but this is kinna hard to explain over a message post.
Hope this helps
 
Graeme Brown
Ranch Hand
Posts: 193
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a quick way to convert binary to octal, just put it into groups of three digits and convert each. Example:
54321 decimal
= 1101010000110001 binary
split into groups (and pad with leading zeroes)
001 101 010 000 110 001
= 152061 octal
of course it is just as easy to go the other way
12345 octal
= 001 010 011 100 101 binary

[This message has been edited by Graeme Brown (edited October 25, 2000).]
 
DD
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean, thanks a million
the concept is now crystal clear thanks to u...
actually I used to do the same before I got hold of a scientific calculator during my engineering days!!! Guess that is an example of too much technology to do simple things...
anyhow....thanks again
-Deb
 
DD
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Graeme,
that was a pretty helpful way too
-Deb
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic