How to transfer numbers from one system of calculation to another

How to transfer numbers from one system of calculation to another

The numeral system is a way of record of numbers by means of certain signs. Position systems which are defined by the integer called the basis have the greatest distribution. The bases 2.8, 10 and 16 are more often used, and systems are called, respectively, binary, octal, decimal and hexadecimal.

It is required to you

  • the table of the translation for binary, decimal, octal and hexadecimal numeral systems

Instruction

1. Let's consider transfer from any numeral system (with any integer in the basis) in decimal. For this purpose the required number, for example, 123 needs to be written down on a formula of the record of number accepted in an initial numeral system. Let's take for an example an octal system. Proceeding from the name, the basis is figure 8, it means that each category of number is basis degree on decrease, in this case it is the second, first and zero degree (8 in zero degree = 1). Number 123 registers as follows: 1*8*8+2*8+3*1. Multiply figures and receive 64 +16 +3, as a result - 83. This number will also be representation of required number in a decimal numeral system.

2. Calculation is more difficult for a hexadecimal system. Letters of the Latin alphabet participate in it except figures in representation, that is the full category makes figure from 0 to 9 and a letter from A to F. For example, number 6B6 on a formula of record of number will look so: 6*16*16+11*16+6*1, where B=11. Multiply figures and receive 1536+176+6, as a result - 1718. It is the same number in a decimal numeral system.

3. The translation from a decimal system in binary, octal and hexadecimal is made by consecutive division into the basis (2, 8 and 16) until there is a number less divider. The remains are written out upside-down. For example, we will transfer number 40 to a binary system, for this purpose: divide 40 into 2, write 0, 20 on 2, write 0, 10 on 2, write 0, 5 on 2, write 1, 2 on 2, write 0 and 1. We receive total number in a binary system - 101000.

4. Let's transfer number 123 from a decimal system to octal, the remains are also written upside-down. You divide 123 into 8, it turns out 15 and 3 in the rest, write 3. You divide 15 into 8, it turns out 1 and 7 in the rest, write 7. Write in the senior category remained 1. Total number - 173.

5. Let's transfer number 123 from a decimal system to hexadecimal. You divide 123 into 16, it turns out 7, 11 in the rest. So, the figure of the senior category - 7, figure 11 less basis is also designated by letter B. We receive total number - 7B.

6. To transfer any number to a binary numeral system, it is necessary to write down each figure of the category of initial number in the form of the four of numbers according to the table, for example, for a decimal system: 0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101 and so on.

7. For the translation from a binary system in octal or hexadecimal it is necessary to break initial number into the fours or triads on a binary system, and then to replace each of combinations (triads or the fours) with the corresponding figure in a total system.

Author: «MirrorInfo» Dream Team


Print