Decimal number system? This is the system with which we face every day in the most diverse sectors of our lives. It is convenient and understandable, familiar and easy.
But there are other systems? Binary, octal, hexadecimal.
Each of them is used in certain specific areas.
For example, the binary system is based on the work of all computers on the ground.
In a binary system, only two numbers are used? 1 and 0, for computers these numbers appear in the form of presence or absence of charge. From the successive alternation of zeros and ones, chains are added, which eventually turn into computer commands and files. A binary system is not as difficult as it might seem at first glance, and it is much easier to perform arithmetic operations in it than in a decimal one. Everyone who starts studying computer science encounters a binary system, as an exercise, he is invited to try to independently translate several decimal numbers into a binary system. This is not so difficult as it might seem at first glance. Let's consider one of the ways.
A method invented many centuries before inventionComputers by an ancient Greek mathematician, is successfully used today, and is called the Euclidean algorithm. According to this algorithm, to convert a number from a decimal system to a binary one, it is necessary to divide this number by 2, writing out the remainder until it reaches zero. But it's always better to explain by example. Take an arbitrary decimal number. For example, 159:
159: 2 = 79 (left 1)
79: 2 = 39 (set 1)
39: 2 = 19 (set 1)
19: 2 = 9 (stop 1)
9: 2 = 4 (stop 1)
4: 2 = 2 (stop 0)
2: 2 = 1 (stop 0)
1: 2 = 0 (stop 1)
We collect a binary number from all outstanding at the decision of the rests, since the end, as a result at us the binary number 100111111 has turned out.
But the solution of such examples serves onlyVisibility, giving us an idea of how and on what basis computer systems work. If you need to translate different numbers from one number system to another, it's much easier to use a special calculator. This can be done, for example, using a calculator included in the standard Windows set. It is necessary only on the View tab to switch from a conventional calculator to an engineering one and translating numbers to a binary system will turn into a children's game for you.