Why is binary coding universal? Programming methods

The computer processes a large amount of information. Audio files, pictures, texts - all this must be reproduced or displayed. Why is binary coding a universal method of programming information of any technical equipment?

What is the difference between encryption and encryption?

Often people identify the concepts of "coding" and "encryption" when in fact they have different meanings. So, encryption is the process of converting information in order to conceal it. The person who changed the text, or specially trained people, can often decrypt. Coding is used to process information and simplify working with it. Usually a common encoding table is used that is familiar to everyone. It is built into the computer.

why binary coding is universal

Binary coding principle

Binary coding is based on the use of only two characters - 0 and 1 - to process information used by various devices. These signs were called binary digits, in English - binary digit, or bit. Each of the binary code characters occupies 1 bit of computer memory. Why is binary coding a universal method of processing information? The fact is that it is easier for a computer to process fewer characters. PC productivity also directly depends on this: the less functional tasks the device needs to perform, the higher the speed and quality of work.

programming methods

The principle of binary coding is not only found in programming. By alternating deaf and sonorous drum beats, the inhabitants of Polynesia passed information to each other. A similar principle applies to Morse code, where long and short sounds are used to transmit a message. "Telegraph alphabet" is used today.

Where is binary coding used?

Binary encoding of information in a computer is used everywhere. Each file, be it music or text, must be programmed so that later it can be easily processed and read. The binary coding system is useful for working with symbols and numbers, audio files, graphics.

Binary number coding

Now in computers, numbers are presented in encoded form, incomprehensible to the average person. The use of Arabic numerals as we imagine it is irrational for technology. The reason for this is the need to assign a unique character to each number, which is sometimes impossible to do.

binary number coding

There are two number systems: positional and non-positional. The non-positional system is based on the use of Latin letters and is familiar to us in the form of Greek numbers. This recording method is quite difficult to understand, so they abandoned it.

Positional number system is used today. This includes binary, decimal, octal, and even hexadecimal encoding of information.

We use the decimal coding system in everyday life. These are the Arabic numbers familiar to us , which are understandable to every person. Binary coding of numbers differs using only zero and one.

Integers are translated into a binary coding system by dividing them by 2. The resulting quotients are also phased by 2 until a total of 0 or 1 is obtained. For example, the number 123 10 in a binary system can be represented as 1111011 2 . And the number 20 10 will look like 10100 2 .

The indices 10 and 2 are designated, respectively, decimal and binary number coding system. The binary coding symbol is used to simplify the work with values ​​represented in different number systems.

Decimal programming methods are based on a floating point. In order to correctly translate the value from decimal to binary coding system, use the formula N = M x qp. M is the mantissa (an expression of a number without any order), p is the order of the value of N, and q is the basis of the coding system (in our case 2).

Not all numbers are positive. In order to distinguish between positive and negative numbers, the computer leaves a space of 1 bit for character encoding. Here, zero represents the plus sign, and one represents the minus sign.

Using such a number system makes it easy for a computer to work with numbers. This is why binary coding is universal in computational processes.

binary encoding of information in a computer

Binary Text Encoding

Each character of the alphabet is encoded by its own set of zeros and ones. The text consists of different characters: letters (uppercase and lowercase), arithmetic characters and other various meanings. Encoding textual information requires the use of 8 consecutive binary values ​​from 00000000 to 11111111. In this way, 256 different characters can be converted.

To avoid confusion in the text encoding, special value tables are used for each character. They have the Latin alphabet, arithmetic signs and special signs (for example, €, ¥, © and others). Gap characters 128-255 encode the country's national alphabet.

To encode 1 character, 8 bits of memory are required. To simplify the sub-accounts, 8 bits are equal to 1 byte, so the total disk space for text information is measured in bytes.

binary coding principle

Most PCs are equipped with the American Standard Code for Information Interchange ( ASCII ). Other tables are also used in which the text encoding system is different. For example, the first known character encoding is called KOI-8 (an 8-bit information exchange code), and it works on computers running UNIX. The CP1251 code table, which was created for the Windows operating system, is also widely found.

Binary Sound Encoding

Another reason why binary coding is a universal method of programming information is its simplicity when working with audio files. Any music is sound waves of different amplitude and frequency of oscillation. The sound volume and its pitch depend on these parameters.

To program a sound wave, the computer divides it conditionally into several parts, or "samples". The number of such samples can be large, so there are 65,536 different combinations of zeros and ones. Accordingly, modern computers are equipped with 16-bit sound cards, which means using 16 binary digits to encode one sample of the sound wave.

To play an audio file, the computer processes the programmed binary code sequences and combines them into one continuous wave.

binary encoding character

Graphics coding

Graphic information can be presented in the form of drawings, diagrams, pictures or slides in PowerPoint. Any picture consists of small dots - pixels, which can be painted in different colors. The color of each pixel is encoded and saved, and as a result we get a full-fledged image.

If the picture is black and white, the code for each pixel can be either one or zero. If 4 colors are used, the code of each of them consists of two digits: 00, 01, 10 or 11. By this principle, the quality of processing of any image is distinguished. Increasing or decreasing the brightness also affects the number of colors used. In the best case, the computer distinguishes about 16,777,216 shades.

binary encoding character

Conclusion

There are various methods of programming information, among which binary coding is the most efficient. With just two characters - 1 and 0 - the computer reads most files easily. At the same time, the processing speed is much higher than, for example, a decimal programming system would be used. The simplicity of this method makes it indispensable for any technique. This is why binary coding is universal among its peers.

Source: https://habr.com/ru/post/K20863/


All Articles