Octal Numbers

Like the hexadecimal number system, the octal number system provides a convenient way to express binary numbers and codes. However, it is used less frequently than hexadecimal in conjunction with computers and microprocessors to express binary quantities for input and output purposes.

The octal number system is composed of eight digits, which are

0, 1, 2, 3, 4, 5, 6, 7

To count above 7, begin another column and start over:

10, 11, 12, 13, 14, 15, 16, 17, 20, 21, ...

Counting in octal is similar to counting in decimal, except that the digits 8 and 9 are not used. To distinguish octal numbers from decimal numbers or hexadecimal numbers, we will use the subscript 8 to indicate an octal number. For instance, 15(8) in octal is equivalent to 13(10) in decimal and D in hexadecimal. Sometimes you may see an “o” or a “Q” following an octal number.

Octal to Decimal Conversion

Since the octal number system has a base of eight, each successive digit position is an increasing power of eight, beginning in the right-most column with 80 . The evaluation of an octal number in terms of its decimal equivalent is accomplished by multiplying each digit by its weight and summing the products, as illustrated here for 2374(8) .

Decimal to Octal Conversion

 A method of converting a decimal number to an octal number is the repeated divisionby-8 method, which is similar to the method used in the conversion of decimal numbers to binary or to hexadecimal. To show how it works, let’s convert the decimal number 359 to octal. Each successive division by 8 yields a remainder that becomes a digit in the equivalent octal number. The first remainder generated is the least significant digit (LSD).


Octal-to-Binary Conversion

 Because each octal digit can be represented by a 3-bit binary number, it is very easy to convert from octal to binary. Each octal digit is represented by three bits as shown in Table 2–4.

To convert an octal number to a binary number, simply replace each octal digit with the appropriate three bits.

EXAMPLE 1:

Convert each of the following octal numbers to binary:

(a) 13(8) 

(b) 25(8) 

(c) 140(8) 

(d) 7526(8)

Solution:


Binary to Octal Conversion

Conversion of a binary number to an octal number is the reverse of the octal-to-binary conversion. The procedure is as follows: Start with the right-most group of three bits and, moving from right to left, convert each 3-bit group to the equivalent octal digit. If there are not three bits available for the left-most group, add either one or two zeros to make a complete group. These leading zeros do not affect the value of the binary number. Number Systems, Operations, and Codes

EXAMPLE 1:

Convert each of the following binary numbers to octal:

(a) 110101 

(b) 101111001 

(c) 100110011010 

(d) 11010000100


Solution: