How to set up smartphones and PCs. Informational portal
  • home
  • Windows 8
  • Convert to binary. Language understandable to modern technology

Convert to binary. Language understandable to modern technology

08. 06.2018

Blog of Dmitry Vassiyarov.

binary code- where and how is it applied?

Today I am especially glad to meet you, my dear readers, because I feel like a teacher who, at the very first lesson, begins to introduce the class to letters and numbers. And since we live in the world digital technologies, then I will tell you what the binary code is, which is their basis.

Let's start with the terminology and find out what binary means. For clarification, let's return to our usual calculus, which is called "decimal". That is, we use 10 digits, which make it possible to conveniently operate various numbers and keep an appropriate record. Following this logic, the binary system provides for the use of only two characters. In our case, it's just "0" (zero) and "1" one. And here I want to warn you that hypothetically there could be others in their place. conventions, but it is these values, denoting the absence (0, empty) and the presence of a signal (1 or “stick”), that will help us further understand the structure of the binary code.

Why do we need a binary code?

Before the advent of computers, various automatic systems, the principle of operation of which is based on receiving a signal. The sensor is triggered, the circuit closes and turns on specific device. No current in the signal circuit - no operation. It was electronic devices that made it possible to make progress in processing information represented by the presence or absence of voltage in the circuit.

Their further complication led to the emergence of the first processors, which also did their job, already processing a signal consisting of pulses alternating in a certain way. We will not go into the details of the software now, but the following is important for us: electronic devices turned out to be able to distinguish a given sequence of incoming signals. Of course, it is possible to describe the conditional combination in this way: “there is a signal”; "no signal"; "there is a signal"; "there is a signal." You can even simplify the notation: “there is”; "No"; "eat"; "eat".

But it is much easier to indicate the presence of a signal with a unit “1”, and its absence with a zero “0”. Then instead of all this we can use a simple and concise binary code: 1011.

Of course, processor technology has stepped far forward and now chips are able to perceive not just a sequence of signals, but entire programs recorded certain commands, consisting of individual characters. But for their recording, the same binary code is used, consisting of zeros and ones, corresponding to the presence or absence of a signal. Whether he exists or not, it doesn't matter. For a chip, any of these options is a single piece of information, which is called a “bit” (bit is the official unit of measurement).

Conventionally, a character can be encoded by a sequence of several characters. Two signals (or their absence) can describe only four options: 00; 01;10; 11. This encoding method is called two-bit. But it can also be:

  • four-bit (as in the example in the paragraph above 1011) allows you to write 2 ^ 4 = 16 character combinations;
  • eight bits (for example: 0101 0011; 0111 0001). At one time he represented the greatest interest for programming because it covered 2^8 = 256 values. This made it possible to describe all decimal digits, the Latin alphabet and special characters;
  • sixteen-bit (1100 1001 0110 1010) or higher. But records with such a long length are already for modern more challenging tasks. Modern processors use 32 and 64 bit architecture;

To be honest, one official version no, it so happened that it was the combination of eight characters that became the standard measure of stored information, called “bytes”. This could apply even to a single letter written in 8-bit binary code. So, my dear friends, please remember (if anyone did not know):

8 bits = 1 byte.

So accepted. Although a character written as a 2-bit or 32-bit value can also nominally be called a byte. By the way, thanks to the binary code, we can estimate the volume of files measured in bytes and the speed of information transfer and the Internet (bits per second).

Binary encoding in action

To standardize the recording of information for computers, several coding systems have been developed, one of which is ASCII, based on 8-bit recording, has become widespread. The values ​​in it are distributed in a special way:

  • the first 31 characters are control characters (from 00000000 to 00011111). Serve for service commands, output to a printer or screen, sound signals, text formatting;
  • the following from 32 to 127 (00100000 - 01111111) Latin alphabet and auxiliary symbols and punctuation marks;
  • the rest, up to the 255th (10000000 - 11111111) - alternative, part of the table for special tasks and displaying national alphabets;

The interpretation of the values ​​​​in it is shown in the table.

