To convert numbers from decimal s/s to any other, you need to divide the decimal number by the base of the system to which you are converting, while keeping the remainder from each division. The result is generated from right to left. The division continues until the result of the division is less than the divisor.

The calculator converts numbers from one number system to any other. It can convert numbers from binary to decimal or decimal to hexadecimal, showing the detailed solution progress. You can easily convert a number from ternary to quinary or even from septenary to seventeenth. The calculator can convert numbers from any number system to any other.

Online calculator: Convert numbers from one number system to any other online

Input data

Enter the number:


Its number system
Binary
Trinity
Octal
Decimal
Hexadecimal
Binary Decimal
Other

By triads
By notebooks

Which? (number)


Convert to
Binary
Trinity
Octal
Decimal
Hexadecimal
Binary decimal
Another

Which? (number)

Methods for converting numbers from one number system to another

To the program Unified State Exam in Computer Science includes several tasks related to converting numbers from one system to another. Typically, this is a conversion between octal and hexadecimal systems and binary. These are the sections A1, AT 11. But there are also problems with other number systems, such as in the section B7.

To begin with, let us recall two tables that would be good to know by heart for those who choose computer science as their future profession.

Table of powers of number 2:

2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10
2 4 8 16 32 64 128 256 512 1024

It is easily obtained by multiplying the previous number by 2. So, if you don’t remember all of these numbers, it’s not difficult to get the rest in your mind from those that you remember.

Table of binary numbers from 0 to 15 with hexadecimal representation:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
0 1 2 3 4 5 6 7 8 9 A B C D E F

The missing values ​​are also easy to calculate by adding 1 to the known values.

Arithmetic operations in the binary number system

When two numbers equal to 1 are added, the result in this digit is 0, and the 1 is transferred to the highest digit.

Integer conversion

So, let's start by converting directly to the binary system. Let's take the same number 810 10. We need to decompose this number into terms equal to powers of two.
  1. We are looking for the power of two closest to 810 and not exceeding it. This is 2 9 = 512.
  2. Subtract 512 from 810, we get 298.
  3. Repeat steps 1 and 2 until there are no 1s or 0s left.
  4. We got it like this: 810 = 512 + 256 + 32 + 8 + 2 = 2 9 + 2 8 + 2 5 + 2 3 + 2 1 .
Then there are two methods, you can use any of them. How easy it is to see that in any number system its base is always 10. The square of the base will always be 100, the cube 1000. That is, the degree of the base of the number system is 1 (one), and behind it there are as many zeros as the degree.

Method 1: Arrange 1 according to the ranks of the indicators of the terms. In our example, these are 9, 8, 5, 3 and 1. The remaining places will contain zeros. So, we got the binary representation of the number 810 10 = 1100101010 2. Units are placed in 9th, 8th, 5th, 3rd and 1st places, counting from right to left from zero.

Method 2: Let's write the terms as powers of two under each other, starting with the largest.

810 =

Now let's add these steps together, like folding a fan: 1100101010.

That's all. At the same time, the problem “how many units are in the binary notation of the number 810?” is also simply solved.

The answer is as many as there are terms (powers of two) in this representation. 810 has 5 of them.

Now the example is simpler.

Let's convert the number 63 to the 5-ary number system. The closest power of 5 to 63 is 25 (square 5). A cube (125) will already be a lot. That is, 63 lies between the square of 5 and the cube. Then we will select the coefficient for 5 2. This is 2.

We get 63 10 = 50 + 13 = 50 + 10 + 3 = 2 * 5 2 + 2 * 5 + 3 = 223 5.

And, finally, very easy translations between 8 and hexadecimal systems. Since their base is a power of two, the translation is done automatically, simply by replacing the numbers with their binary representation. For the octal system, each digit is replaced by three binary digits, and for the hexadecimal system, four. In this case, all leading zeros are required, except for the most significant digit.

Let's convert the number 547 8 to binary.

547 8 = 101 100 111
5 4 7

One more, for example 7D6A 16.

7D6A 16 = (0)111 1101 0110 1010
7 D 6 A

Let's convert the number 7368 to the hexadecimal system. First, write the numbers in triplets, and then divide them into quadruples from the end: 736 8 = 111 011 110 = 1 1101 1110 = 1DE 16. Let's convert the number C25 16 to the octal system. First, we write the numbers in fours, and then divide them into threes from the end: C25 16 = 1100 0010 0101 = 110 000 100 101 = 6045 8. Now let's look at converting back to decimal. It is not difficult, the main thing is not to make mistakes in the calculations. We expand the number into a polynomial with powers of the base and coefficients for them. Then we multiply and add everything. E68 16 = 14 * 16 2 + 6 * 16 + 8 = 3688. 732 8 = 7 * 8 2 + 3*8 + 2 = 474 .

