Octal

The octal system ( from the Latin octo, eight ') is a value system with base 8 (hence also called octal system ). Knows eight digits for representation of a number: 0, 1, 2, 3, 4, 5, 6 and 7

Its origins can be found in the 17th century Sweden; as author coming King Charles XII. , the scientist Emanuel Swedenborg or the inventor Christopher Polhem in question.

Counting in octal

When counting in octal system is to be noted that after 7 not 8 Instead, a body must be increased left. In the octal system applies: 7 1 = 10 The application of this rule is illustrated below:

Applications

Application in computer technology: Each digit of an octal number can be represented by three bits. Conversely, can be produced from a binary number by grouping three easy bit octal. Octal numbers are still used in the representation of file permissions under Unix, where three bits represent the rights of a user class (see chmod ). As data words of 24 bits in length were still in use, the range of values ​​exactly corresponded to an eight-digit octal, octal numbers were used for input and output of bit patterns, as they are informative to the people as binary numbers and because the conversion is to and from binary simple. For the now -standard data word lengths 16, 32 and 64, the hexadecimal for input and output is the better.

Application in aviation: The transponder code ( squawk ) on each aircraft uses octal numbers.

Identification

Octal numbers are often characterized by a trailing O (also known as Intel Convention). In the programming languages ​​C, Java and Python ( versions up to 2.x), a 0 (zero) is prefixed to distinguish an octal number by a decimal number ( which can lead to difficult to detect subtle mistake: 0715 is not equal to 715). In Python 3000 for better differentiation is a zero and a o prefixed (eg 0o715 ). In TeX an octal number is marked by a preceding apostrophe. After Motorola convention octal numbers are, however, marked by a prefixed @ sign ( eg @ 715). Under DR- DOS DEBUG octal supported in conjunction with the prefix \ (eg \ 715).

In mathematics, often the base of the number system is joined to the number, for example 172 (8) = 122 (10).

Converting decimal to octal

A (natural ) decimal number can be converted to an octal number by repeatedly divided by the base 8 and the resulting division remainders are noted. For example, three processing steps are required for the 122 decimal (10):

The division remainders from bottom to top read give the octal number 172 (8).

Conversion of octal numbers to decimal numbers

To a (natural ) octal number to convert to a decimal, you have to multiply each digit with the respective power of the base. The exponent of the base corresponding to the location of the point, wherein the rightmost point, the zero is assigned. Example 172 ( 8) (with the notation of the calculation is performed in the decimal system ):

The same as the above terms represents this table; one takes the column name (eg ) " 81 = 8" with the value specified in the cell times; So if "= 8 81 " a 3 is in row 1, column, so if we include " 81 x 3 "

Representation of rational and real numbers

As with all value systems, any rational or real numbers in the octal system can be represented. As a separator between the integer and the fractional part of the number in German-speaking countries usually serves the comma. The values ​​of the digits after the separator are multiplied by, the position after the decimal point indicates.

For example for the conversion of 34.56 (8), the decimal (with the notation of the calculation carried out in the decimal system ):

In the reverse direction to convert the fractional part of a decimal number to octal by continual multiplication by 8, whereby each of the integer portion of the result provides an octal digit. For example, three processing steps are required for decimal 0.3984375 (10):

The desired octal number is therefore 0.314 (8).

Of course, it may happen that this process does not break off and there is therefore an infinite Oktalbruchdarstellung. A periodic display is possible, as in the following example, the conversion of 0,2 (10) is:

Now repeat the lines, and the desired octal number is therefore.

Every rational number has a finite or infinite periodic Oktalbruchentwicklung. Is being a whole and is a natural number, and this fraction is reduced (ie and -prime), then if and only has a finite Oktalbruchentwicklung when a power of two.

As usual with value systems, the representation of rational numbers is not always clear; For example, one has in addition to the representation 1 and the following as a periodic Oktalbruch:

Trivia

The alien Na'vi from the film Avatar - Pandora use the octal system, as they have four fingers on each hand.

27922
de