# Conversion of fractional part of a hexadecimal number to binary

The Number is given as : (C012.25)Hexadecimal I have to convert it into octal . So I converted it into Binary First and got the result as : 1100000000010010.01000000 (Since each bit in hexadecimal represents 4 bit in binary so C=1100,0=0000,1=0001,2=0010 and for 0.25=.01000000 ) The Solution mentions the Binary conversion as 1100000000010010.00100101

Please guide me about the what was done wrong ! Also if I got the binary representation...How can I convert the binary no's fractional part (0.00100101) into octal .

• (0.25) in Hex is 0010 0101 as mentioned in the answer.
– ajit
Sep 5 '20 at 5:19
• Can you guide what are the steps involved in finding the correct answer
– Dan
Sep 5 '20 at 5:21
• every number in Hexa(0 to F) is equivalent to its binary equivalent. so 1 is 0010, 2 is 0010, 3 is 0011 ....7 is 0111, 8 is 1000, ...A(10) is 1010, B is 1011, E(14) is 1110 and F(15) is 1111. If a number is in Hexa, then all you have to do is replace every hexa digit( total 16) with its equivalent binary.
– ajit
Sep 5 '20 at 5:34
• Okey Thanks I got that
– Dan
Sep 5 '20 at 5:37

Here is how to convert the fractional part from hexadecimal to binary: $$(0.25)_{16} = \frac{2}{16} + \frac{5}{16^2} = \frac{0 \cdot 8 + 0 \cdot 4 + 1 \cdot 2 + 0 \cdot 1}{16} + \frac{0 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1}{16^2} = \\ \frac{0}{2} + \frac{0}{4} + \frac{1}{8} + \frac{0}{16} + \frac{0}{32} + \frac{1}{64} + \frac{0}{128} + \frac{1}{256} = (0.00100101)_2$$ As you can see, we simply replace $$2$$ with its base 2 representation, and then adjoin the base 2 representation of $$5$$. I included this calculation to show why this works.
Note also that $$(0.25)_{16} \neq 1/4$$.