If you think that "0" and "1" are located in a chaotic order, then you are deeply mistaken. Using any number as an example, I will show you a pattern and teach you how to read numbers written in binary code. But for this we will accept some conditions:

  • a byte of 8 characters will be read from right to left;
  • if in ordinary numbers we use the digits of units, tens, hundreds, then here (reading in reverse order) for each bit, different powers of "two" are represented: 256-124-64-32-16-8-4-2-1;
  • now we look at the binary code of a number, for example 00011011. Where there is a “1” signal in the corresponding position, we take the values ​​\u200b\u200bof this bit and sum them up in the usual way. Accordingly: 0+0+0+32+16+0+2+1 = 51. Correct this method you can verify by looking at the code table.

Now, my inquisitive friends, you not only know what a binary code is, but also know how to convert the information encrypted by it.

Language understandable to modern technology

Of course, the algorithm for reading binary code by processor devices is much more complicated. But with its help, you can write anything you want:

  • text information with formatting options;
  • numbers and any operations with them;
  • graphic and video images;
  • sounds, including those that go beyond our hearing;

In addition, due to the simplicity of the “presentation”, it is possible various ways binary information recording: HDD disks;

Complements the benefits binary encoding almost unlimited possibilities for transmitting information over any distance. This is the method of communication used with spaceships and artificial satellites.

So, today, the binary number system is the language that most of us use. electronic devices. And what is most interesting, no other alternative is foreseen for him yet.

I think that the information I have provided will be enough for you to get started. And then, if such a need arises, everyone will be able to delve into independent study this topic. I will say goodbye and after a short break I will prepare for you new article my blog, on some interesting topic.

It's better if you tell me yourself ;)

See you soon.

Everyone knows that computers can perform calculations with large groups data at high speed. But not everyone knows that these actions depend on only two conditions: whether or not there is current and what voltage.

How does a computer manage to process such diverse information?
The secret lies in the binary system. All data enters the computer, presented in the form of units and zeros, each of which corresponds to one state of the electric wire: units - high voltage, zeros - low, or ones - the presence of voltage, zeros - its absence. The conversion of data into zeros and ones is called binary conversion, and their final designation is called binary code.
In decimal notation based on the decimal system used in Everyday life, numerical value represented by ten digits from 0 to 9, and each place in the number has a value ten times higher than the place to its right. To represent a number greater than nine in the decimal system, a zero is put in its place, and a unit is put in the next, more valuable place to the left. Similarly, in binary, where only two digits, 0 and 1, are used, each place is twice as valuable as the place to its right. Thus, in binary code, only zero and one can be represented as single numbers, and any number greater than one requires two places. After zero and one, the next three binary numbers are 10 (read one-zero) and 11 (read one-one) and 100 (read one-zero-zero). 100 binary is equivalent to 4 decimal. The top table on the right shows other BCD equivalents.
Any number can be expressed in binary, it just takes up more space than in decimal notation. In the binary system, you can also write the alphabet, if you assign a certain number to each letter. binary number.

Two digits for four places
16 combinations can be made using dark and light balls, combining them in sets of four. If dark balls are taken as zeros, and light ones as ones, then 16 sets will turn out to be a 16-unit binary code, the numerical value of which is from zero to five ( see top table on page 27). Even with two kinds of balls in binary, you can build an infinite number of combinations by simply increasing the number of balls in each group - or the number of places in the numbers.

Bits and bytes

The smallest unit in computer processing, a bit is a unit of data that can have one of two possible conditions. For example, each of the ones and zeros (on the right) means 1 bit. A bit can be represented in other ways: by the presence or absence of electric current, a hole and its absence, the direction of magnetization to the right or left. Eight bits make up a byte. The 256 possible bytes can represent 256 characters and symbols. Many computers process bytes of data at the same time.

binary conversion. A four-digit binary code can represent decimal numbers from 0 to 15.

Code tables

When binary code is used to represent letters of the alphabet or punctuation marks, code tables, which indicate which code corresponds to which character. Several such codes have been compiled. Most PCs are configured with a seven-digit code called ASCII, or American standard code for information exchange. The table on the right shows ASCII codes for the English alphabet. Other codes are for thousands of characters and alphabets from other languages ​​of the world.

Part of the ASCII code table

Since it is the simplest and meets the requirements:

  • The fewer values ​​there are in the system, the easier it is to make individual elements operating on these values. In particular, the two digits of the binary number system can be easily represented by many physical phenomena: there is current - there is no current, induction magnetic field greater than the threshold value or not, etc.
  • The lower the number of states for an element, the higher the noise immunity and the faster it can work. For example, to encode three states through the value of the magnetic field induction, it will be necessary to enter two threshold values, which will not contribute to the noise immunity and reliability of information storage.
  • Binary arithmetic is pretty simple. Simple are the tables of addition and multiplication - the basic operations on numbers.
  • It is possible to use the device algebra of logic for execution bitwise operations over numbers.

