Menu
Is free
check in
the main  /  Advice / How to encrypt the phrase in binary code. Binary code in text

How to encrypt the phrase in binary code. Binary code in text

Binary code is the form of information recording in the form of units and zeros. This is a positional with the base 2. To date, the binary code (the table presented slightly below contains some examples of the number of numbers) is used in all digital devices without exception. Its popularity is explained by high reliability and simplicity of this form of recording. Binary arithmetic is quite simple, respectively, it is easy to implement on the hardware level. Components (or as they are also called - logical) very reliable, as they operate in the work of only two states: a logical unit (there is a current) and a logical zero (no current). Thus, they are beneficial to the analog components, the work of which is based on transition processes.

How is the binary form of the record?

Let's figure it out how such a key is formed. One discharge of the binary code may contain only two states: zero and unit (0 and 1). When using two digits, it is possible to write four values: 00, 01, 10, 11. Three-digit recording contains eight states: 000, 001 ... 110, 111. As a result, we obtain that the length of the binary code depends on the number of discharges. This expression can be written using the following formula: n \u003d 2m, where: M is the number of discharges, and N is the number of combinations.

Types of binary codes

In microprocessors, such keys are used to record a variety of information being processed. The discharge of the binary code can significantly exceed its internal memory. In such cases, long numbers occupy several cells of the storage device and are processed using multiple commands. At the same time, all memory sectors that are highlighted for multibyte binary code are considered as one number.

Depending on the need to provide this or that information, distinguish the following types of keys:

  • unsigned;
  • direct bitter codes;
  • iconic reverse;
  • iconic additional;
  • gray code;
  • gray-Express code;
  • fractional codes.

Consider in more detail each of them.

Safety binary code

Let's figure out what is the type of record. In whole unsigned codes, each digit (binary) represents the degree of two digits. In this case, the smallest number that can be written in this form is zero, and the maximum can be represented by the following formula: M \u003d 2 P -1. These two numbers fully define the key range that can be expressed by such a binary code. Let's consider the possibility of the mentioned form of recording. When using this type of an unsigned key consisting of eight digits, the range of possible numbers will be from 0 to 255. The sixteen digit code will have a range from 0 to 65535. In eight-bit processors, two sectors of memory are used in the neighboring addresses. . Work with such keys provide special teams.

Direct whole iconic codes

In this form, binary keys Senior discharge is used to record the sign of the number. Zero corresponds to the plus, and the unit is minus. As a result of the introduction of this discharge, the range of encoded numbers is shifted to negative side. It turns out that an eight-bit out of a whole binary key can record numbers in the range from -127 to +127. Sixteen digit - ranging from -32767 to +32767. In eight-bit microprocessors, two adjacent sectors use for storing such codes.

The disadvantage of such a form of recording is that the iconic and digital discharges of the key must be processed separately. Algorithms of programs working with these codes are obtained very complex. To change and allocate iconic discharges, it is necessary to apply the mechanisms for masking this symbol, which contributes to the sharp increase in the size of the software and reduce its speed. In order to eliminate this shortage was introduced the new kind The key is the reverse binary code.

Sannaya reverse key

This form of recording is different from direct codes only by the fact that the negative number in it is obtained by inverting all the discharges of the key. At the same time, digital and iconic discharges are identical. Due to this, the work algorithms with such a type of codes are significantly simplified. However, the return key requires a special algorithm for recognizing the symbol of the first discharge, calculating the absolute value of the number. As well as restore the sign of the resultant value. Moreover, two keys use two keys in reverse and direct codes. Despite the fact that this value does not have a positive or negative sign.

Sannaya Additional Binary Number Code

This type of record has no listed shortcomings of previous keys. Such codes allow direct summing of both positive and negative numbers. It does not analyze the iconic discharge. All this became possible due to the fact that additional numbers are a natural ring of characters, not artificial formations, such as direct and inverse keys. Moreover, an important factor is that the calculations of additions in binary codes is extremely simple. For this, it is enough to add a single key to the reverse key. When using this type of iconic code, consisting of eight digits, the range of possible numbers will be from -128 to +127. The sixteen digit key will have a range from -32768 to +32767. In eight-bit processors, two neighboring sectors also use the storage processors.

