How to transfer from a decimal system to hexadecimal

How to transfer from a decimal system to hexadecimal

Articles Hits: 58

It is known that in computers of number register in a binary look, and it is more convenient to person to use decimal numbers. A transfer of numbers from the binary code in decimal representation is made, as a rule, by appropriate programs. However programmers quite often should work with numbers in their direct, "machine" look. In this case, decimal numbers transfer to the hexadecimal numeral system clear to both the computer, and the expert.

It is required to you

Instruction

1. To transfer number from a decimal system to hexadecimal use the standard Windows calculator. Only the calculator needs to be used not in standard, and in a "engineering" look. For this purpose select item of the main Look menu and click at line "Engineering".

2. Pay attention to in what mode the calculator works. As a rule, it is the decimal mode of representation of numbers set by default. If the index is located not in Dec position, then set it to this position.

3. Now just type on the computer keyboard (or the virtual keyboard of the calculator) decimal number which needs to be transferred to hexadecimal representation. Pay attention that the number cannot be very large – no more than 18446744073709551615. Though the display of the calculator also allows to enter "longer" numbers, when transforming to a hexadecimal look the "excess" figures will be rejected and the result will turn out wrong.

4. Having gathered initial (decimal) number, switch the calculator to the hexadecimal mode. For this purpose move the index of word length of a numeral system to Hex position. The entered number automatically will be transformed to a hexadecimal look. The index of representation of hexadecimal number has to be in the provision "8 bytes", otherwise length of the entered numbers will be very limited (for example, at "1 byte" - no more than 255).

5. If there is no computer, then it is possible to transfer number from decimal to hexadecimal and "manually". For this purpose divide decimal number into 16. And, it is necessary to divide classically – "corner" that the rest turned out in the form of an integer, but not in the form of "tail" of decimal fraction.

6. So, having divided initial number into 16, write down the rest as the younger (right) category of hexadecimal number. If the rest more than 9, then transform it to the "real" hexadecimal look. At the same time consider what corresponds to decimal number 10 hexadecimal "And", etc. Not to be mistaken, use the following plate: 10 – A11 – B12 – C13 – D14 – E15 – F

7. If private from division of initial number on 16 it turned out more than 0, then again repeat the previous step, having accepted private as a dividend. Consistently write down the remainders of division transformed to hexadecimal figure from right to left. Repeat process until private it is not equal to zero.

Author: «MirrorInfo» Dream Team

Print