Converting Negative Numbers

Here you need to take into account that the number will be presented in two's complement code. To convert a number into additional code, you need to know the final size of the number, that is, what we want to fit it into - in a byte, in two bytes, in four. The most significant digit of a number means the sign. If there is 0, then the number is positive, if 1, then it is negative. On the left, the number is supplemented with a sign digit. Unsigned ( unsigned ) we do not consider numbers, they are always positive, and the most significant digit in them is used as information.

To convert a negative number to binary's complement, you need to convert a positive number to binary, then change the zeros to ones and the ones to zeros. Then add 1 to the result.

So, let's convert the number -79 to the binary system. The number will take us one byte.

Converting 79 to binary, 79 = 1001111. Let's add zeros on the left to a byte size of 8 bits, we get 01001111. We change 1 to 0 and 0 to 1. We get 10110000. We add 1 to the result, we get the answer 10110001.

Along the way we answer Unified State Exam question « how many units are there in the binary representation of the number -79?».

The answer is 4.

Adding 1 to the inverse of a number eliminates the difference between the representations +0 = 00000000 and -0 = 11111111. In additional code they will be written the same way: 00000000.

Converting fractional numbers

Fractional numbers are converted in the reverse way of dividing whole numbers by the base, which we looked at at the very beginning. That is, using sequential multiplication by a new base with the collection of whole parts. The integer parts obtained during multiplication are collected, but do not participate in the following operations. Only fractions are multiplied. If the original number is greater than 1, then the integer and fractional parts are translated separately and then glued together.

Let's convert the number 0.6752 to the binary system.

0 ,6752
*2
1 ,3504
*2
0 ,7008
*2
1 ,4016
*2
0 ,8032
*2
1 ,6064
*2
1 ,2128

The process can be continued for a long time until we get all the zeros in the fractional part or the required accuracy is achieved. Let's stop at the 6th sign for now.

It turns out 0.6752 = 0.101011.

If the number was 5.6752, then in binary it will be 101.101011.

Javascript is disabled in your browser.
To perform calculations, you must enable ActiveX controls!

Let's look at one of them the most important topics in computer science - . IN 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 prerequisite for successfully passing the Unified State Exam and admission to universities at 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. On exams in large quantities There are problems on this topic. 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 tasks For self-study. In addition, you will have the opportunity to download ready-made ones from a file hosting service completely free of charge. detailed solutions to these tasks, illustrating various ways getting 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. The basis is chosen natural number, greater than or equal to two. 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 digit becomes equal to the base 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.

Hence, resourceful students develop “their own methods” (surprisingly... working) when filling out, for example, truth tables, the first columns (variable values) of which are, in fact, 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 equals 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.

Lesson objectives:

  • repeat the material studied on the topic of the number system;
  • learn to convert a number from the decimal system to any other positional number system and vice versa;
  • master the principles of converting numbers from one system to another;
  • develop logical thinking.

During the classes

At the beginning of the lesson, a brief review and checking of homework.

In what form is numerical information presented in computer memory?

What are number systems used for?

What types of number systems do you know? Give your own examples.

How do positional systems differ from non-positional systems?

The goal of our lesson is to learn how to convert a number from the decimal system to any other positional number system and vice versa. But first we'll look at how you can

represent any non-negative integer:

In positional systems, the value of writing an integer is determined by next rule: let a n a n-1 a n-2 …a 1 a 0 be the recording of the number A, and i are the numbers, then

where p is an integer greater than 1, which is called the base of the number system

In order for, for a given p, any non-negative integer could be written according to formula (1) and, moreover, in a unique way, numeric values different digits must be different integers belonging to the segment from 0 to p-1.

1) Decimal system

numbers: 0,1,2,3,4,5,6,7,8,9

number 5735 = 5 10 3 +7 10 2 +3 10 1 +8 10 0

2) Ternary system

numbers: 0,1,2

number 201 3 = 2·3 2 +0·3 1 +1·3 0

Note: the subscript in a number indicates the base of the number system in which the number is written. For the decimal number system, the index need not be written.

Representation of negative and fractional numbers:

In all positional systems, the ‘–’ sign is used to write negative numbers, just like in the decimal system. A comma is used to separate the integer part of a number from the fractional part. The value of the entry a n a n-1 a n-2 …a 1 a 0 , a -1 a -2 …a m-2 a m-1 a m of the number A is determined by the formula, which is a generalization of formula (1):

75.6 = 7·10 1 +5·10 0 +6·10 –1

–2.314 5 = –(2 5 0 +3 5 –1 +1 5 –2 +4 5 –3)

