How to transfer decimal fractions to a binary system

How to transfer decimal fractions to a binary system

It is difficult to imagine modern life without binary code. Even those who are not fond of mathematics or computers anyway use this system daily, using household appliances.

Instruction

1. The translation of numbers from various numeral systems in binary comes down to their representation in the form of various combinations of two digital symbols of this system – 0 and 1. For the transfer from a decimal system to binary the method of consecutive division on 2 where is 2 a category of the binary code similarly 10 in decimal notation is most often used.

2. However this method approaches when translating integers, for fractions use, on the contrary, multiplication. Namely multiply a fractional part by 2 consistently until the whole part appears. At the same time the successful multiplication giving as a result number bigger 1, brings to total binary number figure 1. And unsuccessful after which the number still less than 1, gives figure 0. At the same time fraction figures in a binary look register after a comma also, as in initial decimal.

3. Let's consider this simple way on a concrete example. For a start take simple decimal fraction 0.2. Multiply consistently by 2:0.2*2 = 0.4 => 0,0_2;0,4*2 = 0.8 => 0,00_2;0,8*2 = 1.6 => 0.001_2;

4. Reject the whole part and continue the same actions: 0.6*2 = 1.2 => 0.0011_2; Again reject the whole part and you will return to number 0.2. The binary fraction was cyclic, i.e. repeating, for short write down: 0.2_10 = 0,(0011) _2 where brackets are indicated repeatability of the same group of figures.

5. For transfer to the binary system of fraction with the whole part at first it is translated, and then already number after a comma. For example, translate number 9.25. For the translation of the whole part use method of consecutive division: 9/2 = 4 and 1 in the rest; 4/2 = 2 and 0 in the rest; 2/2 = 1 and 0 in the rest; ½ = 0 and 1 in the rest. Write down the received remains from right to left: 9_10 = 1001_2.

6. Now translate a fractional part: 0.25*2 = 0.5 => 0;0,5*2 = 1 => 1. This time you were lucky, the fraction was not cyclic. Write down a result: 9.25_10 = 1001.01_2.

Author: «MirrorInfo» Dream Team


Print