CODING.
Prevalent misconception that the computer - quick calculator. In fact, it is computational in the sense that it operates directly only with numbers. And we already know that these operations do not always boil down to the arithmetic. Numbers - A convenient form of information, the nature of which may be very different from the states of sensors in control systems to communications on natural language familiar to us.
How to present this information using the numbers, what are the most convenient format for the numbers themselves, finally, how to make the processed information usable form - a topic of this chapter. It will address coding (representation of digital information in standard symbolic forms) and decoding, i.e., the reverse is true.
Number systems.
The fact that any information that can be expressed in numbers highlights the problem of encoding the numbers themselves. Notably, this problem is very carefully designed the whole development of our civilization. "All is number," - said by the Pythagoreans, emphasizing hands-on role in a number of human activities. There are many ways of representing numbers. In any case, the number represented by a symbol or group of symbols (words) of an alphabet. We call these symbols in figures, symbolic images of numbers - codes, and regulations for their preparation - number systems (coding).
The simplest and most ancient numeral system uses to record any number of one character. The record length of at such coding is directly related to its size, which makes this method with a geometric representation of numbers in the form of segments. Themselves without realizing it, use this code kids, pointing to his age. Since it is closely related to the code "1 of n". Image number points on the axis, which is widely, used in mathematics, in fact their record in the code "1 of n". Indications switches hours, measuring instruments are determined by the position of the n possible. Pressing the button in the elevator indicates the desired number of floors in the code "1 of n". If the character in the record numbers play a role, depending on its position, the number system with this property are called positional. Of all the positional systems of greatest practical interest are those in which a code number (coding) and the reverse process (decoding) can be described by simple rules, for example, can be reduced to arithmetic operations.
The simplest system of this kind is called weighted. They decoding procedure is as follows: each digit is multiplied by a coefficient (weight) of the position, and all results are added. Weight of individual items usually decreases when the numbers are read from left to right. Left digit number is usually read and pronounce the first, and if it is the "weight", it is already on it is possible to estimate the value of the total. Therefore, the leftmost position of the code number is high, and the extreme right - the youngest.
If set to "origin" - the place from which the characters are written in a simple package, then all the characters except the last one can be omitted. The value of thus determined by the position occupied by a single character in relation to the beginning of the recording. |