Converting numbers from an arbitrary number system to decimal:

It should be understood that when translating a number from one number system to another, the quantitative value of the number does not change, but only the form of writing the number changes, just as when translating the name of a number, for example, from Russian into English.

Converting numbers from an arbitrary number system to decimal is performed by direct calculation using formula (1) for integers and formula (2) for fractions.

Converting numbers from the decimal number system to an arbitrary number system.

Converting a number from the decimal system to a system with base p means finding the coefficients in formula (2). Sometimes this is easy to do with a simple selection. For example, let's say you need to convert the number 23.5 to the octal system. It is easy to see that 23.5 = 16+7+0.5 = 2·8+7+4/8 = 2·8 1 +7·8 0 +4·8 –1 =27.48. It is clear that the answer is not always so obvious. IN general case a method of converting separately the integer and fractional parts of a number is used.

To convert integers, the following algorithm is used (obtained based on formula (1)):

1. Find the quotient and remainder when dividing a number by p. The remainder will be the next digit ai (j=0,1,2 ...) of the number entry in new system Reckoning.

2. If the quotient is equal to zero, then the translation of the number is completed, otherwise we apply point 1 to the quotient.

Note 1. The digits ai in the number notation are numbered from right to left.

Note 2. If p>10, then it is necessary to introduce notation for numbers with numerical values ​​greater than or equal to 10.

Convert the number 165 to the septal number system.

165:7 = 23 (remainder 4) => a 0 = 4

23:7 = 3 (remainder 2) => a 1 = 2

3:7 = 0 (remainder 3) => a 2 = 3

Let's write down the result: a 2 a 1 a 0 , i.e. 3247.

Having checked using formula (1), we will make sure that the translation is correct:

3247=3·7 2 +2·7 1 +4·7 0 =3·49+2·7+4 = 147+14+4 = 165.

To convert fractional parts of numbers, an algorithm obtained based on formula (2) is used:

1. Multiply the fractional part of the number by p.

2. The integer part of the result will be the next digit am (m = –1, –2, –3 ...) of writing the number in the new number system. If the fractional part of the result is zero, then the translation of the number is completed, otherwise we apply step 1 to it.

Note 1. The digits a m in the number notation are arranged from left to right in increasing order of the absolute value of m.

Note 2. Usually the number of fractional digits in a new number entry is limited in advance. This allows you to perform an approximate translation with a given accuracy. In the case of infinite fractions, such a restriction ensures the finiteness of the algorithm.

Convert the number 0.625 to the binary number system.

0.625 2 = 1.25 (integer part 1) => a -1 =1

0.25 2 = 0.5 (integer part 0) => a- 2 = 0

0.5 2 = 1.00 (integer part 1) => a- 3 = 1

So 0.62510 = 0.1012

Having checked using formula (2), we will make sure that the translation is correct:

0.1012=1·2 -1 +0·2- 2 +1·2 -3 =1/2+1/8 = 0.5+0.125 = 0.625.

Convert the number 0.165 to the quaternary number system, limiting it to four quaternary digits.

0.165 4 = 0.66 (integer part 0) => a -1 =0

0.66 4 = 2.64 (integer part 2) => a -2 = 2

0.64 4 = 2.56 (integer part 2) => a -3 = 2

0.56 4 = 2.24 (integer part 2) => a -4 = 2

So 0.16510" 0.02224

Let's do a back translation to make sure that the absolute error does not exceed 4–4:

0.02224 = 0·4 -1 +2·4 -2 +2·4 -3 +2·4 -4 = 2/16+2/64+2/256 = 1/8+1/32+1/ 128 = 21/128 = 0.1640625

|0,1640625–0,165| = 0,00094 < 4–4 = 0,00390625

Converting numbers from one arbitrary system to another

In this case, you must first convert the number to the decimal system, and then from the decimal system to the required one.

A special method is used to convert numbers for systems with multiple bases.

Let p and q be the bases of two number systems. We will call these systems number systems with multiple bases if p = qn or q = pn, where n is a natural number. So, for example, number systems with bases 2 and 8 are multiple base number systems.

Let p = qn and you need to convert a number from a number system with base q to a number system with base p. Let's divide the integer and fractional parts of the number into groups of n sequentially written digits to the left and right of the decimal point. If the number of digits in the integer part of a number is not a multiple of n, then you need to add the corresponding number of zeros to the left. If the number of digits in the fractional part of a number is not a multiple of n, then zeros are added to the right. Each such group of digits of a number in the old number system will correspond to one digit of a number in the new number system.

Let's convert 1100001.111 2 to the quaternary number system.

By adding zeros and selecting pairs of numbers, we get 01100001.11102.

Now let’s translate each pair of digits separately, using the section Translating numbers from one arbitrary system to another.

