How to transfer from the decimal system of calculation to binary

How to transfer from the decimal system of calculation to binary

Electronic computing systems use for the calculations a binary numeral system, that is such where for record of numbers combinations of two figures - 0 and 1 are used. It is simpler to person to work with a decimal system, but special difficulties with the translation of numbers from one system in another should not arise.

Instruction

1. The standard way of the transfer from a decimal numeral system to binary consists in consecutive division of initial number and received from this division private on 2, at the same time in the rest will always be either 0, or 1. Division needs to be carried out until private does not become equal to 0. Values of the received remains register upside-down and as a result the required number in a binary system turns out.

2. For an example take number 20, divide it into 2, it will turn out 10 and in the rest 0; divide 10 into 2, it will turn out 5 and in the rest 0; divide 5 into 2, it will turn out 2 and in the rest 1; divide 2 into 2, it will turn out 1 and in the rest 0, divide 1 into 2, it will turn out 0 and in the rest 1. Write down the received values of the remains from the last to the first, that is 10100, it also will be number 20 presented in the binary system of calculation.

3. It is possible to simplify the first way a little. All numbers in a binary system, except 0, begin with 1 therefore it is possible to make division until private does not become equal 1 and to write down this private as the first figure of number.

4. For transfer of fractional decimal number to a binary system it is necessary to translate the whole part in the beginning, then to increase a fractional part by 2, the whole part of the received value will be the first of required number after a comma, and a fractional part of the received number needs to be increased by two again. These actions need to be repeated until a fractional part does not become equal 0, or the necessary accuracy of number will not be reached.

5. As an example we will transfer number 2.25 to a binary numeral system. In the beginning translate the whole part - 2 divide into 2, it will turn out 1 and in the rest 0, means 2(10) 10(2) corresponds. Increase 0.25 by 2, it will turn out 0.5, that is to the first the after a comma will be 0; increase 0.5 by 2, it will turn out 1, the second 1, a fractional part it is equal 0, therefore the translation is finished. Let's write down the turned-out figures - 10.01, it also will be the fractional decimal number 2.25 presented in a binary numeral system.

Author: «MirrorInfo» Dream Team


Print