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: 3722471

You may also be interested:

  • Truth table calculator. SDNF. SKNF. Zhegalkin polynomial

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

Most in a simple way converting a number from one number system to another is to first convert the number into a decimal number system, and then the resulting result into 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

Let us remind you that the correct decimal 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 is zeroed 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

Before we start solving problems, we need to understand a few simple points.

Consider the decimal number 875. The last digit of the number (5) is the remainder of dividing the number 875 by 10. The last two digits form the number 75 - this is the remainder of dividing the number 875 by 100. Similar statements are true for any number system:

The last digit of a number is the remainder when dividing this number by the base of the number system.

The last two digits of a number are the remainder when the number is divided by the squared base.

For example, . Divide 23 by the system base 3, we get 7 and 2 as a remainder (2 is the last digit of a number in the ternary system). Divide 23 by 9 (base squared), we get 18 and 5 as a remainder (5 = ).

Let's return again to the usual decimal system. Number = 100000. That is 10 to the k power is one and k zeros.

A similar statement is true for any number system:

The base of the number system to the power k in this number system is written as one and k zeros.

For example, .

1. Finding the base of the number system

Example 1.

In a number system with some base, the decimal number 27 is written as 30. Specify this base.

Solution:

Let us denote the desired base x. Then .I.e. x = 9.

Example 2.

In a number system with some base, the decimal number 13 is written as 111. Specify this base.

Solution:

Let us denote the desired base x. Then

We solve the quadratic equation, we get roots 3 and -4. Since the base of the number system cannot be negative, the answer is 3.

Answer: 3

Example 3

Separated by commas, in ascending order, indicate all bases of number systems in which the number 29 ends in 5.

Solution:

If in some system the number 29 ends in 5, then the number reduced by 5 (29-5 = 24) ends in 0. We have already said earlier that a number ends in 0 in the case when it is divisible by the base of the system without a remainder. Those. we need to find all such numbers that are divisors of the number 24. These numbers are: 2, 3, 4, 6, 8, 12, 24. Note that in the number systems with base 2, 3, 4 there is no number 5 (and in the formulation problem, the number 29 ends in 5), which means that systems with bases remain: 6, 8, 12,

Answer: 6, 8, 12, 24

Example 4

Separated by commas, in ascending order, indicate all bases of number systems in which the number 71 ends in 13.

Solution:

If in some system a number ends in 13, then the base of this system is not less than 4 (otherwise there is no number 3 there).

A number reduced by 3 (71-3=68) ends in 10. That is. 68 is completely divided by the desired base of the system, and the quotient of this when divided by the base of the system gives a remainder of 0.

Let's write down all the integer divisors of the number 68: 2, 4, 17, 34, 68.

2 is not suitable, because the base is not less than 4. Let's check the remaining divisors:

68:4 = 17; 17:4 = 4 (rest 1) – suitable

68:17 = 4; 4:17 = 0 (rest 4) – not suitable

68:34 = 2; 2:17 = 0 (ost 2) – not suitable

68:68 = 1; 1:68 = 0 (rest 1) – suitable

Answer: 4.68

2. Search for numbers by conditions

Example 5

Specify, separated by commas in ascending order, all decimal numbers not exceeding 25, the notation of which in the base four number system ends in 11?

Solution:

First, let's find out what the number 25 looks like in the base 4 number system.

Those. we need to find all numbers, no more than , that end in 11. According to the rule of sequential counting in the base 4 system,
we get the numbers and . We convert them to the decimal number system:

Answer: 5, 21

3. Solving equations

Example 6

Solve the equation:

Write your answer in the ternary system (there is no need to write the base of the number system in your answer).

Solution:

Let's convert all numbers to the decimal number system:

The quadratic equation has roots -8 and 6 (since the base of the system cannot be negative). .

Answer: 20

4. Counting the number of ones (zeros) in the binary notation of the value of an expression

To solve this type of problem, we need to remember how columnar addition and subtraction works:

When adding, a bitwise summation of the digits written under each other occurs, starting with the least significant digits. If the resulting sum of two digits is greater than or equal to the base of the number system, the remainder of dividing this sum by the base of the number system is written under the summed digits, and the integer part of dividing this sum by the base of the system is added to the sum of the following digits.

When subtracting, the digits written below each other are bitwise subtracted, starting with the least significant digits. If the first digit is less than the second, we “borrow” one from the adjacent (larger) digit. The unit occupied in the current digit is equal to the base of the number system. In decimal it is 10, in binary it is 2, in ternary it is 3, etc.

Example 7

How many units are contained in the binary notation of the expression value: ?

Solution:

Let's imagine all the numbers in the expression as powers of two:

In binary notation, 2 to the power of n looks like 1 followed by n zeros. Then summing and , we get a number containing 2 units:

Now let's subtract 10,000 from the resulting number. According to the rules of subtraction, we borrow from the next digit.

Now add 1 to the resulting number:

We see that the result has 2013+1+1=2015 units.

Notation is a method of writing a number using a specified set of special characters (digits).

