• How to convert to binary number system online. Converting numbers from one number system to any other online

    Let's look at one of the most important topics in computer science -. In the school curriculum, it is revealed rather “modestly,” most likely due to the lack of hours allocated to it. Knowledge on this topic, especially on translation of number systems, are a prerequisite for successfully passing the Unified State Exam and admission to universities in the relevant faculties. Below we discuss in detail concepts such as positional and non-positional number systems, examples of these number systems are given, rules are presented for converting whole decimal numbers, proper decimal fractions and mixed decimal numbers into any other number system, converting numbers from any number system into decimal, converting from octal and hexadecimal number systems into binary number system. There are a lot of problems on this topic in exams. The ability to solve them is one of the requirements for applicants. Coming soon: For each topic of the section, in addition to detailed theoretical material, almost all possible options will be presented tasks for self-study. In addition, you will have the opportunity to download completely free of charge from a file hosting service ready-made detailed solutions to these problems, illustrating various ways to obtain the correct answer.

    positional number systems.

    Non-positional number systems- number systems in which the quantitative value of a digit does not depend on its location in the number.

    Non-positional number systems include, for example, Roman, where instead of numbers there are Latin letters.

    I 1 (one)
    V 5 (five)
    X 10 (ten)
    L 50 (fifty)
    C 100 (one hundred)
    D 500 (five hundred)
    M 1000 (thousand)

    Here the letter V stands for 5 regardless of its location. However, it is worth mentioning that although the Roman number system is a classic example of a non-positional number system, it is not completely non-positional, because The smaller number in front of the larger one is subtracted from it:

    IL 49 (50-1=49)
    VI 6 (5+1=6)
    XXI 21 (10+10+1=21)
    MI 1001 (1000+1=1001)

    positional number systems.

    Positional number systems- number systems in which the quantitative value of a digit depends on its location in the number.

    For example, if we talk about the decimal number system, then in the number 700 the number 7 means “seven hundred”, but the same number in the number 71 means “seven tens”, and in the number 7020 - “seven thousand”.

    Each positional number system has its own base. A natural number greater than or equal to two is chosen as the base. It is equal to the number of digits used in a given number system.

      For example:
    • Binary- positional number system with base 2.
    • Quaternary- positional number system with base 4.
    • Five-fold- positional number system with base 5.
    • Octal- positional number system with base 8.
    • Hexadecimal- positional number system with base 16.

    To successfully solve problems on the topic “Number systems”, the student must know by heart the correspondence of binary, decimal, octal and hexadecimal numbers up to 16 10:

    10 s/s 2 s/s 8 s/s 16 s/s
    0 0 0 0
    1 1 1 1
    2 10 2 2
    3 11 3 3
    4 100 4 4
    5 101 5 5
    6 110 6 6
    7 111 7 7
    8 1000 10 8
    9 1001 11 9
    10 1010 12 A
    11 1011 13 B
    12 1100 14 C
    13 1101 15 D
    14 1110 16 E
    15 1111 17 F
    16 10000 20 10

    It is useful to know how numbers are obtained in these number systems. You can guess that in octal, hexadecimal, ternary and others positional number systems everything happens in the same way as the decimal system we are used to:

    One is added to the number and a new number is obtained. If the units place becomes equal to the base of the number system, we increase the number of tens by 1, etc.

    This “transition of one” is what frightens most students. In fact, everything is quite simple. The transition occurs if the units digit becomes equal to number base, we increase the number of tens by 1. Many, remembering the good old decimal system, are instantly confused about the digits in this transition, because decimal and, for example, binary tens are different things.

    From here, resourceful students develop “their own methods” (surprisingly... working) when filling out, for example, truth tables, the first columns (variable values) of which, in fact, are filled with binary numbers in ascending order.

    For example, let's look at getting numbers in octal system: We add 1 to the first number (0), we get 1. Then we add 1 to 1, we get 2, etc. to 7. If we add one to 7, we get a number equal to the base of the number system, i.e. 8. Then you need to increase the tens place by one (we get the octal ten - 10). Next, obviously, are the numbers 11, 12, 13, 14, 15, 16, 17, 20, ..., 27, 30, ..., 77, 100, 101...

    Rules for converting from one number system to another.

    1 Converting integer decimal numbers to any other number system.

    The number must be divided by new number system base. The first remainder of the division is the first minor digit of the new number. If the quotient of the division is less than or equal to the new base, then it (the quotient) must be divided again by the new base. The division must be continued until we get a quotient less than the new base. This is the highest digit of the new number (you need to remember that, for example, in the hexadecimal system, after 9 there are letters, i.e. if the remainder is 11, you need to write it as B).

    Example ("division by corner"): Let's convert the number 173 10 to the octal number system.


    Thus, 173 10 =255 8

    2 Converting regular decimal fractions to any other number system.

    The number must be multiplied by the new number system base. The digit that has become the integer part is the highest digit of the fractional part of the new number. to obtain the next digit, the fractional part of the resulting product must again be multiplied by a new base of the number system until the transition to the whole part occurs. We continue multiplication until the fractional part becomes zero, or until we reach the accuracy specified in the problem (“... calculate with an accuracy of, for example, two decimal places”).

    Example: Let's convert the number 0.65625 10 to the octal number system.

    The result has already been received!

    Number systems

    There are positional and non-positional number systems. The Arabic number system, which we use in everyday life, is positional, but the Roman number system is not. In positional number systems, the position of a number uniquely determines the magnitude of the number. Let's consider this using the example of the number 6372 in the decimal number system. Let's number this number from right to left starting from zero:

    Then the number 6372 can be represented as follows:

    6372=6000+300+70+2 =6·10 3 +3·10 2 +7·10 1 +2·10 0 .

    The number 10 determines the number system (in this case it is 10). The values ​​of the position of a given number are taken as powers.

    Consider the real decimal number 1287.923. Let's number it starting from zero, position of the number from the decimal point to the left and right:

    Then the number 1287.923 can be represented as:

    1287.923 =1000+200+80 +7+0.9+0.02+0.003 = 1·10 3 +2·10 2 +8·10 1 +7·10 0 +9·10 -1 +2·10 -2 +3· 10 -3.

    In general, the formula can be represented as follows:

    C n s n +C n-1 · s n-1 +...+C 1 · s 1 +C 0 ·s 0 +D -1 ·s -1 +D -2 ·s -2 +...+D -k ·s -k

    where C n is an integer in position n, D -k - fractional number in position (-k), s- number system.

    A few words about number systems. A number in the decimal number system consists of many digits (0,1,2,3,4,5,6,7,8,9), in the octal number system it consists of many digits (0,1, 2,3,4,5,6,7), in the binary number system - from a set of digits (0,1), in the hexadecimal number system - from a set of digits (0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E,F), where A,B,C,D,E,F correspond to the numbers 10,11,12,13,14,15. In the table Tab.1 numbers are presented in different number systems.

    Table 1
    Notation
    10 2 8 16
    0 0 0 0
    1 1 1 1
    2 10 2 2
    3 11 3 3
    4 100 4 4
    5 101 5 5
    6 110 6 6
    7 111 7 7
    8 1000 10 8
    9 1001 11 9
    10 1010 12 A
    11 1011 13 B
    12 1100 14 C
    13 1101 15 D
    14 1110 16 E
    15 1111 17 F

    Converting numbers from one number system to another

    To convert numbers from one number system to another, the easiest way is to first convert the number to the decimal number system, and then convert from the decimal number system to the required number system.

    Converting numbers from any number system to the decimal number system

    Using formula (1), you can convert numbers from any number system to the decimal number system.

    Example 1. Convert the number 1011101.001 from binary number system (SS) to decimal SS. Solution:

    1 ·2 6 +0 ·2 5 + 1 ·2 4 + 1 ·2 3 + 1 ·2 2 + 0 ·2 1 + 1 ·2 0 + 0 ·2 -1 + 0 ·2 -2 + 1 ·2 -3 =64+16+8+4+1+1/8=93.125

    Example2. Convert the number 1011101.001 from octal number system (SS) to decimal SS. Solution:

    Example 3 . Convert the number AB572.CDF from hexadecimal number system to decimal SS. Solution:

    Here A-replaced by 10, B- at 11, C- at 12, F- by 15.

    Converting numbers from the decimal number system to another number system

    To convert numbers from the decimal number system to another number system, you need to convert the integer part of the number and the fractional part of the number separately.

    The integer part of a number is converted from decimal SS to another number system by sequentially dividing the integer part of the number by the base of the number system (for binary SS - by 2, for 8-ary SS - by 8, for 16-ary SS - by 16, etc. ) until a whole residue is obtained, less than the base CC.

    Example 4 . Let's convert the number 159 from decimal SS to binary SS:

    159 2
    158 79 2
    1 78 39 2
    1 38 19 2
    1 18 9 2
    1 8 4 2
    1 4 2 2
    0 2 1
    0

    As can be seen from Fig. 1, the number 159 when divided by 2 gives the quotient 79 and remainder 1. Further, the number 79 when divided by 2 gives the quotient 39 and remainder 1, etc. As a result, constructing a number from division remainders (from right to left), we obtain a number in binary SS: 10011111 . Therefore we can write:

    159 10 =10011111 2 .

    Example 5 . Let's convert the number 615 from decimal SS to octal SS.

    615 8
    608 76 8
    7 72 9 8
    4 8 1
    1

    When converting a number from a decimal SS to an octal SS, you need to sequentially divide the number by 8 until you get an integer remainder less than 8. As a result, constructing a number from division remainders (from right to left) we get a number in octal SS: 1147 (see Fig. 2). Therefore we can write:

    615 10 =1147 8 .

    Example 6 . Let's convert the number 19673 from the decimal number system to hexadecimal SS.

    19673 16
    19664 1229 16
    9 1216 76 16
    13 64 4
    12

    As can be seen from Figure 3, by successively dividing the number 19673 by 16, the remainders are 4, 12, 13, 9. In the hexadecimal number system, the number 12 corresponds to C, the number 13 to D. Therefore, our hexadecimal number is 4CD9.

    To convert regular decimal fractions (a real number with a zero integer part) into a number system with base s, it is necessary to successively multiply this number by s until the fractional part contains a pure zero, or we obtain the required number of digits. If, during multiplication, a number with an integer part other than zero is obtained, then this integer part is not taken into account (they are sequentially included in the result).

    Let's look at the above with examples.

    Example 7 . Let's convert the number 0.214 from the decimal number system to binary SS.

    0.214
    x 2
    0 0.428
    x 2
    0 0.856
    x 2
    1 0.712
    x 2
    1 0.424
    x 2
    0 0.848
    x 2
    1 0.696
    x 2
    1 0.392

    As can be seen from Fig. 4, the number 0.214 is sequentially multiplied by 2. If the result of multiplication is a number with an integer part other than zero, then the integer part is written separately (to the left of the number), and the number is written with a zero integer part. If the multiplication results in a number with a zero integer part, then a zero is written to the left of it. The multiplication process continues until the fractional part reaches a pure zero or we obtain the required number of digits. Writing bold numbers (Fig. 4) from top to bottom we get the required number in the binary number system: 0. 0011011 .

    Therefore we can write:

    0.214 10 =0.0011011 2 .

    Example 8 . Let's convert the number 0.125 from the decimal number system to binary SS.

    0.125
    x 2
    0 0.25
    x 2
    0 0.5
    x 2
    1 0.0

    To convert the number 0.125 from decimal SS to binary, this number is sequentially multiplied by 2. In the third stage, the result is 0. Consequently, the following result is obtained:

    0.125 10 =0.001 2 .

    Example 9 . Let's convert the number 0.214 from the decimal number system to hexadecimal SS.

    0.214
    x 16
    3 0.424
    x 16
    6 0.784
    x 16
    12 0.544
    x 16
    8 0.704
    x 16
    11 0.264
    x 16
    4 0.224

    Following examples 4 and 5, we get the numbers 3, 6, 12, 8, 11, 4. But in hexadecimal SS, the numbers 12 and 11 correspond to the numbers C and B. Therefore, we have:

    0.214 10 =0.36C8B4 16 .

    Example 10 . Let's convert the number 0.512 from the decimal number system to octal SS.

    0.512
    x 8
    4 0.096
    x 8
    0 0.768
    x 8
    6 0.144
    x 8
    1 0.152
    x 8
    1 0.216
    x 8
    1 0.728

    Received:

    0.512 10 =0.406111 8 .

    Example 11 . Let's convert the number 159.125 from the decimal number system to binary SS. To do this, we translate separately the integer part of the number (Example 4) and the fractional part of the number (Example 8). Further combining these results we get:

    159.125 10 =10011111.001 2 .

    Example 12 . Let's convert the number 19673.214 from the decimal number system to hexadecimal SS. To do this, we translate separately the integer part of the number (Example 6) and the fractional part of the number (Example 9). Further, combining these results we obtain.

    1. Ordinal counting in various number systems.

    In modern life, we use positional number systems, that is, systems in which the number denoted by a digit depends on the position of the digit in the notation of the number. Therefore, in the future we will talk only about them, omitting the term “positional”.

    In order to learn how to convert numbers from one system to another, we will understand how sequential recording of numbers occurs using the example of the decimal system.

    Since we have a decimal number system, we have 10 symbols (digits) to construct numbers. We start counting: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. The numbers are over. We increase the bit depth of the number and reset the least significant digit: 10. Then we increase the low digit again until all the digits are gone: 11, 12, 13, 14, 15, 16, 17, 18, 19. We increase the high digit by 1 and reset the low digit: 20. When we use all the digits for both digits (we get the number 99), we again increase the digit capacity of the number and reset the existing digits: 100. And so on.

    Let's try to do the same in the 2nd, 3rd and 5th systems (we introduce the notation for the 2nd system, for the 3rd, etc.):

    0 0 0 0
    1 1 1 1
    2 10 2 2
    3 11 10 3
    4 100 11 4
    5 101 12 10
    6 110 20 11
    7 111 21 12
    8 1000 22 13
    9 1001 100 14
    10 1010 101 20
    11 1011 102 21
    12 1100 110 22
    13 1101 111 23
    14 1110 112 24
    15 1111 120 30

    If the number system has a base greater than 10, then we will have to enter additional characters; it is customary to enter letters of the Latin alphabet. For example, for the 12-digit system, in addition to ten digits, we need two letters ( and ):

    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    10
    11
    12 10
    13 11
    14 12
    15 13

    2. Conversion from the decimal number system to any other.

    To convert a positive integer decimal number to a number system with a different base, you need to divide this number by the base. Divide the resulting quotient by the base again, and further until the quotient is less than the base. As a result, write down in one line the last quotient and all remainders, starting from the last.

    Example 1. Let's convert the decimal number 46 to the binary number system.

    Example 2. Let's convert the decimal number 672 to the octal number system.

    Example 3. Let's convert the decimal number 934 to the hexadecimal number system.

    3. Conversion from any number system to decimal.

    In order to learn how to convert numbers from any other system to decimal, let's analyze the usual notation for a decimal number.
    For example, the decimal number 325 is 5 units, 2 tens and 3 hundreds, i.e.

    The situation is exactly the same in other number systems, only we will multiply not by 10, 100, etc., but by the powers of the base of the number system. For example, let's take the number 1201 in the ternary number system. Let's number the digits from right to left starting from zero and imagine our number as the sum of the products of a digit and three to the power of the digit of the number:

    This is the decimal notation of our number, i.e.

    Example 4. Let's convert the octal number 511 to the decimal number system.

    Example 5. Let's convert the hexadecimal number 1151 to the decimal number system.

    4. Conversion from the binary system to the system with the base “power of two” (4, 8, 16, etc.).

    To convert a binary number into a number with a power of two base, it is necessary to divide the binary sequence into groups according to the number of digits equal to the power from right to left and replace each group with the corresponding digit of the new number system.

    For example, Let's convert the binary number 1100001111010110 to the octal system. To do this, we will divide it into groups of 3 characters starting from the right (since ), and then use the correspondence table and replace each group with a new number:

    We learned how to build a correspondence table in step 1.

    0 0
    1 1
    10 2
    11 3
    100 4
    101 5
    110 6
    111 7

    Those.

    Example 6. Let's convert the binary number 1100001111010110 to hexadecimal.

    0 0
    1 1
    10 2
    11 3
    100 4
    101 5
    110 6
    111 7
    1000 8
    1001 9
    1010 A
    1011 B
    1100 C
    1101 D
    1110 E
    1111 F

    5. Conversion from a system with the base “power of two” (4, 8, 16, etc.) to binary.

    This translation is similar to the previous one, done in the opposite direction: we replace each digit with a group of digits in the binary system from the correspondence table.

    Example 7. Let's convert the hexadecimal number C3A6 to the binary number system.

    To do this, replace each digit of the number with a group of 4 digits (since ) from the correspondence table, supplementing the group with zeros at the beginning if necessary:



    To quickly convert numbers from the decimal number system to the binary system, you need to have a good knowledge of the numbers “2 to the power”. For example, 2 10 =1024, etc. This will allow you to solve some translation examples literally in seconds. One of these tasks is Problem A1 from the USE demo 2012. You can, of course, take a long and tedious time to divide a number by “2”. But it’s better to decide differently, saving precious time on the exam.

    The method is very simple. Its gist is this: If the number that needs to be converted from the decimal system is equal to the number "2 to the power", then this number in the binary system contains a number of zeros equal to the power. We add a “1” in front of these zeros.

    • Let's convert the number 2 from the decimal system. 2=2 1 . Therefore, in the binary system, a number contains 1 zero. We put “1” in front and get 10 2.
    • Let's convert 4 from the decimal system. 4=2 2 . Therefore, in the binary system, a number contains 2 zeros. We put “1” in front and get 100 2.
    • Let's convert 8 from the decimal system. 8=2 3 . Therefore, in the binary system, a number contains 3 zeros. We put “1” in front and get 1000 2.


    Similarly for other numbers "2 to the power".

    If the number that needs to be converted is less than the number “2 to the power” by 1, then in the binary system this number consists only of units, the number of which is equal to the power.

    • Let's convert 3 from the decimal system. 3=2 2 -1. Therefore, in the binary system, a number contains 2 ones. We get 11 2.
    • Let's convert 7 from the decimal system. 7=2 3 -1. Therefore, in the binary system, a number contains 3 ones. We get 111 2.

    In the figure, the squares indicate the binary representation of the number, and the pink color on the left indicates the decimal representation.


    The translation is similar for other numbers “2 to the power-1”.

    It is clear that the translation of numbers from 0 to 8 can be done quickly or by division, or simply know by heart their representation in the binary system. I gave these examples so that you understand the principle of this method and use it to translate more “impressive numbers”, for example, to translate the numbers 127,128, 255, 256, 511, 512, etc.

    You can come across such problems when you need to convert a number that is not equal to the number “2 to the power”, but close to it. It may be greater or less than 2 to the power. The difference between the translated number and the number "2 to the power" should be small. For example, up to 3. The representation of numbers from 0 to 3 in the binary system just needs to be known without translation.

    If the number is greater than , then solve like this:

    First we convert the number “2 to the power” into the binary system. And then we add to it the difference between the number “2 to the power” and the number being translated.

    For example, let's convert 19 from the decimal system. It is greater than the number "2 to the power" by 3.

    16=2 4 . 16 10 =10000 2 .

    3 10 =11 2 .

    19 10 =10000 2 +11 2 =10011 2 .

    If the number is less than the number "2 to the power", then it is more convenient to use the number "2 to the power-1". We solve it like this:

    First we convert the number “2 to the power-1” into the binary system. And then we subtract from it the difference between the number “2 to the power of 1” and the number being translated.

    For example, let's convert 29 from the decimal system. It is greater than the number “2 to the power-1” by 2. 29=31-2.

    31 10 =11111 2 .

    2 10 =10 2 .

    29 10 =11111 2 -10 2 =11101 2

    If the difference between the number being translated and the number "2 to the power" is more than three, then you can break the number into its components, convert each part into the binary system and add.

    For example, convert the number 528 from the decimal system. 528=512+16. We translate 512 and 16 separately.
    512=2 9 . 512 10 =1000000000 2 .
    16=2 4 . 16 10 =10000 2 .
    Now let's add it in a column:

    Note 1

    If you want to convert a number from one number system to another, then it is more convenient to first convert it to the decimal number system, and only then convert it from the decimal number system to any other number system.

    Rules for converting numbers from any number system to decimal

    In computing technology that uses machine arithmetic, the conversion of numbers from one number system to another plays an important role. Below we give the basic rules for such transformations (translations).

      When converting a binary number to a decimal, you need to represent the binary number as a polynomial, each element of which is represented as the product of a digit of the number and the corresponding power of the base number, in this case $2$, and then you need to calculate the polynomial using the rules of decimal arithmetic:

      $X_2=A_n \cdot 2^(n-1) + A_(n-1) \cdot 2^(n-2) + A_(n-2) \cdot 2^(n-3) + ... + A_2 \cdot 2^1 + A_1 \cdot 2^0$

    Figure 1. Table 1

    Example 1

    Convert the number $11110101_2$ to the decimal number system.

    Solution. Using the given table of $1$ powers of the base $2$, we represent the number as a polynomial:

    $11110101_2 = 1 \cdot 27 + 1 \cdot 26 + 1 \cdot 25 + 1 \cdot 24 + 0 \cdot 23 + 1 \cdot 22 + 0 \cdot 21 + 1 \cdot 20 = 128 + 64 + 32 + 16 + 0 + 4 + 0 + 1 = 245_(10)$

      To convert a number from the octal number system to the decimal number system, you need to represent it as a polynomial, each element of which is represented as the product of a digit of the number and the corresponding power of the base number, in this case $8$, and then you need to calculate the polynomial according to the rules of decimal arithmetic:

      $X_8 = A_n \cdot 8^(n-1) + A_(n-1) \cdot 8^(n-2) + A_(n-2) \cdot 8^(n-3) + ... + A_2 \cdot 8^1 + A_1 \cdot 8^0$

    Figure 2. Table 2

    Example 2

    Convert the number $75013_8$ to the decimal number system.

    Solution. Using the given table of $2$ powers of the base $8$, we represent the number as a polynomial:

    $75013_8 = 7\cdot 8^4 + 5 \cdot 8^3 + 0 \cdot 8^2 + 1 \cdot 8^1 + 3 \cdot 8^0 = 31243_(10)$

      To convert a number from hexadecimal to decimal, you need to represent it as a polynomial, each element of which is represented as the product of a digit of the number and the corresponding power of the base number, in this case $16$, and then you need to calculate the polynomial according to the rules of decimal arithmetic:

      $X_(16) = A_n \cdot 16^(n-1) + A_(n-1) \cdot 16^(n-2) + A_(n-2) \cdot 16^(n-3) + . .. + A_2 \cdot 16^1 + A_1 \cdot 16^0$

    Figure 3. Table 3

    Example 3

    Convert the number $FFA2_(16)$ to the decimal number system.

    Solution. Using the given table of $3$ powers of the base $8$, we represent the number as a polynomial:

    $FFA2_(16) = 15 \cdot 16^3 + 15 \cdot 16^2 + 10 \cdot 16^1 + 2 \cdot 16^0 =61440 + 3840 + 160 + 2 = 65442_(10)$

    Rules for converting numbers from the decimal number system to another

    • To convert a number from the decimal number system to the binary system, it must be sequentially divided by $2$ until there is a remainder less than or equal to $1$. A number in the binary system is represented as a sequence of the last result of division and the remainders from division in reverse order.

    Example 4

    Convert the number $22_(10)$ to the binary number system.

    Solution:

    Figure 4.

    $22_{10} = 10110_2$

    • To convert a number from the decimal number system to octal, it must be sequentially divided by $8$ until there is a remainder less than or equal to $7$. A number in the octal number system is represented as a sequence of digits of the last division result and the remainders from the division in reverse order.

    Example 5

    Convert the number $571_(10)$ to the octal number system.

    Solution:

    Figure 5.

    $571_{10} = 1073_8$

    • To convert a number from the decimal number system to the hexadecimal system, it must be successively divided by $16$ until there is a remainder less than or equal to $15$. A number in the hexadecimal system is represented as a sequence of digits of the last division result and the remainder of the division in reverse order.

    Example 6

    Convert the number $7467_(10)$ to hexadecimal number system.

    Solution:

    Figure 6.

    $7467_(10) = 1D2B_(16)$

      In order to convert a proper fraction from a decimal number system to a non-decimal number system, it is necessary to sequentially multiply the fractional part of the number being converted by the base of the system to which it needs to be converted. Fractions in the new system will be represented as whole parts of products, starting with the first.

      For example: $0.3125_((10))$ in octal number system will look like $0.24_((8))$.

      In this case, you may encounter a problem when a finite decimal fraction can correspond to an infinite (periodic) fraction in the non-decimal number system. In this case, the number of digits in the fraction represented in the new system will depend on the required accuracy. It should also be noted that integers remain integers, and proper fractions remain fractions in any number system.

    Rules for converting numbers from a binary number system to another

    • To convert a number from the binary number system to octal, it must be divided into triads (triples of digits), starting with the least significant digit, if necessary, adding zeros to the leading triad, then replace each triad with the corresponding octal digit according to Table 4.

    Figure 7. Table 4

    Example 7

    Convert the number $1001011_2$ to the octal number system.

    Solution. Using Table 4, we convert the number from the binary number system to octal:

    $001 001 011_2 = 113_8$

    • To convert a number from the binary number system to hexadecimal, it should be divided into tetrads (four digits), starting with the least significant digit, if necessary, adding zeros to the most significant tetrad, then replace each tetrad with the corresponding octal digit according to Table 4.