1
$\begingroup$

Can someone verify my results? Binary to Octal

1) 10101.11 is 25.75  2) 0.01101 is 0.6875  3) 10110110.001 is 266.125    
  • 3
    The integer parts are correct. It looks like you've converted the fractional parts to decimal instead of octal. 8 is not an octal digit.2019-01-18

3 Answers 3

5

To convert quickly, group into chunks of three, starting at the decimal point.

Say I have the binary number: $1001010110100000101.10010101$ Lets write this as

$001 \ 001 \ 010 \ 110 \ 100 \ 000 \ 101 \ .100 \ 101 \ 010$ Notice I added some zeros, which don't change the number, to make sure I have chunks of three. Now just write each of these chunks of three as a unique number in $0,1,2,3,4,5,6,7$ by converting from binary as you normally would.

So for my number above, $001=1$, $010=2$, $110=6$, $100=4$, $000=0$, $101=5$, $100=4$, $101=5$, and $010=2.$ Hence in octal we have that $1001010110100000101.10010101=126405.452$

Now try using this method to convert the numbers you have above. (I won't do it for you) The decimal parts are not correct at the moment.

Why does this work? The reason this works is because $8$ is a power of $2$. In particular $8=2^3$, which is why we split into blocks of $3$. Each block of $3$ in binary corresponds to a unique number in octal, and vice-versa. Say I have a binary number $x=a_n a_{n-1} \cdots a_2 a_1 a_0.a_{-1}a_{-2}\cdots a_{-m}.$ Each $a_i$ here represents a digit that is either $0$ or $1$. Then $x=a_n 2^n +a_{n-1}2^{n-1}+\cdots +2a_1 +a_0+a_{-1} 2^{-1}+\cdots +a_{-m}2^{-m}.$ We now want to write this in base 8. Lets group terms:

$x=\cdots +8^1\left(4a_5+2a_4+a_3\right)+ 8^0\left(4a_2+2a_1 +a_0\right)+8^{-1}\left(4a_{-1}+2a_{-2}+a_{-3}\right)+8^{-2}\left(\cdots \right)\cdots .$ Then we see that in octal, we just want to group triplets of the binary numbers.

In a very similar way, we can convert from Hexadecimal to binary, and binary to hexadecimal, by grouping into chunks of $4$. (Hexadecimal is base $16=2^4$)

  • 0
    Thanks for the explanation. I am try to practice it right now, offcourse i'm new at it so I occasionally get confused2011-06-11
0

Wolfram alpha can check this for you.

  • 0
    @joriki I see my mistake btw. I did change them to decimal2011-06-11