How to transfer to a binary numeral system

How to transfer to a binary numeral system

The binary numeral system of numbers was invented still B.C. However today, thanks to universal distribution of computers and the program binary code, this system received the second revival. Binary representation of numbers by means of only two figures 0 and 1 is studied by school students at a computer science lesson. All computers "understand" binary representation of number. Transfer to a binary system from any other is in detail painted by means of different methods. The simplest the way of decomposition on degrees on the basis 2 is considered.

Instruction

1. If the initial number is presented in decimalto to system, for its translation use method of division into the basis 2. For this purpose divide number into 2 and write down the formed rest at exact division. If after division received private it appeared more than two, again divide it into 2 and also keep the received rest.

2. Continue division iterations until private it appears less than 2. After that write down a number of the figures received in the remains and final private, since the last iteration. This record from 0 and 1 will also be binary representation of initial number.

3. If the set number is presented in a hexadecimal system, for its transfer to a binary look use the table of transitions. In it a four-digit set of figures in the binary code is opposed to each number from 0 to F of a hexadecimal system.

4. So, if you have record of a look: 4BE2, for its translation it is necessary to replace each symbol with the corresponding set of figures of the table of transition. The order of record of number at the same time strictly remains. Thus, figure 4 from a hexadecimal system will be replaced with 0100, In – 1011, E - 1110 and 2 - 0010. And initial number 4BE2 in binary record will have an appearance: 0100101111100010.

Author: «MirrorInfo» Dream Team


Print