# Number systems

**Number systems** are sets of methods for writing and naming numbers, which are written using symbols, by the number of which the number systems are divided into positional and non-position ones. Non-positional numbers use an infinite set of symbols. For example, the Roman numeral system in which the letter I is used to write the number one, two and three look like a collection of characters II, III, but for the record five, a new symbol V is chosen, six is VI, ten is the X, one hundred, one thousand M, and so on.

The number-based positioning systems for writing numbers use a limited set of characters called numbers, and the value of the number depends not only on the set of digits, but also on the sequence in which the numbers are written, i.e. from their position. The number of digits used to write a number is called the base of the number system, which we denote by q. For example, in the decimal system, q = 10, i.e. 10 numbers are used: 0 1 2 3 4 5 6 7 8 9. Numbers from 0 to 9 are written in numbers, there is no digit to write the next number, so 0 is written instead of 9, but one more bit is called to the left of zero, (added) 1, the result is 10. Then 11, 12 will go, but on 19 again the low order is again replaced by 0, and the highest bit is increased by 1, in the end, 20 is obtained, and so on.

The number in the positional number system with base q can be represented as a polynomial in powers of q:

_{(q)}= x

_{n-1}q

^{n-1}+ x

_{n-2}q

^{n-2}+ … +x

_{1}q

^{1}+ x

_{0}q

^{0}+ x

_{-1}q

^{-1}+ … + x

_{-m}q

^{-m}

Here, X_{(q)} is the number in the number system with base q;

x_{i} - natural numbers are less than q, i.e. figures;

n is the number of digits of the integer part;

m is the number of digits of the fractional part.

Writing from left to right the digits of the number, we get the encoded record in the q-ary system of numeration:

_{(q)}= x

_{n-1}x

_{n-2}x

_{1}x

_{0}, x

_{-1}x

_{-2}x

_{-m}

But writing a number in a binary system is longer than writing the same number in the decimal system, about 3,3 times. This is not convenient for use, since usually a person can simultaneously perceive no more than five or seven pieces of information. Therefore, octal and hexadecimal number systems are used in computer science.

The octal number system has eight digits: 0 1 2 3 4 5 6 7. Hexadecimal is sixteen, with the first 10 digits coinciding with the digits of the decimal system, and for the remaining six digits, large Latin letters are used: 0 1 2 3 4 5 6 7 8 9 A B C D E F.