The Octal Number Base System

Although this was once a popular number base, especially in the Digital Equipment Corporation PDP/8 and other old computer systems, it is rarely used today. The Octal system is based on the binary system with a 3-bit boundary. The Octal Number System:

uses base 8
includes only the digits 0 through 7 (any other digit would make the number an invalid octal number)

The weighted values for each position is as follows:

8^5 8^4 8^3 8^2 8^1 8^0
32768 4096 512 64 8 1


Binary to Octal Conversion

It is easy to convert from an integer binary number to octal. This is accomplished by:

  1. Break the binary number into 3-bit sections from the LSB to the MSB.
  2. Convert the 3-bit binary number to its octal equivalent.

For example, the binary value 1010111110110010 will be written:

001 010 111 110 110 010
1 2 7 6 6 2


Octal to Binary Conversion

It is also easy to convert from an integer octal number to binary. This is accomplished by:

  1. Convert the decimal number to its 3-bit binary equivalent.
  2. Combine the 3-bit sections by removing the spaces.

For example, the octal value 127662 will be written:

1 2 7 6 6 2
001 010 111 110 110 010

This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more readable format.

Octal to Decimal Conversion

To convert from Octal to Decimal, multiply the value in each position by its Octal weight and add each value. Using the value from the previous example, 127662Q, we would expect to obtain the decimal value 44978.

1*8^5 2*8^4 7*8^3 6*8^2 6*8^1 2*8^0
1*32768 2*4096 7*512 6*64 6*8 2*1
32768 8192 3584 384 48 2

32768 + 8192 + 3584 + 384 + 48 + 2 = 44978

Decimal to Octal Conversion

To convert decimal to octal is slightly more difficult. The typical method to convert from decimal to octal is repeated division by 8. While we may also use repeated subtraction by the weighted position value, it is more difficult for large decimal numbers.

Repeated Division By 8

For this method, divide the decimal number by 8, and write the remainder on the side as the least significant digit. This process is continued by dividing he quotient by 8 and writing the remainder until the quotient is 0. When performing the division, the remainders which will represent the octal equivalent of the decimal number are written beginning at the least significant digit (right) and each new digit is written to the next more significant digit (the left) of the previous digit. Consider the number 44978.

Division Quotient Remainder Octal Number
44978 / 8 5622 2 2
5622 / 8 702 6 62
702 / 8 87 6 662
87 / 8 10 7 7662
10 / 8 1 2 27662
1 / 8 0 1 127662

As you can see, we are back with the original number. That is what we should expect.


Hexadecimal

Copyright (C) Andrew H. Andersen, Jr.

Page adapted from Brookdale Community College