So, 1100001.1112 = 01100001.11102 = 1201.324.

Let us now assume that we need to transfer from a system with a larger base q to a system with a smaller base p, i.e. q = pn. In this case, one digit of a number in the old number system corresponds to n digits of a number in the new number system.

Example: Let's check the previous translation of a number.

1201,324 = 1100001,11102=1100001,1112

In the hexadecimal system there are digits with numerical values ​​10,11,12, 13,14,15. To designate them, use the first six letters of the Latin alphabet A, B, C, D, E, F.

Here is a table of numbers from 0 to 16, written in number systems with bases 10, 2, 8 and 16.

Number in decimal system 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
In octal 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20
In binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000
In hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F 10

To write hexadecimal digits, you can also use lowercase Latin letters a-f.

Example: Let's convert the number 110101001010101010100.11 2 into hexadecimal number system.

Let's use the multiplicity of the bases of the number systems (16=2 4). Let's group the numbers by four, adding the required number of zeros to the left and right

000110101001010101010100,1100 2

and, checking the table, we get: 1A9554,C 16

Conclusion:

Which number system is best to write numbers in is a matter of convenience and tradition. From a technical point of view, it is convenient to use the binary system in a computer, since it uses only two digits 0 and 1 to record a number, which can be represented by two easily distinguishable states “no signal” and “there is a signal.”

On the contrary, it is inconvenient for a person to deal with binary notations of numbers due to the fact that they are longer than decimal ones and there are many repeating digits in them. Therefore, if necessary, work with machine representations of numbers, use octal or hexadecimal number systems. The bases of these systems are integer powers of two, and therefore numbers are easily converted from these systems to binary and vice versa.

Write down the homework assignment:

a) Write down the date of birth of all members of your family in different number systems.

b) Convert numbers from binary to octal and hexadecimal, and then check the results by performing the reverse conversions:

a) 1001111110111.011 2;

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 the final decimal may 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, but proper fractions- 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.

Write the number in the binary number system, and the powers of two from right to left. For example, we want to convert the binary number 10011011 2 to decimal. Let's write it down first. Then we write the powers of two from right to left. Let's start with 2 0, which is equal to "1". We increase the degree by one for each subsequent number. We stop when the number of elements in the list is equal to the number of digits in the binary number. Our example number, 10011011, has eight digits, so a list of eight elements would look like this: 128, 64, 32, 16, 8, 4, 2, 1

Write the digits of the binary number under the corresponding powers of two. Now simply write 10011011 under the numbers 128, 64, 32, 16, 8, 4, 2, and 1, so that each binary digit corresponds to a different power of two. The rightmost "1" of the binary number must correspond to the rightmost "1" of the powers of two, and so on. If you prefer, you can write the binary number above powers of two. The most important thing is that they match each other.

Match the digits in a binary number with the corresponding powers of two. Draw lines (from right to left) that connect each successive digit of the binary number to the power of two above it. Start drawing lines by connecting the first digit of a binary number to the first power of two above it. Then draw a line from the second digit of the binary number to the second power of two. Continue connecting each number to the corresponding power of two. This will help you visually see the relationship between two different sets of numbers.

Write down the final value of each power of two. Go through each digit of a binary number. If the number is 1, write the corresponding power of two under the number. If this number is 0, write 0 under the number.

  • Since "1" matches "1", it remains "1". Since "2" matches "1", it remains "2". Since "4" corresponds to "0", it becomes "0". Since "8" matches "1", it becomes "8", and since "16" matches "1" it becomes "16". "32" matches "0" and becomes "0", "64" matches "0" and therefore becomes "0", while "128" matches "1" and therefore becomes 128.
  • Add up the resulting values. Now add the resulting numbers under the line. Here's what you have to do: 128 + 0 + 0 + 16 + 8 + 0 + 2 + 1 = 155. This is the decimal equivalent of the binary number 10011011.

    Write down the answer along with the subscript, equal to the system Reckoning. Now all you have to do is write 155 10 to show that you are working with a decimal answer, which deals with powers of ten. The more you convert binary numbers to decimals, the easier it will be for you to remember powers of two, and the faster you will be able to complete the task.

  • Use this method to convert a binary number with a decimal point to decimal form. You can use this method even if you want to convert a binary number such as 1.1 2 to decimal. All you need to know is that the number on the left side decimal number is a regular number, and the number on the right side of the decimal is the number of “halves,” or 1 x (1/2).

    • "1" to the left of the decimal number corresponds to 2 0, or 1. 1 to the right of the decimal number corresponds to 2 -1, or.5. Add 1 and .5 and you get 1.5, which is the decimal equivalent of 1.1 2.