When would one use Octal?

Started by
3 comments, last by Anon Mike 19 years, 3 months ago
Decimal is the number system we're all familiar with, and what you interact with the user with. Hexadecimal is 4 bits in a digit, or exactly half a byte in a digit. So 2 digits per byte. Very useful when working with bits. Octal is 3 bits in a digit. Not quite half, and over a third, of a byte. The only even fit is in multiples of 3 bytes. Might be useful when working with bits, but I'd think hex would suit that purpose better. So when is it more useful than hexadecimal? I assume I'm missing something here.
----Erzengel des Lichtes光の大天使Archangel of LightEverything has a use. You must know that use, and when to properly use the effects.♀≈♂?
Advertisement
Octal is sometimes useful. It does not mean that it is used on a wide scale. A particular use of octal is (for exemple) the unix access rights (three octal digits).

What you are probably missing is the tool value. A tool is only used when you need to use it. Since octal notation is only a tool, you use it only when this representation fits your needs.

HTH,
The numbering systems you mentioned have different bases. Decimal is base 10. Hexidecimal is base 16, Binary is base 2 and Octal is base 8. The base numbers accord with the number of symbols in each given number system.

It is too painful and laborious for humans to use binary (base 2) number system which computers use. We can't really read it so we represent it with hex (base 16) which is easier to work with. The reason we use hex is like this:

Take your four bits -- how many unique bit patterns can be created? The answer is 2 to the power of 4 which equates to 16. The same number of symbols in hexidecimal form.

Frankly, Octal isn't really useful to humans with regards to computers. The only example I can think of it being used is in the CHMOD unix command (access rights).
Quote:Original post by Erzengeldeslichtes
...<cut>...
So when is it more useful than hexadecimal? I assume I'm missing something here.


well, sure, you asked for when it's used so let's start there. It isn't. Hexadecimal seems to match our needs more since it helps us write binary basicly, octal is more or less a pain in the ass using current 32 bit processors.

But I can say I've programmed a bunch of weird processors in my time (mostly in school thogh) and once I was shown a machine which programmed a kind of early "PLC" system, a system which controlled airflow to cylinders, for industrial machinery. Of course I couldn't let that slip through my hands :-)

Basicly what I could do was to enter a 200 line octal assembler to make some cylinders go back and forth in order, and to react on input such as microswitches. First I wrote the whole program on paper, then I entered it on a octal keyboard with a enter button more or less.

... and it helps to understand octal when the joke about why programmers always confuse x-mas with halloween comes up.. because 31oct = 25dec....

Cheers
Albert "thec" Sandberg
-------------------------------------------http://www.thec.org
Octal is really a relic from the days of machines with odd word sizes. It was probably really useful when programming the PDP8 (12 bit words). And perhaps PDP1 (18 bit words), although I don't think C was around at that time.

Nowadays when everybody uses powers of 2 for everything (8, 16, 32, 64, etc) octal doesn't really work and hexadecimal is much more convienent. I've never had any use for octal. Although I often wish that C/C++ had a way to specify a binary constant.
-Mike

This topic is closed to new replies.

Advertisement