Converting from binary to decimal is simple. Converting numbers from decimal to binary and back

The calculator allows you to convert whole and fractional numbers from one number system to another. The base of the number system cannot be less than 2 and more than 36 (10 digits and 26 Latin letters after all). The length of numbers must not exceed 30 characters. To enter fractional numbers, use the symbol. or, . To convert a number from one system to another, enter the original number in the first field, the base of the original number system in the second, and the base of the number system to which you want to convert the number in the third field, then click the "Get Record" button.

Original number written in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 -th number system.

I want to get a number written in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 -th number system.

Get entry

Translations completed: 1237200

Number systems

Number systems are divided into two types: positional And not positional. We use the Arabic system, it is positional, but there is also the Roman system - it is not positional. In positional systems, the position of a digit in a number uniquely determines the value of that number. This is easy to understand by looking at some number as an example.

Example 1. Let's take the number 5921 in the decimal number system. Let's number the number from right to left starting from zero:

The number 5921 can be written in the following form: 5921 = 5000+900+20+1 = 5·10 3 +9·10 2 +2·10 1 +1·10 0 . The number 10 is a characteristic that defines the number system. The values ​​of the position of a given number are taken as powers.

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

The number 1234.567 can be written in the following form: 1234.567 = 1000+200+30+4+0.5+0.06+0.007 = 1·10 3 +2·10 2 +3·10 1 +4·10 0 +5·10 -1 + 6·10 -2 +7·10 -3 .

Converting numbers from one number system to another

The simplest way to convert a number from one number system to another is to first convert the number to the decimal number system, and then the resulting result to the required number system.

Converting numbers from any number system to the decimal number system

To convert a number from any number system to decimal, it is enough to number its digits, starting with zero (the digit to the left of the decimal point) similarly to examples 1 or 2. Let's find the sum of the products of the digits of the number by the base of the number system to the power of the position of this digit:

1. Convert the number 1001101.1101 2 to the decimal number system.
Solution: 10011.1101 2 = 1·2 4 +0·2 3 +0·2 2 +1·2 1 +1·2 0 +1·2 -1 +1·2 -2 +0·2 -3 +1·2 - 4 = 16+2+1+0.5+0.25+0.0625 = 19.8125 10
Answer: 10011.1101 2 = 19.8125 10

2. Convert the number E8F.2D 16 to the decimal number system.
Solution: E8F.2D 16 = 14·16 2 +8·16 1 +15·16 0 +2·16 -1 +13·16 -2 = 3584+128+15+0.125+0.05078125 = 3727.17578125 10
Answer: E8F.2D 16 = 3727.17578125 10

Converting numbers from the decimal number system to another number system

To convert numbers from the decimal number system to another number system, the integer and fractional parts of the number must be converted separately.

Converting an integer part of a number from a decimal number system to another number system

An integer part is converted from a decimal number system to another number system by sequentially dividing the integer part of a number by the base of the number system until a whole remainder is obtained that is less than the base of the number system. The result of the translation will be a record of the remainder, starting with the last one.

3. Convert the number 273 10 to the octal number system.
Solution: 273 / 8 = 34 and remainder 1. 34 / 8 = 4 and remainder 2. 4 is less than 8, so the calculation is complete. The record from the balances will look like this: 421
Examination: 4·8 2 +2·8 1 +1·8 0 = 256+16+1 = 273 = 273, the result is the same. This means the translation was done correctly.
Answer: 273 10 = 421 8

Let's consider the translation of regular decimal fractions into various number systems.

Converting the fractional part of a number from the decimal number system to another number system

Recall that a proper decimal fraction is called real number with zero integer part. To convert such a number to a number system with base N, you need to sequentially multiply the number by N until the fractional part goes to zero or the required number of digits is obtained. If, during multiplication, a number with an integer part other than zero is obtained, then the integer part is not taken into account further, since it is sequentially entered into the result.

4. Convert the number 0.125 10 to the binary number system.
Solution: 0.125·2 = 0.25 (0 is the integer part, which will become the first digit of the result), 0.25·2 = 0.5 (0 is the second digit of the result), 0.5·2 = 1.0 (1 is the third digit of the result, and since the fractional part is zero , then the translation is completed).
Answer: 0.125 10 = 0.001 2