Links

  • Online calculator for converting numbers from one number system to another

Wikimedia Foundation. 2010 .

See what "Binary Code" is in other dictionaries:

    2 Bit Code Gray 00 01 11 10 3 Bit Code Gray 000 001 011 010 110 111 101 100 4 Bit Code Gray 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 Code Graying System of Number in which two adjacent values … … Wikipedia

    Signal Point Code (SPC) signal system 7 (SS7, SS7) is unique (in home network) node address used at the third level of MTP (routing) in telecommunication SS 7 networks for identification ... Wikipedia

    In mathematics, a squareless number is a number that is not divisible by any square other than 1. For example, 10 is squareless, but 18 is not, since 18 is divisible by 9 = 32. The beginning of the sequence of squareless numbers is: 1, 2, 3, 5, 6, 7, ... ... Wikipedia

    Would you like to improve this article?: Wikify the article. Rework the design in accordance with the rules for writing articles. Correct the article according to the stylistic rules of Wikipedia ... Wikipedia

    This term has other meanings, see Python (disambiguation). Python Language class: mu ... Wikipedia

    In the narrow sense of the word, at present, the phrase is understood as "Attack on the security system", and tends rather to the meaning of the following term Cracker attack. This was due to a distortion of the meaning of the word "hacker". Hacker ... ... Wikipedia

binary code- this is a representation of information in a combination of 2 characters 1 or 0, as they say in programming, yes or no, true or false, true or false. It is difficult for an ordinary person to understand how information can be represented in the form of zeros and ones. I will try to clarify this situation a little.

In fact, binary code is easy! For example, any letter of the alphabet can be represented as a set of zeros and ones. For example, a letter H Latin alphabet will have this form in the binary system - 01001000, the letter E– 01000101, beech L has such binary representation – 01001100, P – 01010000.

Now it is not difficult to guess what to write English word HELP on machine language you need to use the following binary code:

01001000 01000101 01001100 01010000

It is this code that ours uses for its work. home computer. To an ordinary person it is very difficult to read such code, but for computers he is the most understandable.

Binary code (machine code) nowadays it is used in programming, because the computer works precisely thanks to the binary code. But do not think that the programming process is reduced to a set of ones and zeros. Specifically, in order to simplify understanding between a person and a computer, programming languages ​​(C++, BASIC, etc.) were invented. The programmer writes a program in a language he understands, and then, with the help of a special compiler program, translates his creation into machine code, which starts the computer.

We translate the natural number of the decimal number system into binary

We take the desired number, for me it will be 5, divide the number by 2:
5: 2 = 2,5 there is a remainder, so the first number of the binary code will be 1 (if not - 0 ). Throw away the remainder and again divide the number by 2 :
2: 2 = 1 the answer is without a remainder, which means that the second number of the binary code will be - 0. Divide the result by 2 again:
1: 2 = 0.5 the number turned out with a remainder, then we write 1 .
Well, since the result is 0 can no longer be divided, the binary code is ready and as a result we got the number of the binary code 101 . I think to translate from decimal number in binary we have learned, now we will learn to do the opposite.

Converting a number from binary to decimal

Here, too, it is quite simple, let's number our binary number with you, you need to start from zero from the end of the number.

101 is 1^2 0^1 1^0.

What came of it? We betrayed degrees to numbers! now according to the formula:

(x * 2^y) + (x * 2^y) + (x * 2^y)

where x- ordinal number of binary code
y- the degree of this number.
The formula will expand depending on the size of your number.
We get:

(1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 4 + 0 + 1 = 5.

History of the binary number system

For the first time binary system suggested by Leibitz, he believed that this system help with difficult mathematical calculations, and in general will benefit science. But according to some reports, before Leibitz proposed a binary number system in China, an inscription appeared on the wall that could be deciphered using a binary code. Long and short sticks were drawn on this inscription, and if we assume that the long one is 1 and the short one is 0, it is quite possible that in China the idea of ​​a binary code went many years before its invention. Although deciphering the code found on the wall revealed a simple natural number there, the fact remains.

Top Related Articles