Numbers` transfer in different numeral systems
Numeral system is a collection of symbols (digits) and the rules of their use for numbers representation. There are two types of numeral systems. Non positional system – some letters are used as digits. Positional system – the quantitative value of the numbers depends on its place in the entry number. The position of figure is called discharge. Rank number increases from right to left. The number of different digits (characters) used in the positional numeral system for representing (record) number, is called the base. The homogeneous system – for each category of the set of allowed symbols (digits) is the same. As an example, we use the decimal system. If to write the number in the homogeneous of the 10th system, it is possible to use in each discharge only one digit in the range of 0 – 9, thus, allowed number of 450 (grade 1st
– 0, 2nd
– 5, 3rd
– 4), and 4F5 – not, as the letter F is not included in a set of digits from 0 to 9.
Why should numbers be transferred from one system to another?
In the exercise of tasks on the computer introduction of the initial data and output the results of the calculations are usually performed by the user in the usual decimal notation for it. However, considering that the vast majority of computers use a binary numeral system, it appears the need to transfer numbers from one numeral system to another. Transfer of numbers from q-one to decimal directly comes from the polynomial expression of a particular number. The essence of this transfer is a sequential decimal number and its particular division to the radix`s value of the system q. The division is done until the next quotient is not less than the base q. The calculated residue on the last step is the oldest (first) digit of transferred number. The result of such transfer of the number in the q-one numeral system is a record of the last quotient and all the residues in the reverse order.
Decimal numeral system
The decimal numeral system is the alphabet of digits, which consists of ten well-known numbers, and a base of 10. Digit`s position in number is called discharge. Rank of number increases from right to left, from the junior to the senior ranks. In the decimal system the figure in the extreme right position (rank) represents the number of units; the shifted figures by one position to the left – the number of tens, still left – hundreds, thousands, and then so on. Accordingly, we have the category of units, tens rank, and so on. Can be used the set of positional numeral systems, where the base is equal to or greater than 2. To convert numbers from the decimal to binary
numeral system, use the so-called “replacement algorithm” consisting of the following sequences:
- Divide the decimal number A by 2. The quotient Q is remembered for the next step, and the remainder is written as the least significant bit of a binary number.
- If the quotient Q is not equal to 0, take it for a new dividend and repeat the procedure described in step 1. Each new remainder (0 or 1) is written in bits of the binary number in the direction from the LSB (least significant bit) to the eldest.
- The algorithm continues until get a private Q = 0, and the remainder a = 1 resulting from steps 1 and 2.
Binary numeral system
The binary numeral system is now used in virtually all digital devices. Computers, controllers, and other computing devices make calculations precisely in binary. Digital devices of audio recording and playing back, photo and video store and process the signals in binary notation. The transmission of information via digital communication channels uses a model of the binary system. The system is so named because her radix is two (2) or in a binary system 102 – this means that only two digits “0” and “1” are used for number image. Deuce written down at bottom right from the number, hereinafter will be denote the radix. For the decimal system the radix is usually not indicated. To convert the binary number into a decimal, that number must be written as the radixes` sum of powers` product of the binary system to the corresponding figures in the ranks of the binary number.
Hexadecimal numeral system
The hexadecimal numeral system is the most popular means of recording compact binary digits. It is widely used in the design and development of digital technology. As the name implies, this system`s radix is number 16 or 1016 in the hexadecimal notation. So there was no mess, when writing numbers in positional number systems different from the decimal, to the right at the bottom from the main entry numbers the radix must be specified. The first ten numbers are taken from the decimal system (0, 1, …, 8, 9) and has six letters (a, b, c, d, e, and f) added. In the hexadecimal number 3f7c2 letters “f” and “c” are hex digits. In the end of the hexadecimal number can be accepted the letter h. Thus it is possible to distinguish the hexadecimal numbers from other numbering systems.