Notation:

  • gives a representation of a set of numbers (integers and/or reals);
  • gives each number a unique representation (or at least a standard representation);
  • displays the algebraic and arithmetic structure of a number.

Writing a number in some number system is called number code.

A separate position in a number display is called discharge, which means the position number is rank number.

The number of digits in a number is called bit depth and coincides with its length.

Number systems are divided into positional And non-positional. Positional number systems are divided

on homogeneous And mixed.

octal number system, hexadecimal number system and other number systems.

Translation of number systems. Numbers can be converted from one number system to another.

Number correspondence table in various systems Reckoning.

In computer science courses, regardless of school or university, a special place is given to such a concept as number systems. As a rule, several lessons or practical exercises are allocated for it. The main goal is not only to master the basic concepts of the topic, to study the types of number systems, but also to get acquainted with binary, octal and hexadecimal arithmetic.

What does it mean?

Let's start by defining the basic concept. As the textbook "Informatics" notes, a number system is a record of numbers that uses a special alphabet or a specific set of numbers.

Depending on whether the value of a digit changes depending on its position in the number, there are two: positional and non-positional number systems.

In positional systems, the meaning of a digit changes with its position in the number. So, if we take the number 234, then the number 4 in it means units, but if we consider the number 243, then it will already mean tens, not units.

In non-positional systems, the meaning of a digit is static, regardless of its position in the number. The most striking example is the stick system, where each unit is indicated by a dash. It doesn’t matter where you place the stick, the value of the number will only change by one.

Non-positional systems

Non-positional number systems include:

  1. A unit system that is considered one of the first. It used sticks instead of numbers. The more there were, the greater the value of the number. You can find examples of numbers written in this way in films where we're talking about about people lost at sea, prisoners who mark each day with notches on a stone or tree.
  2. Roman, in which Latin letters were used instead of numbers. Using them, you can write any number. Moreover, its value was determined using the sum and difference of the digits that made up the number. If there was a smaller number to the left of the digit, then the left digit was subtracted from the right, and if the digit to the right was less than or equal to the digit on the left, then their values ​​were summed. For example, the number 11 was written as XI, and 9 - IX.
  3. Alphabetical, in which numbers were designated using the alphabet of a particular language. One of them is considered to be the Slavic system, in which a number of letters had not only phonetic, but also numeric value.
  4. in which only two notations were used for writing - wedges and arrows.
  5. Egypt also used special symbols to represent numbers. When writing a number, each symbol could be used no more than nine times.

Position systems

Much attention is paid in computer science to positional number systems. These include the following:

  • binary;
  • octal;
  • decimal;
  • hexadecimal;
  • sexagesimal, used when counting time (for example, there are 60 seconds in a minute, 60 minutes in an hour).

Each of them has its own alphabet for writing, rules for translation and performing arithmetic operations.

Decimal system

This system is the most familiar to us. It uses the numbers 0 to 9 to write numbers. They are also called Arabic. Depending on the position of the digit in the number, it can denote different digits - units, tens, hundreds, thousands or millions. We use it everywhere, we know the basic rules by which arithmetic operations on numbers are performed.

Binary system

One of the main number systems in computer science is binary. Its simplicity allows the computer to perform cumbersome calculations several times faster than in the decimal system.

To write numbers, only two digits are used - 0 and 1. Moreover, depending on the position of 0 or 1 in the number, its value will change.

Initially, it was with the help of computers that they received all the necessary information. In this case, one meant the presence of a signal transmitted using voltage, and zero meant its absence.

Octal system

Another well-known computer number system, which uses numbers from 0 to 7. It was used mainly in those areas of knowledge that are associated with digital devices. But recently it has been used much less frequently, since it has been replaced by the hexadecimal number system.

Binary decimal system

Performance large numbers in the binary system for humans, the process is quite complex. To simplify it, it was developed. It is usually used in electronic watches and calculators. In this system, not the entire number is converted from the decimal system to binary, but each digit is converted to its corresponding set of zeros and ones in the binary system. The conversion from binary to decimal occurs in a similar way. Each digit, represented as a four-digit set of zeros and ones, is converted into a decimal number system digit. In principle, there is nothing complicated.

To work with numbers in in this case a table of number systems will be useful, which will indicate the correspondence between the numbers and their binary code.

Hexadecimal system

Recently, the hexadecimal number system has become increasingly popular in programming and computer science. It uses not only numbers from 0 to 9, but also a number of Latin letters - A, B, C, D, E, F.

At the same time, each of the letters has its own meaning, so A=10, B=11, C=12 and so on. Each number is represented as a set of four characters: 001F.

Converting numbers: from decimal to binary

Translation in number systems occurs according to certain rules. The most common conversion is from binary to decimal system and vice versa.

In order to convert a number from the decimal system to the binary system, it is necessary to sequentially divide it by the base of the number system, that is, the number two. In this case, the remainder of each division must be recorded. This will happen until the remainder of the division is less than or equal to one. It is best to carry out calculations in a column. The resulting division remainders are then written to the line in reverse order.

For example, let's convert the number 9 to binary:

We divide 9, since the number is not divisible by a whole, then we take the number 8, the remainder will be 9 - 1 = 1.

After dividing 8 by 2, we get 4. Divide it again, since the number is divisible by an integer - we get a remainder of 4 - 4 = 0.

We carry out the same operation with 2. The remainder is 0.

As a result of division we get 1.

Regardless of the final number system, the conversion of numbers from decimal to any other will occur according to the principle of dividing the number by the base of the positional system.

Converting numbers: from binary to decimal

It is quite easy to convert numbers into the decimal number system from binary. To do this, it is enough to know the rules for raising numbers to powers. In this case, to the power of two.

The translation algorithm is as follows: each digit from the code of a binary number must be multiplied by two, and the first two will be to the power of m-1, the second - m-2 and so on, where m is the number of digits in the code. Then add the results of the addition to obtain an integer.

For schoolchildren, this algorithm can be explained more simply:

To begin with, we take and write down each digit multiplied by two, then put the power of two from the end, starting from zero. Then we add up the resulting number.

As an example, we will analyze the number 1001 obtained earlier, converting it to the decimal system, and at the same time check the correctness of our calculations.

It will look like this:

1*2 3 + 0*2 2 +0*2 1 +1*2 0 = 8+0+0+1 =9.

When studying this topic, it is convenient to use a table with powers of two. This will significantly reduce the amount of time required to carry out calculations.

Other translation options

In some cases, translation can be carried out between binary and octal number systems, binary and hexadecimal. In this case, you can use special tables or launch a calculator application on your computer by selecting the “Programmer” option in the View tab.

Arithmetic operations

Regardless of the form in which the number is presented, it can be used to carry out calculations that are familiar to us. This can be division and multiplication, subtraction and addition in the number system you have chosen. Of course, each of them has its own rules.

So for the binary system, its own tables have been developed for each of the operations. The same tables are used in other positional systems.

There is no need to memorize them - just print them out and have them on hand. You can also use a calculator on your PC.

One of the most important topics in computer science is the number system. Knowledge of this topic, understanding of algorithms for converting numbers from one system to another is the key to the fact that you will be able to understand more complex topics, such as algorithmization and programming, and will be able to write your first program yourself.

Problems on the topic "Number systems"

Examples of solutions

Task No. 1. How many significant figures in notation of the decimal number 357 in the base 3 number system?Solution:Let's convert the number 35710 to the ternary number system:So, 35710 = 1110203. The number 1110203 contains 6 significant digits.Answer: 6.

Task No. 2. Given A=A715, B=2518. Which of the numbers C, written in binary system, meets condition A1) 101011002 2) 101010102 3) 101010112 4) 101010002 Solution:Let's convert the numbers A=A715 and B=2518 into the binary number system, replacing each digit of the first number with the corresponding tetrad, and each digit of the second number with the corresponding triad: A715= 1010 01112; 2518 = 010 101 0012.Condition a

Task No. 3. What digit ends with the decimal number 123 in the base 6 number system?Solution:Let's convert the number 12310 to the base 6 number system:12310 = 3236. Answer: The number 12310 in the base 6 number system ends with the number 3.Tasks for performing arithmetic operations on numbers presented in different systems dead reckoning

Task No. 4. Calculate the sum of numbers X and Y if X=1101112, Y=1358. Present the result in binary form.1) 100100112 2) 100101002 3) 110101002 4) 101001002 Solution:Let's convert the number Y=1358 to the binary number system, replacing each of its digits with the corresponding triad: 001 011 1012. Let's perform the addition:Answer: 100101002 (option 2).

Task No. 5. Find the arithmetic mean of the numbers 2368, 6С16 and 1110102. Present the answer in the decimal number system.Solution:Let's convert the numbers 2368, 6С16 and 1110102 into the decimal number system:
Let's calculate the arithmetic mean of the numbers: (158+108+58)/3 = 10810.Answer: the arithmetic mean of the numbers 2368, 6C16 and 1110102 is 10810.

Task No. 6. Calculate the value of the expression 2068 + AF16 ? 110010102. Perform calculations in the octal number system. Convert your answer to decimal system.Solution:Let's convert all numbers to the octal number system:2068 = 2068; AF16 = 2578; 110010102 = 3128Let's add the numbers:Let's convert the answer to the decimal system:Answer: 51110.

Tasks on finding the base of a number system

Task No. 7. There are 100q fruit trees in the garden: 33q of them are apple trees, 22q of pears, 16q of plums and 17q of cherries. Find the base of the number system in which the trees are counted.Solution:There are 100q trees in total in the garden: 100q = 33q+22q+16q+17q.Let's number the digits and present these numbers in expanded form:
Answer: Trees are counted in a base 9 number system.

Task No. 8. Find the base x of the number system if you know that 2002x = 13010.Solution:Answer:4.

Task No. 9. In a number system with some base, the decimal number 18 is written as 30. Specify this base.Solution:Let's take x to be the base of the unknown number system and create the following equality:1810 = 30x;Let's number the digits and write these numbers in expanded form:Answer: The decimal number 18 is written as 30 in the base 6 number system.