# Binary to Octal

A binary-to-octal conversion is done to convert a binary number (base 2) to its equivalent octal number (base 8). The methods used to convert a binary number to its octal counterpart are discussed.

## Direct Method: Using Table

In this method, we directly represent a group of any binary digits (of 3 bits) to the corresponding octal value using the conversion table.

Let us convert (11010)2 to its equivalent octal number.

Step 1: Grouping 11010 into 3 bits (starting from the right), we have (11) and (010).

Step 2: Since the first group is not of three bits, we add zeros to the front. Now, the groups (011) and (010) are of three bits.

Step 3: Then, we find their corresponding octal values using the conversion table.

By converting each group into its corresponding octal value, we get

(011)2 = (3)8 and (010)2 = (2)8

Step 4: Taking the values based on the order of groups, we get

(11010)2 = (32)8

Similarly, we convert the fractional binary numbers into their corresponding octal numbers by dividing them into groups of three bits. Unlike the integral part, the fractional part should be grouped from left to right.

Now, converting (0.10)2 into its equivalent hexadecimal, we get

For the Integral Part:

(0)2 â†’ (000)2 â†’ (0)8

For the Fractional Part:

(10)2 â†’ (100)2 â†’ (4)8

Thus, (0.10)2 = (0.4)8

Convert the binary number 101110 to octal form using the conversion chart.

Solution:

(101) â†’ 5
(110) â†’ 6
(101110)2 â†’ (56)8

## Indirect Method: Without Using Table

There is another way the binary numbers are converted to their corresponding octal without using the conversion table.

Let us convert (10110)2 into an octal number.

First, we convert 10110 into a decimal number and then decimal to octal.

Step 1: Binary to Decimal

While converting (10110)2 to its respective decimal number, we multiply each digit (right to left) by the corresponding powers of 2, as shown.

Thus, on adding the value, we get the decimal number

16 + 0 + 4 + 2 + 0 = 16 + 4 + 2 = 22

Step 2: Decimal to Octal

To convert (22)10 in its octal form, we first divide the number by 8 and then the quotients of divisions in the subsequent steps until we get 0 as the quotient.

On dividing 22 by 8, the quotient is 2, and the remainder is 6

Further, by repeating the same step, we get

2 Ã· 8, quotient = 0, and remainder = 2

When the quotient is 0, the octal number is obtained by representing the remainders in reverse order (from last to first).

Thus, (22)10 = (26)8

Convert (10111)2 into octal.

Solution:

By converting (10111)2 to its corresponding decimal, we get
(1 Ã— 24) + (0 Ã— 23) + (1 Ã— 22) + (1 Ã— 21) + (1 Ã— 20) = 16 + 0 + 4 + 2 + 1 = 23
Now, by converting (23)10 to its corresponding hexadecimal, we get
23 Ã· 16, quotient = 1, and remainder = 7
1 Ã· 16, quotient = 0, and remainder = 1
Thus, (10111)2 = (17)8