The Student Room Group

How to convert Binary to Octal?

How do you convert binary to octal? I remember doing it ages ago but I cant find it in my notes and I cant find it on the internet :frown:
Reply 1
Original post by mclean_tom_
How do you convert binary to octal? I remember doing it ages ago but I cant find it in my notes and I cant find it on the internet :frown:

It's the same process as converting to and from hexadecimal, except whereas each hexadecimal digit represents 4 bits, each octal digit represents 3.

For example, the (big-endian) binary number 10101110 can be split into three groups. Starting from the left, the first three numbers are 110, which is 6 in decimal/octal. The second three digits - 101 - are 5 in decimal/octal, and the final two are 10, which is 2. Put these numbers together and you get 256.
Reply 2
Original post by miser
It's the same process as converting to and from hexadecimal, except whereas each hexadecimal digit represents 4 bits, each octal digit represents 3.

For example, the (big-endian) binary number 10101110 can be split into three groups. Starting from the left, the first three numbers are 110, which is 6 in decimal/octal. The second three digits - 101 - are 5 in decimal/octal, and the final two are 10, which is 2. Put these numbers together and you get 256.


Thank you
Reply 3
Original post by miser
It's the same process as converting to and from hexadecimal, except whereas each hexadecimal digit represents 4 bits, each octal digit represents 3.

For example, the (big-endian) binary number 10101110 can be split into three groups. Starting from the left, the first three numbers are 110, which is 6 in decimal/octal. The second three digits - 101 - are 5 in decimal/octal, and the final two are 10, which is 2. Put these numbers together and you get 256.


Are you sure you know your left from your right?

You seem to have worked it out from the correct end anyway :smile:
Reply 4
Original post by davros
Are you sure you know your left from your right?

You seem to have worked it out from the correct end anyway :smile:

Sorry you're completely right - I meant to say the right. Least-significant bits first, or else the number needs to be padded with zeroes so that the number of digits is evenly divisible by 3.
(edited 9 years ago)

Quick Reply

Latest

Trending

Trending