Binary additional code is interesting to the observed effect, which is called the phenomenon of the distribution of the sign. Let's figure it out what it means. This effect lies in the fact that in the process of conversion of a single-byte value to a double-litter, a single bit of the older byte, assign values \u200b\u200bof the icing bits of the younger byte. It turns out that for storage of the icon you can use the older bits. In this case, the key value does not change completely.

Gray code

This form of recording is essentially a one-step key. That is, during the transition from one value to another, only one bit of information changes. In this case, the error in reading data leads to the transition from one position to another with a minor displacement over time. However, obtaining a completely incorrect result of the angular position with this process is completely excluded. The advantage of such code is its ability to mirrorize information. For example, inverting senior bits, you can simply change the reference direction. This is due to the Complegment control. In this case, an output value can be both increasing and falling down at one physical direction of the axis rotation. Since the information recorded in the Gray key has an exceptionally encoded character, which does not carry real numeric data, then before further work, it is necessary to pre-convert it to a regular binary form of recording. This is done using a special converter - Gray Binar decoder. This device Easily implemented on elementary logical elements of both hardware and software method.

Ice Express Code

The standard hedge of Gray is suitable for solutions that are presented in the form of numbers, two. In cases where you need to implement other solutions, only the average plot is cut out of this form. As a result, the key one-step is preserved. However, in such code the beginning of the numeric range is not zero. It shifts to a given value. In the process of processing data from generated pulses, half the difference between the initial and reduced resolution take place.

Representation of a fractional number in a binary key with a fixed comma

In the process of work, it is necessary to operate not only by the integers, but also fractional. Such numbers can be recorded using direct, reverse and additional codes. The principle of constructing the mentioned keys is the same as in the whole. Until now, we believed that the binary comma should be to the right of the younger category. But it is not. It can be placed on the left of the older discharge (in this case, as a variable, it is possible to record exclusively fractional numbers), and in the middle of the variable (mixed values \u200b\u200bcan be recorded).

Pose of a binary floating point code

This form is used to write or vice versa - very small. As an example, interstellar distances or dimensions of atoms and electrons can be brought. When calculating such values \u200b\u200bwould have to use binary code with very large bit. However, we do not need to take into account the space distance with an accuracy of a millimeter. Therefore, the form of recording with a fixed comma in this case is ineffective. An algebraic form is used to display such codes. That is, the number is written as a mantissa, multiplied by ten to the degree displaying the desired order of the number. It should be known that Mantissa should not be more united, and after the comma should not be written to zero.

It is believed that binary calculus was invented at the beginning of the 18th century by mathematician from Germany by Gottfried Leibnic. However, as scientists recently opened, long to the Polynesian Isle of Mangarev used this type of arithmetic. Despite the fact that the colonization almost completely destroyed the original calculus systems, scientists restored complex binary and decimal bills. In addition, the scientist Cognivist Nunies argues that the coding of binary code was used in ancient China back in the 9th century BC. e. Other ancient civilizations, for example, Maya Indians, also used complex combinations of decimal and binary systems to track time intervals and astronomical phenomena.

I decided to make such a back as a text transformation into binary code and back, there are such services, but they usually work with Latin, my the translator works with UTF-8 format Unicode encodingwhich encodes Cyrillic characters with two bytes. On this moment The ability of the translator is limited to two-byte encodings. Chinese hieroglyphs can not be broadcast, but I'm going to fix this annoying misunderstanding.

To convert text to binary representation Enter the text to the left window and click Text-\u003e BIN in the right window it will appear its binary representation.

To convert binary code to text Enter the code into the right window and press BIN-\u003e TEXT in the left window will appear its symbolic representation.

If binary code translation to text Or, on the contrary, it did not work out - check the correctness of your data!

Update!

Now the inverse text conversion of the type is available:

in a normal look. To do this, put a tick: "Replace 0 spaces, and 1 aggregate █." Then insert the text into the right window: "text in binary representation" and click the button below "bin-\u003e text".

When copying such texts, you need to be careful because You can easily lose the gaps at the beginning or at the end. For example, a string from above has the form:

██ █ █ ███████ █ ██ ██ █ █ ███ ██ █ █ ██ █ ██ █ █ ██ █ ███ █ ██ █ █ ██ █ █ ███ ██ █ █ ███ ██ █ ██

and on a red background:

██ █ █ ███████ █ ██ ██ █ █ ███ ██ █ █ ██ █ ██ █ █ ██ █ ███ █ ██ █ █ ██ █ █ ███ ██ █ █ ███ ██ █ ██

see how many spaces at the end can be lost?

Computers do not understand words and numbers as people do. Modern software Allows the end user to ignore it, but at the lowest levels your computer operates a binary electrical signal that it has only two states: There is current or current. To "understand" complex data, your computer must encode them in binary format.

The binary system is based on two numbers - 1 and 0, corresponding to the states of turning on and off, which your computer can understand. You are probably familiar with the decimal system. It uses ten digits - from 0 to 9, and then proceeds to the next order to form double-digit numbers, with the number of each of the following orders of ten times more than the previous one. The binary system is similar, each digit twice as much as the previous one.

Counting in binary format

In binary terms, the first digit is equal to 1 out of the decimal system. The second digit is 2, the third - 4, the fourth - 8, and so on - doubles every time. Adding all these values \u200b\u200bwill give you a number in decimal format.

1111 (in binary format) \u003d 8 + 4 + 2 + 1 \u003d 15 (in decimal system)

Accounting 0 gives us 16 possible values \u200b\u200bfor four binary bits. Move 8 bits, and you will receive 256 possible values. It takes a lot more space for presentation, since four digits in decimal form give us 10,000 possible values. Of course, the binary code takes more space, but computers understand binary files much better than the decimal system. And for some things, such as logic processing, binary code is better than decimal.

It should be said that there is another basic system that is used in programming: hexadecimal. Although computers do not work in hexadecimal format, programmers use it to represent binary addresses in a readable format when writing code. This is due to the fact that the two numbers of a hexadecimal number can be a whole byte, that is, they replace eight digits in binary format. The hexadecimal system uses the numbers 0-9, as well as the letters from A to F to get additional six digits.

Why computers use binary files

Short answer: hardware and the laws of physics. Each character in your computer is an electrical signal, and in the first days of calculations, the electrical signals were much more complicated. It was more reasonable to distinguish only the "included" state represented by a negative charge, and the "off" state represented by a positive charge.

For those who do not know why "off" is represented by a positive charge, this is due to the fact that electrons have a negative charge, and more electrons - more current with a negative charge.

Thus, the early computers with the size of the room used binary files To create their systems, and although they used the older, more cumbersome equipment, they worked on the same fundamental principles. Modern computers use so-called transistor To perform calculations with binary code.

Here is a scheme of a typical transistor:

In fact, it allows current to flow from the source to the drain if there is a current in the gate. It forms a binary key. Manufacturers can create these transistors incredibly small - up to 5 nanometers or two DNA threads size. This is how modern processors work, and even they may suffer from problems with distinguishing on and off state (although it is associated with their unreal molecular size subject to stranges quantum mechanics).

Why only binary system

Therefore, you might think: "Why is only 0 and 1? Why not add another digit? ". Although it is partly due to the traditions of creating computers, at the same time, adding another number would mean the need to highlight another state of the current, and not just "turned off" or "included".

The problem here is that if you want to use several voltage levels, you need a way to easily perform calculations with them, and modern hardware capable of this is not viable as a replacement of binary computing. For example, there is so-called triple computer, Designed in the 1950s, but the development on that has stopped. Terrinary logic More efficient than binary, but not yet effective replacement of the binary transistor or at least there is no transistor as tiny scales as binary.