In one of our materials we looked at the definition. It has the shortest alphabet. Only two digits: 0 and 1. Examples of alphabets of positional number systems are given in the table.

Positional number systems

System name

Base

Alphabet

Binary

Trinity

Quaternary

Fivefold

Octal

Decimal

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

duodecimal

0,1,2,3,4,5,6,7,8,9,A,B

Hexadecimal

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

Thirty-six

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G, H,I,J,K,L,M,N,O, P,R,S,T,U,V,X,Y,Z


To convert a small number from decimal to binary and vice versa, it is better to use the following table.

Table for converting decimal numbers from 0 to 20 to the binary number system.

decimal

number

binary number

decimal

number

binary number


However, the table will turn out to be huge if you write all the numbers there. Finding the right number among them will be more difficult. It is much easier to remember several algorithms for converting numbers from one positional number system to another.


How to convert from one number system to another? In computer science, there are several simple ways to convert decimal numbers to binary numbers. Let's look at two of them.

Method No. 1.

Let's say you need to convert a number 637 decimal system to binary system.


This is done as follows: the maximum power of two is found so that two in this power is less than or equal to the original number.


In our case it is 9, because 2 9 =512 , A 2 10 =1024 , which is greater than our starting number. Thus, we received the number of digits of the result. It is equal to 9+1=10. This means that the result will look like 1ххххххххх, where x can be replaced by 1 or 0.


Let's find the second digit of the result. Let's raise two to the power of 9 and subtract from the original number: 637-2 9 =125. Then compare with the number 2 8 =256 . Since 125 is less than 256, the ninth digit will be 0, i.e. the result will already look like 10хххххххх.


2 7 =128 > 125 , which means the eighth digit will also be zero.


2 6 =64 , then the seventh digit is equal to 1. 125-64=61 Thus, we have received four senior digits and the number will take the form 10011ххххх.


2 5 =32 and we see that 32< 61, значит шестой разряд равен 1 (результат 100111хххх), остаток 61-32=29.


2 4 =16 < 29 - fifth digit 1 => 1001111xxx. Remainder 29-16=13.


2 3 =8 < 13 => 10011111хх. 13-8=5


2 2 =4 < 5 => 10011111хх, remainder 5-4=1.


2 1 =2 > 1 => 100111110x, remainder 2-1=1.


2 0 =1 => 1001111101.


This will be the final result.

Method number 2.

The rule for converting integer decimal numbers to the binary number system states:

  1. Let's divide a n−1 a n−2 ...a 1 a 0 =a n−1⋅2 n−1 +a n−2⋅2 n−2 +...+a 0⋅2 0 by 2.
  2. The quotient will be equal to an−1⋅2n−2+...+a1, and the remainder will be equal
  3. Let us again divide the resulting quotient by 2, the remainder of the division will be equal to a1.
  4. If we continue this division process, then at the nth step we get a set of numbers: a 0 ,a 1 ,a 2 ,...,a n−1, which are included in the binary representation of the original number and coincide with the remainders when it is sequentially divided by 2.
  5. Thus, to convert an integer decimal number to the binary number system, you need to sequentially divide the given number and the resulting integer quotients by 2 until we get a quotient that is equal to zero.

The original number in the binary number system is compiled by sequentially recording the resulting remainders. We start recording it with the last one found.


Let's convert the decimal number 11 into the binary number system. The sequence of actions discussed above (translation algorithm) can be depicted as follows:


Got 11 10 =1011 2 .

Example:

If the decimal number is large enough, then the following way of writing the algorithm discussed above is more convenient:



363 10 =101101011 2



Converting numbers from one number system to another is an important part of machine arithmetic. Let's consider the basic rules of translation.

1. To convert a binary number to a decimal one, it is necessary to write it in the form of a polynomial, consisting of the products of the digits of the number and the corresponding power of 2, and calculate it according to the rules of decimal arithmetic:

When translating, it is convenient to use the table of powers of two:

Table 4. Powers of number 2

n (degree)

Example.

2. To convert an octal number to a decimal one, it is necessary to write it down as a polynomial consisting of the products of the digits of the number and the corresponding power of the number 8, and calculate it according to the rules of decimal arithmetic:

When translating, it is convenient to use the table of powers of eight:

Table 5. Powers of the number 8

n (degree)

Example. Convert the number to the decimal number system.

3. To convert a hexadecimal number to a decimal one, it is necessary to write it in the form of a polynomial, consisting of the products of the digits of the number and the corresponding power of the number 16, and calculate it according to the rules of decimal arithmetic:

When translating, it is convenient to use blitz of powers of number 16:

Table 6. Powers of the number 16

n (degree)

Example. Convert the number to the decimal number system.

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

Example. Convert the number to the binary number system.

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

Example. Convert the number to the octal number system.

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

Example. Convert the number to hexadecimal number system.

Hello, site visitor! We continue to study the IP network layer protocol, and to be more precise, its version IPv4. At first glance the topic binary numbers and binary number system has nothing to do with the IP protocol, but if we remember that computers work with zeros and ones, then it turns out that the binary system and its understanding is the basis of the fundamentals, we need learn to convert numbers from binary to decimal and vice versa: decimal to binary. This will help us better understand the IP protocol, as well as the principle of operation of variable-length network masks. Let's get started!

If the topic of computer networks is interesting to you, you can read other course recordings.

4.4.1 Introduction

Before we begin, it’s worth explaining why a network engineer needs this topic. Although you could be convinced of its necessity when we spoke, you can say that there are IP calculators that greatly facilitate the task of allocating IP addresses, calculating the necessary subnet/network masks and determining the network number and host number in the IP address. That’s right, but the IP calculator is not always at hand, this is the reason number one. Reason number two is that in the Cisco exams they won't give you an IP calculator and that's it. you will have to do the conversion of IP addresses from decimal to binary on a piece of paper, and there are not so few questions where this is required in the exam/exams for obtaining the CCNA certificate, it would be a shame if the exam was failed because of such a trifle. And finally, understanding the binary number system leads to a better understanding of the principle of operation.

In general, a network engineer is not required to be able to convert numbers from binary to decimal and vice versa in his head. Moreover, rarely does anyone know how to do this mentally; teachers of various courses on computer networks mainly fall into this category, since they constantly encounter this every day. But with a piece of paper and a pen, you should learn how to translate.

4.4.2 Decimal digits and numbers, digits in numbers

Let's start simple and talk about binary digits and numbers, you know that numbers and numbers are two different things. A number is a special symbol for designation, and a number is an abstract notation for quantity. For example, to write down that we have five fingers on our hand, we can use Roman and Arabic numerals: V and 5. In this case, five is both a number and a digit. And, for example, to write the number 20 we use two digits: 2 and 0.

In total, in the decimal number system we have ten digits or ten symbols (0,1,2,3,4,5,6,7,8,9), by combining which we can write different numbers. What principle are we guided by when using the decimal number system? Yes, everything is very simple, we raise ten to one power or another, for example, let’s take the number 321. How can it be written differently, like this: 3*10 2 +2*10 1 +1*10 0 . Thus, it turns out that the number 321 represents three digits:

  1. The number 3 means the most significant place or in this case it is the hundreds place, otherwise their number.
  2. The number 2 is in the tens place, we have two tens.
  3. The number one refers to the least significant digit.

That is, in this entry a two is not just a two, but two tens or two times ten. And three is not just three, but three times a hundred. The following dependence is obtained: the unit of each next digit is ten times greater than the unit of the previous one, because what 300 is is three times a hundred. A digression regarding the decimal number system was necessary to make it easier to understand the binary system.

4.4.3 Binary digits and numbers, as well as their recording

There are only two digits in the binary number system: 0 and 1. Therefore, writing a number in the binary system is often much larger than in the decimal system. With the exception of the numbers 0 and 1, zero in the binary number system is equal to zero in the decimal number system, and the same is true for one. Sometimes, in order not to confuse which number system the number is written in, sub-indices are used: 267 10, 10100 12, 4712 8. The number in the sub-index indicates the number system.

The symbols 0b and &(ampersand) can be used to write binary numbers: 0b10111, &111. If in the decimal number system, to pronounce the number 245 we use this construction: two hundred and forty-five, then in the binary number system, to name the number, we need to pronounce a digit from each digit, for example, the number 1100 in the binary number system should not be pronounced as a thousand one hundred, but like one, one, zero, zero. Let's look at writing the numbers from 0 to 10 in the binary number system:

I think the logic should be clear by now. If in the decimal number system for each digit we had ten options available (from 0 to 9 inclusive), then in the binary number system in each of the digits of a binary number we have only two options: 0 or 1.

To work with IP addresses and subnet masks, we only need natural numbers in the binary number system, although the binary system allows us to write fractional and negative numbers, but we don’t need this.

4.4.4 Converting numbers from decimal to binary

Let's take a better look at this how to convert a number from decimal to binary. And here everything is actually very, very simple, although it’s difficult to explain in words, so I’ll give it right away example of converting numbers from decimal to binary. Let's take the number 61, to convert to the binary system, we need to divide this number by two and see what is the remainder of the division. And the result of division is again divided by two. In this case, 61 is the dividend, we will always have two as a divisor, and we divide the quotient (the result of division) by two again, continue dividing until the quotient contains 1, this last unit will be the leftmost digit . The picture below demonstrates this.

Please note that the number 61 is not 101111, but 111101, that is, we write the result from the end. In the latter particular, there is no sense in dividing one by two, since in this case integer division is used, and with this approach it turns out as in Figure 4.4.2.

This is not the fastest way to convert a number from binary to decimal.. We have several accelerators. For example, the number 7 in binary is written as 111, the number 3 as 11, and the number 255 as 11111111. All these cases are incredibly simple. The fact is that the numbers 8, 4, and 256 are powers of two, and the numbers 7, 3, and 255 are one less than these numbers. So, for numbers that are one less than a number equal to a power of two, a simple rule applies: in the binary system, such a decimal number is written as a number of units equal to a power of two. So, for example, the number 256 is two to the eighth power, therefore, 255 is written as 11111111, and the number 8 is two to the third power, and this tells us that 7 in the binary number system will be written as 111. Well, understand, how to write 256, 4 and 8 in the binary number system is also not difficult, just add one: 256 = 11111111 + 1 = 100000000; 8 = 111 + 1 = 1000; 4 = 11 + 1 = 100.
You can check any of your results on a calculator and it’s better to do so at first.

As you can see, we have not yet forgotten how to divide. And now we can move on.

4.4.5 Converting numbers from binary to decimal

Converting numbers from binary is much easier than converting from decimal to binary. As an example of translation, we will use the number 11110. Pay attention to the table below, it shows the power to which you need to raise two in order to eventually get a decimal number.

To get a decimal number from this binary number, you need to multiply each number in the digit by two to the power, and then add the results of the multiplication, it’s easier to show:

1*2 4 +1*2 3 +1*2 2 +1*2 1 +0*2 0 = 16+8+4+2+0=30

Let's open the calculator and make sure that 30 in the decimal number system is 11110 in binary.

We see that everything was done correctly. From the example it is clear that Converting a number from binary to decimal is much easier than converting it back. To work with confidence you just need to remember powers of two up to 2 8. For clarity, I will provide a table.

We don’t need more, since the maximum possible number that can be written in one byte (8 bits or eight binary values) is 255, that is, in each octet of the IP address or IPv4 subnet mask, the maximum possible value is 255. There are fields , in which there are values ​​greater than 255, but we do not need to calculate them.

4.4.6 Addition, subtraction, multiplication of binary numbers and other operations with binary numbers

Let's now look at operations that can be performed on binary numbers. Let's start with simple arithmetic operations and then move on to Boolean algebra operations.

Adding binary numbers

Adding binary numbers is not that difficult: 1+0 =1; 1+1=0 (I’ll give an explanation later); 0+0=0. These were simple examples where only one digit was used, let's look at examples where the number of digits is more than one.
101+1101 in the decimal system is 5 + 13 = 18. Let's count in a column.

The result is highlighted in orange, the calculator says that we calculated correctly, you can check it. Now let's see why this happened, because at first I wrote that 1+1=0, but this is for the case when we have only one digit, for cases when there are more than one digits, 1+1=10 (or two in decimal), which is logical.

Then look what happens, we perform additions by digits from right to left:

1. 1+1=10, write zero, and one goes to the next digit.

2. In the next digit we get 0+0+1=1 (this unit came to us from the result of addition in step 1).

4. Here we have a unit only in the second number, but it has also been transferred here, so 0+1+1 = 10.

5. Glue everything together: 10|0|1|0.

If you’re too lazy to count in a column, then let’s count like this: 101011+11011 or 43 + 27 = 70. What can we do here, but let’s look, because no one forbids us to make transformations, and changing the places of the terms does not change the sum, for the binary number system this rule is also relevant.

  1. 101011 = 101000 + 11 = 101000 + 10 + 1 = 100000 + 1000 + 10 + 1.
  2. 11011 = 11000 + 10 + 1 = 10000 + 1000 + 10 + 1.
  3. 100000 + 10000 + (1000 +1000) + (10+10) + (1+1).
  4. 100000 + (10000 + 10000) + 100 + 10.
  5. 100000 + 100000 +110
  6. 1000000 + 110.
  7. 1000110.

You can check with a calculator, 1000110 in binary is 70 in decimal.

Subtracting Binary Numbers

Immediately an example for subtracting single-digit numbers in the binary number system, we didn’t talk about negative numbers, so we don’t take 0-1 into account: 1 – 0 = 1; 0 – 0 = 0; 1 – 1 = 0. If there is more than one digit, then everything is also simple, you don’t even need any columns or tricks: 110111 – 1000, this is the same as 55 – 8. As a result, we get 101111. And the heart stopped beating , where does the unit in the third digit come from (numbering from left to right and starting from zero)? It's simple! In the second digit of the number 110111 there is 0, and in the first digit there is 1 (if we assume that the numbering of digits starts from 0 and goes from left to right), but the unit of the fourth digit is obtained by adding two units of the third digit (you get a kind of virtual two) and from this For twos, we subtract one, which is in the zero digit of the number 1000, and 2 - 1 = 1, and 1 is a valid digit in the binary number system.

Multiplying binary numbers

It remains for us to consider the multiplication of binary numbers, which is implemented by shifting one bit to the left. But first, let's look at the results of single-digit multiplication: 1*1 = 1; 1*0=0 0*0=0. Actually, everything is simple, now let's look at something more complex. Let's take the numbers 101001 (41) and 1100 (12). We will multiply by column.

If it is not clear from the table how this happened, then I will try to explain in words:

  1. It is convenient to multiply binary numbers in a column, so we write out the second factor under the first; if the numbers have different numbers of digits, it will be more convenient if the larger number is on top.
  2. The next step is to multiply all the digits of the first number by the lowest digit of the second number. We write the result of the multiplication below; we need to write it so that under each corresponding digit the result of the multiplication is written.
  3. Now we need to multiply all the digits of the first number by the next digit of the second number and write the result one more line below, but this result needs to be shifted one digit to the left; if you look at the table, this is the second sequence of zeros from the top.
  4. The same must be done for subsequent digits, each time moving one digit to the left, and if you look at the table, you can say that one cell to the left.
  5. We have four binary numbers that we now need to add and get the result. We recently looked at addition, there shouldn't be any problems.

In general, the multiplication operation is not that difficult, you just need a little practice.

Boolean algebra operations

There are two very important concepts in Boolean algebra: true and false, the equivalent of which is zero and one in the binary number system. Boolean algebra operators expand the number of available operators over these values, let's take a look at them.

Logical AND or AND operation

The Logical AND or AND operation is equivalent to multiplying single-digit binary numbers.

1 AND 1 = 1; 1 AND 0 = 1; 0 AND 0 = 0; 0 AND 1 = 0.

1 AND 1 = 1 ;

1 AND 0 = 1 ;

0 AND 0 = 0 ;

0 AND 1 = 0.

The result of “Logical AND” will be one only if both values ​​are equal to one; in all other cases it will be zero.

Operation "Logical OR" or OR

The operation “Logical OR” or OR works on the following principle: if at least one value is equal to one, then the result will be one.

1 OR 1 = 1; 1 OR 0 = 1; 0 OR 1 = 1; 0 OR 0 = 0.

1 OR 1 = 1 ;

1 OR 0 = 1 ;

