How to transfer numbers from one system to another

How to transfer numbers from one system to another

In that system of the account which we use every day, ten figures — from zero to nine. Therefore it is called decimal. However in technical calculations, especially those which are related to computers also other systems, in particular, binary and hexadecimal are used. Therefore it is necessary to be able to transfer numbers from one numeral system to another.

It is required to you

  • - sheet of paper;
  • - pencil or handle;
  • - calculator.

Instruction

1. A binary system — the simplest. In it only two figures — zero and unit. Each figure of binary number, since the end, corresponds to two degree. Two in zero degree equals to one, in the first — to two, in the second — to four, in the third — eight and so on.

2. Let's assume that you were given binary number 1010110. Units in it stand on places, the second, third, fifth and seventh since the end. Therefore this number is equal in a decimal system 2^1 + 2^2 + 2^4 + 2^6 = 2 + 4 + 16 + 64 = 86.

3. The return task — transfer of decimal number to a binary system. Let's assume, you have number 57. To receive its binary record, you have to divide consistently this number into 2 and write down a remainder of division. The binary number will be under construction from the end by the beginning. The first step will give you the last figure: 57/2 = 28 (rest 1). Then you receive the second since the end: 28/2 = 14 (rest 0). Further steps: 14/2 = 7 (rest 0); 7/2 = 3 (rest 1); 3/2 = 1 (rest 1); 1/2 = 0 (rest 1). It is the last step because the result of division is equal to zero. As a result you received binary number 111001. Check correctness of the answer: 111001 = 2^0 + 2^3 + 2^4 + 2^5 = 1 + 8 + 16 + 32 = 57.

4. The second numeral system used in computer questions — hexadecimal. In it not ten, but sixteen figures. Not to create new symbols, the first ten figures of a hexadecimal system are designated by usual figures, and other six — Latin letters: A, B, C, D, E, F. decimal records they correspond to numbers from 10 to 15. In order to avoid confusion before the number which is written down on a hexadecimal system put the sign # or symbols 0x.

5. That in decimal, it is necessary to increase each its figure by the corresponding degree of sixteen and to put results. For example, the number #11A in decimal notation equals 10*(16^0) + 1*(16^1) + 1*(16^2) = 10 + 16 + 256 = 282.

6. Back translation from a decimal system in hexadecimal is made by the same method of the remains, as in binary. For example, take number 10000. Consistently dividing it into 16 and writing down the remains, you receive: 10000/16 = 625 (rest 0).625/16 = 39 (rest 1).39/16 = 2 (rest 7).2/16 = 0 (rest 2). The hexadecimal number #2710 will become result of calculations. Check correctness of the answer: #2710 = 1*(16^1) + 7*(16^2) + 2*(16^3) = 16 + 1792 + 8192 = 10000.

7. It is much simpler to transfer numbers from a hexadecimal numeral system to binary. Number 16 is two degree: 16 = 2^4. Therefore each hexadecimal figure can be written down as four-digit binary number. If at you in binary number less than four signs turn out, add zero to the beginning. For example, #1F7E = (0001)(1111) (0111)(1110) = 1111101111110. Check correctness of the answer: both numbers are in decimal notation equal to 8062.

8. For back translation you need to break binary number into groups on four figures, since the end, and to replace each such group with hexadecimal figure. For example, 11000110101001 turns into (0011)(0001) (1010)(1001) that in hexadecimal record gives #31A9. The answer is validated by transfer to decimal record: both numbers are equal to 12713.

Author: «MirrorInfo» Dream Team


Print