The reason why we cannot use triple logic is reduced to how the transistors are connected in the computer and how they are used for mathematical calculations. The transistor receives information into two inputs, performs the operation and returns the result by one output.

Thus, binary mathematics is easier for a computer than anything else. Binary logic is easily converted to binary systems, and True and False correspond to the states on and off.

Binary truth table operating on binary logic will have four possible outputs for each fundamental operation. But, since the triple gate use three inputs, the triple truth table would have 9 or more. While the binary system has 16 possible operators (2 ^ 2 ^ 2), the Tropro system would have 19683 (3 ^ 3 ^ 3). Scaling becomes a problem, because, although the trocher is more efficient, it is also exponentially more complex.

Who knows? In the future, we may well see triple computers, since binary logic faced miniaturization problems. In the meantime, the world will continue to work in binary mode.

08. 06.2018

Dmitry Vasiairova Blog.

Binary code - where and how is it used?

Today, I am very pleased with my meeting with you, my dear readers, because I feel like a teacher who is at the very first lesson begins to acquaint class with letters and numbers. And since we live in the world digital technologyI'll tell you what binary code is their basis.

Let's start with terminology and find out what binary means. For the explanation will return to the usual calculation, which is called "decimal". That is, we use 10 digits, which make it possible to conveniently operate in various numbers and maintain the appropriate entry.

Following this logic, the binary system provides only two characters. In our case, it is just "0" (zero) and "1" one. And here I want to warn you that there could be other hypothetically in their place legendBut it is precisely such values \u200b\u200bthat denote the absence (0, empty) and the presence of a signal (1 or "wand") will help us further understand the structure of the binary code.

Why do you need a binary code?

Before the appearance of the computer, various automatic systemsThe principle of operation of which is based on the receipt of the signal. The sensor is triggered, the circuit closes and the device is turned on. There is no current in the signal circuit - no and triggering. It was the electronic devices that made it possible to achieve progress in processing information provided by the presence or absence of voltage in the chain.

Further complications led to the emergence of the first processors, which also performed their work, processing the signal consisting of pulses alternating in a certain way. We will not delve into the program details now, but the following is important for us: electronic devices were able to distinguish specified sequence incoming signals. Of course, you can and so describe the conditional combination: "There is a signal"; "no signal"; "There is a signal"; "There is a signal." You can even simplify the recording: "there"; "not"; "there is"; "there is".

But much easier to designate the presence of a signal by the unit "1", and its absence is zero "0". Then, instead of all this we can use a simple and laconic binary code: 1011.

Of course, the processor technique stepped far ahead and now the chips are able to perceive not just a sequence of signals, but entire programs recorded by certain commands consisting of individual characters.

But for their record, the same binary code consisting of zeros and units corresponding to the presence or absence of a signal is used. He is, or there is no it - no difference. For a chip, any of these options is a single piece of information that received the name "bit" (Bit is the official unit of measurement).

Conditionally, the symbol can be encoded by a sequence of several characters. Two signals (or their absence) can be described only four options: 00; 01; 10; 11. This method of coding is called two-bit. But he may be:

  • Four-bit (as in the example on the paragraph above 1011) allows you to write 2 ^ 4 \u003d 16 symbol combinations;
  • Octime (for example: 0101 0011; 0111 0001). At the same time, he represented the greatest interest for programming, since it covered 2 ^ 8 \u003d 256 values. It made it possible to describe all decimal numbers, Latin alphabet and special signs;
  • Sixteenbitant (1100 1001 0110 1010) and above. But entries with such a long - this is already for modern more complex tasks. Modern processors use 32 and 64-bit architecture;

I will say honestly, one official version No, it so happened that it was the combination of eight characters that became a standard measure of the stored information called "byte". This could even be applied to one letter recorded by an 8-bit binary code. So, my dear friends, please remember (if anyone did not know):

8 bits \u003d 1 byte.

So accepted. Although the symbol recorded by 2 or 32-bit values \u200b\u200bcan also be called byte. By the way, thanks to binary code, we can evaluate the volumes of files that are measured in bytes and the speed of information and the Internet (bits per second).