0 OR 1 = 1 ;

0 OR 0 = 0.

Exclusive OR or XOR operation

The operation "Exclusive OR" or XOR will give us a result of one only if one of the operands is equal to one and the second is equal to zero. If both operands are equal to zero, the result will be zero and even if both operands are equal to one, the result will be zero.

The shortest number system is binary. She is completely based on positional form recording numbers. The main characteristic is the principle doubling digits when performing a transition from a certain position to the next. You can convert from one number system to another either using a special program or manually.

In contact with

Historical recognition

The appearance of binary SS in history is associated with the scientist mathematician V.G. Leibniz. It was he who first spoke about the rules for performing operations with numerical values ​​of this kind. But initially this principle remained unclaimed. The algorithm received worldwide recognition and application at the dawn of computers.

Convenience and simplicity performing operations led to the need for a more detailed study of this subsection of arithmetic, which became indispensable in the development of computer technology with software. For the first time, such mechanisms appeared on the German and French markets.

Attention! A specific point about the superiority of the binary system in relation to the decimal system, precisely in this industry, was set in 1946 and substantiated in an article by A. Bex, H. Goldstein and J. Von Neumann.

Converting a number from the decimal number system to binary.

Features of binary arithmetic

All binary CC is based on the application of only two characters, which very closely match the features of the digital circuit. Each of the symbols is responsible for a specific action, which often implies two states:

  • the presence or absence of a hole, for example, a punched card or paper tape;
  • on magnetic media is responsible for the state of magnetization or demagnetization;
  • by signal level, high or low.

In the science in which SS is used, a certain terminology has been introduced, its essence is as follows:

  • Bit – binary digit, which consists of two components that carry a certain meaning. Placed on the left is defined as the senior one and is a priority, and on the right is the junior one, which is less significant.
  • A byte is a unit that consists of eight bits.

Many modules perceive and process information in portions or words. Each word has a different weight and can consist of 8, 16 or 32 bits.

Rules for transfers from one system to another

One of the most important factors in machine arithmetic is transfer from one SS to another. Therefore, let us pay attention to the basic algorithms for performing a process that will show how to convert a number to the binary system.

Converting the decimal system to binary

First, let us turn to the question of how to convert the system from decimal to binary number system. For this there is translation rule from decimal numbers to binary code, which implies mathematical operations.

Requires a number written in decimal form divide by 2. Continue dividing until there are no more in the quotient. unit. If a binary number system is required, the translation is carried out as follows:

186:2=93 (remaining 0)

93:2=46 (rest 1)

46:2=23 (remaining 0)

23:2=11 (rest 1)

11:2=5 (remaining 1)

5:2=2 (rest.1)

After the division process is completed, then write one in the quotient and write all the remainders sequentially in reverse order of division. That is, 18610=1111010. The rule for converting decimal numbers to SS must always be followed.

Converting a number from the decimal system to binary.

Converting from decimal SS to octal

A similar process is followed when converting from decimal SS to octal. It is also called " substitution rule" If in the previous example the data was divided by 2, then here it is necessary divide by 8. The algorithm for converting the number X10 to octal consists of the following steps:

  1. The number X10 begins to be divided by 8. We take the resulting quotient for the next division, and the remainder is written as least significant bit.
  2. We continue dividing until we get the result of the quotient equal zero or remainder, which in its value less than eight. In this case, we write all the remainders as low order bits.

For example, you need to convert the number 160110 to octal.

1601:8=200 (remaining 1)

200:8=25 (remaining 0)

25:8=3 (rest.1)

So, we get: 161010=31018.

Convert from decimal to octal.

Write a decimal number in hexadecimal

Conversion from decimal to hexadecimal SS is carried out similarly using the substitution system. But in addition to numbers they also use letters of the latin alphabet A, B, C, D, E, F. Where A denotes the remainder 10, and F the remainder 15. The decimal number is divided by 16. For example, convert 10710 to hexadecimal:

107:16=6 (remaining 11 – replace B)

6 is less than sixteen. We stop dividing and write 10710 = 6B16.

Moving from another system to binary

The next question is how to convert a number from octal to binary. Converting numbers from any system to binary is quite simple. An assistant in this matter is table for number systems.