Octal Number System
- Muhammad Shahid
- m_shahid@live.co.uk
- 542 Views
- 0 Comments
Octal Number System
The Octal numbering system is another digital numbering system that uses the Base-8 system like the previously discussed Hexadecimal numbering system having the Base-16 system. The Oct- is a combining form used as a prefix meaning “eight” and that is why Base-8 (eight) system is termed an Octal numbering system. Likewise the Hexadecimal number, the octal numbering system reduces the size of an equivalent large binary number and makes it convenient to read and write to the original large binary number.
A numbering system’s digit has a range of numbers that it can use to express its value. This range is dependent on the base value of the numbering system i.e. Base-10 (decimal), Base-16 (Hexadecimal), or Base-8 (Octal), etc. For example, Base-10 and Base-16 systems have ranges of “10” and “16” numbers, respectively. Similarly, Base-8 (Octal) numbering system has a range of only “8” numbers from “0” to “7” i.e. 0, 1, 2, 3, 4, 5, 6, and 7. The octal numbers have only eight (8) distinct values for each digit and each digit has a weight of eight (8) starting from the least significant digit (LSD). In order to accommodate and express “8” numbers in binary, only three (3) bits are required. Following this, the octal values (0, 1, 2, 3, 4, 5, 6, and 7) corresponds to binary equivalent values (000, 001, 010, 011, 100, 101, 110, and 111), respectively.
The octal number is formed by grouping binary numbers in sets of 3-bits. It follows the same procedure adopted, previously, in the Hexadecimal article. However, in Hexadecimal numbers, a binary number was segregated into groups of 4-bits (as Base-16 uses the “0” to “15” range and requires 4-bits). The Octal numbering system is simple compared to the Hexadecimal numbering system as it uses only numbers compared to Hexadecimal using numbers plus alphabets. Moreover, it has only eight “8” distinct values compared to Hexadecimal’s sixteen “16” distinct values. In the early era of digital computing, the octal numbering system was very famous as digital inputs (D0 to D7) and outputs (Q0 to Q7) were in counts of eight (8). However, with the increase in the number of digital inputs and outputs, system architecture and memory size, etc. the hexadecimal numbering system has become more convenient for representing large binary values.
Representation of an Octal Number
The octal numbering system uses the Base-8 system and, as such, an octal number is represented by a subscript “8”. For example, the (1428) is identified as an octal number as it has a subscript of “8”. Further, it is noticeable that each digit of an octal number has a value between 0 and 7. For example, an octal number (1288) is wrong as its least significant digit (LSD) has a value of “8”. Which does not belong to the octal numbering range rather it belongs to the decimal or hexadecimal numbering system. So, a number can be identified to be correct by checking its base value and whether the number of each digit falls within its base range.
Octal Numbers
The following table lists the decimal numbers from 0 to 7 against their equivalents in binary and octal numbers.
Counting in Octal
Each digit of the octal number has a weight of eight (8) starting from the least significant digit. The weight of each digit increases by the power of eight moving from least significant digit to most significant digit. The equivalent weight in decimal of each octal digit, up to the 7th digit, is given.
The octal digit has a number range from “0 to “7” and, for counting above this range, another octal digit is added to the left. The addition of the second digit leads to the counting up to (778) which is, in decimal, equivalent to (6310). So, two octal digits can count up to 63. Similarly, a three-digit octal number can count up to (7778) which gives a counting range up to (51110) in decimal.
Addition of 0’s to a Binary Number
As the binary number is split into 3-bit groups in order to determine its equivalent octal number. This requires a binary number consisting of bits that are multiples of three (3) e.g. 3, 6, 9, 12, and 15, etc. However, this may not be the case when dealing with binary numbers and binary numbers can vary in bit lengths. The solution is to start splitting binary numbers, in groups of 3-bits, from the least significant bit (LSB). In case, the bits of the binary number are not equally divided amongst 3-bit groups then we will be left with less than 3-bits at the end. The leading zeros are added to leftover bits in order to extend their length up to 3-bits. This last group of 3-bits constitutes the most significant digit (MSD) of octal number. In the following table, a non-standard 13-bit binary number (1 0101 1101 101010) is converted to a 15-bit (divisible by 3) binary number by adding leading zeros, and then its equivalent octal number is determined.
In the above example, a 13-bit number requires 2-bits having zero values to be added to the left-most side in order to make it a 15-bit binary number. Similarly, an 11-bit binary number would require one (1) zero bit to be added. The usage of octal numbers reduces the length of binary numbers by three (3) times.
Octal to Decimal Conversion
The conversion of octal to decimal value is achieved by using the weighted sum of digits method described in the previous articles. In the following example, an octal number (42628) is converted to a decimal number.
Decimal to Octal Conversion
The conversion from decimal to octal requires the application of the repeated-division-by-8 method. The same method was used to convert a decimal number to its equivalent binary and hexadecimal values in the previous articles. The decimal number (23810) is, hereby again, used to obtain its equivalent octal number in the following example.
Binary to Octal Conversion Example
The conversion of an 8-bit binary number (110110012) to an octal number is illustrated below.
Octal to Binary and Decimal Conversion Example
The conversion of (62718) to its equivalent binary and the decimal number is illustrated below as an example.
Conclusion
- The Octal number uses a base-8 system and each digit’s value ranges from 0 to 7 i.e. eight (8) numbers.
- In an Octal number, each digit is a group or set of 3 bits. The equivalent of a binary number in octal is obtained by splitting the binary number into 3-bit groups and an equivalent Octal value from “0” to “7” is assigned to each group.
- The binary numbers may require the addition of leading zeros on the left most (most significant) side in order to form 3-bit groups.
- The Octal number is represented by using “8” as a subscript e.g. 7358.
- The Octal number can be converted to a decimal number by using the weighted sum of digits method.
- The conversion from decimal to octal requires the application of the repeated-division-by-8 method.
- The Octal number reduces the length of its equivalent binary number by a factor of three (3). However, octal numbers are seldom used now, and, as previously discussed, the hexadecimal numbering system has taken its place.