Binary encoding in action

To standardize information recording for computers, several encoding systems were developed, one of which ASCII, based on an 8-bit record, was widespread. Values \u200b\u200bin it are distributed in a special way:

  • the first 31 symbol - managers (from 00000000 to 00011111). Serve for service commands, output to the printer or screen, sound signals, text formatting;
  • 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 mapping of national alphabets;

Decoding values \u200b\u200bin it is shown in the table.

If you think that "0" and "1" are located in a chaotic order, then deeply mistaken. On the example of any number, I will show you regularity and teach read numbers recorded by binary code. But for this we will take some conventions:

  • Byte from 8 characters will read on the right left;
  • If we use the discharges of units, dozens, hundreds, then here (reading in the reverse order) for each bit, various degrees of "twos" are presented: 256-124-64-32-16-8- 4-2-1;
  • Now we look at the binary code of the number, for example, 00011011. Where in the appropriate position there is a "1" signal - take the value of this discharge and summarize them with the usual way. Accordingly: 0 + 0 + 0 + 32 + 16 + 0 + 2 + 1 \u003d 51. In the correctness this method You can make sure to look at the table of the codes.

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

Language understandable modern technique

Of course, the algorithm for reading a binary code with processor devices is much more complicated. But it can be written by all anything:

  • Text information with formatting parameters;
  • Numbers and any operations with them;
  • Graphic and video images;
  • Sounds, including overcoming and beyond our audibility;

In addition, due to the simplicity of "presentation" is possible various methods Records of binary information:

  • By change magnetic field on the ;
  • Completes the advantages of binary coding almost unlimited possibilities for transferring information to any distances. This method of communication is used with spacecraft and artificial satellites.

    So, today the binary number system is the language, the most used most used by us electronic devices. And what is the most interesting, no other alternative for him is foreseen.

    I think that the information stated by me to start you will be quite enough. And then if such a need arises, everyone can deepen in independent study This topic.

    I will say goodbye and after a small break, I will prepare for you a new article of my blog, on some interesting topic.

    Better if you yourself tell me;)

    See you soon.

    Binary translator is a tool for translating a binary code to text for reading or printing. You can translate a binary file into English using two methods; ASCII and Unicode.

    Binary number system

    The system of the binary decoder is based on the number 2 (base). It consists only of two numbers as a Base-2: 0 and 1 number system.

    Although the binary system was used for various purposes in ancient Egypt, China and India, it became the language of electronics and computers of the modern world. This is the most efficient system for detecting off (0) and the included (1) state of the electrical signal. It is also the basis of the binary code into the text that is used on computers to make data. Even the digital text you read now consists of binary numbers. But you can read this text because we have deciphered binary code translation file using a binary word code.

    What is ASCII?

    ASCII is the symbol encoding standard for electronic communications, abbreviated from the American standard code for sharing information. In computers, telecommunication equipment and other devices, the ASCII codes are text. Although many additional characters are supported, most modern schemes Symbols encoding are based on ASCII.

    ASCII is a traditional name for the coding system; The Office of Numbers on the Internet (IANA) prefers the updated Name of the US-ASCII, which explains that this system was developed in the United States and is based on predominantly used typographical symbols. ASCII is one of the main moments of IEEE.

    Binary in ASCII.

    Initially based on English alphabet, ASCII encodes 128 seven-bit integer symbols. You can print 95 encoded characters, including numbers from 0 to 9, lowercase letters from a to z, uppercase letters from a to z and punctuation symbols. In addition, 33 non-promotional control code obtained using TELETYPE machines were included in the ASCII source specification; Most of them are currently outdated, although some are still widely used, such as the return carriage, the translation of the string and tab codes.

    For example, a binary number 1101001 \u003d hexadecimal 69 (I - ninth letter) \u003d decimal number 105 will represent lowercase I in ASCII encoding.

    Using ASCII

    As mentioned above, using ASCII, you can translate computer text into human text. Simply put, this is a translator with binary into English. All computers receive messages in binary, 0 and 1 series. However, just as English and Spanish can use the same alphabet, but for many similar words they have completely different words, computers also have their own language version. ASCII is used as a method that allows all computers to share documents and files in one language.

    ASCII is important because when developing computers a common language was given.

    In 1963, ASCII was first commercially used as a seven-bit teleprinter code for the TWX network (Teletype Writer Exchange) American Telephone & Telegraph. Initially, TWX used the previous five-bed ITA2, which also used the TELEX competing teleprin system. Bob Bemer presented functions as a sequence of escape. According to Bemera, his British colleague Hugh McGregor Ross helped to popularize this work - "So that the code that the ASCII has become was named the Code of Bemera Ross in Europe." Because of his extensive work ASCII, Bemar was named "Father ASCII".

    Until December 2007, when the UTF-8 encoding exceeded it, the ASCII was the most common encoding of symbols in World Wide Web; UTF-8 is compatible with ASCII.

    UTF-8 (Unicode)

    UTF-8 is encoding characters that can be the same compact as ASCII, but may also contain any symbols of Unicode (with some increasing file size). UTF is the Unicode conversion format. "8" means a symbol representation using 8-bit blocks. The number of blocks to represent the character varies from 1 to 4. One of the truly pleasant features of UTF-8 is that it is compatible with rows with a zero symbol at the end. When coding, no symbol will have a NUL (0) byte.

    Unicode and universal symbol set (UCS) ISO / IEC 10646 have a much wider range of characters, and their various coding forms began to quickly replace ISO / IEC 8859 and ASCII in many situations. Although ASCII is limited to 128 characters, Unicode and UCS support more characters by separating unique identification concepts (using natural numbers called codepoints) and coding (up to binary formats UTF-8, UTF-16 and UTF-32-bit).) .

    The difference between ASCII and UTF-8

    ASCII was enabled as the first 128 characters in the Unicode symbol set (1991), therefore 7-bit ASCII characters in both sets have the same numeric codes. This allows UTF-8 to be compatible with 7-bit ASCII, since the UTF-8 file with only ASCII characters is identical to the ASCII file with the same symbol sequence. More importantly, direct compatibility is ensured, since the software that recognizes only 7-bit ASCII characters as special and does not change bytes with the highest bit set (as often is made to support 8-bit ASCII extensions, such as ISO-8859 -1), will save unchanged data UTF-8.

    Binary Code Translator Applications

    The most common application for this number system can be seen in computer technologies. In the end, the basis of the entire computer language and programming is the two-digit number system used in digital coding.

    This is what constitutes the digital encoding process, taking data and then depicting them with limited information bits. Limited information consists of zeros and units binary system. Images on your computer screen are an example of this. To encode these images, a binary string is used for each pixel.

    If the screen uses 16-bit code, each pixel will be given instructions, which color is displayed on the basis of which bits are 0 and 1. The result is more than 65,000 colors presented 2 ^ 16. In addition to this, you will find the use of binary Numbers in the mathematical branch, known as Boulev algebra.

    Values \u200b\u200bof logic and truth belong to this field of mathematics. In this application, applications are assigned 0 or 1 depending on whether they are true or false. You can try converting binary to text, decimal in binary, binary in decimal conversion if you are looking for a tool that helps in this application.

    Advantage of binary number system

    The system of binary numbers is useful for a number of things. For example, the computer clicks the switches to add numbers. You can stimulate the addition of a computer by adding binary numbers into the system. Currently there are two main reasons for using this computer system Note. First, it can ensure the reliability of the security range. Secondly and most importantly, it helps minimize the necessary schemes. This reduces the necessary space consumed energy and expenses.

    You can encode or translate binary messages written by binary numbers. For example,

    (01101001) (01101100011011110110110111101101) (0111101101010110110110101) is a decoded message. When you copy and insert these numbers into our binary translator, you will receive the following text in English:

    I love you

    It means

    (01101001) (01101100011011110110110111011011011101101010110110110101) \u003d I love you

    tables

    binary

    hexadecimal