How to set up smartphones and PCs. Informational portal
  • home
  • Security
  • Converting binary code to text. We translate the natural number of the decimal number system into binary

Converting binary code to text. We translate the natural number of the decimal number system into binary

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 apparatus of the algebra of logic to perform bitwise operations on 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

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 a binary conversion, and their final designation is called a 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, the alphabet can also be written if a certain binary number is assigned to each letter.

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 a binary code is used to denote letters of the alphabet or punctuation marks, code tables are required that 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

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 the Latin alphabet will look like this 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 we have learned to translate from decimal to binary, 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, the binary system was proposed 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.

08. 06.2018

Blog of Dmitry Vassiyarov.

Binary code - where and how is it used?

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 we can use a simple and concise binary code instead of all this: 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 the decimal digits, 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 the example of any number, 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;

Complementing the advantages of binary coding are 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.

Binary code is text, computer processor instructions, or other data using any two-character system. Most often, this is a system of 0s and 1s. It assigns a pattern of binary digits (bits) to each character and instruction. For example, a binary string of eight bits can represent any of the 256 possible values and therefore can generate a set various elements. Reviews of the binary code of the world professional community of programmers indicate that this is the basis of the profession and the main law of functioning computing systems and electronic devices.

Binary code decryption

In computing and telecommunications, binary codes are used to various methods encoding data characters into bit strings. These methods can use fixed or variable width strings. There are many sets of characters and encodings for converting to binary code. In code with fixed width each letter, digit, or other character is represented by a bit string of the same length. This bit string, interpreted as a binary number, is usually mapped to code tables in octal, decimal, or hexadecimal notation.

Decryption binary code: a bit string interpreted as a binary number can be translated into decimal number. For example, lower case the letter a, if represented by the bit string 01100001 (as in the standard ASCII code), can also be represented as the decimal number 97. Converting binary to text is the same procedure, only in reverse order.

How it works

What is a binary code made of? Code used in digital computers, based on in which there are only two possible states: on. and off, usually denoted by zero and one. Whereas in the decimal system, which uses 10 digits, each position is a multiple of 10 (100, 1000, etc.), then in the binary system, each digit position is a multiple of 2 (4, 8, 16, etc.). A binary code signal is a series of electrical impulses that represent numbers, symbols, and operations to be performed.

A device called a clock sends out regular pulses, and components such as transistors turn on (1) or turn off (0) to transmit or block the pulses. In binary, each decimal number (0-9) is represented by a set of four binary digits or bits. The four basic arithmetic operations (addition, subtraction, multiplication, and division) can be reduced to combinations of fundamental Boolean algebraic operations on binary numbers.

A bit in communication and information theory is a unit of data equivalent to the result of a choice between two possible alternatives in the binary number system commonly used in digital computers.

Binary code reviews

The nature of code and data is a basic part of the fundamental world of IT. Specialists of the world IT “behind the scenes” work with this tool - programmers whose specialization is hidden from the attention of an ordinary user. Feedback on binary code from developers indicates that this area requires a deep study of the mathematical foundations and a lot of practice in the field of math analysis and programming.

The binary code is simplest form computer code or programming data. It is fully represented by the binary system of numbers. According to reviews of binary code, it is often associated with machine code, since binary sets can be combined to form source code, which is interpreted by the computer or other hardware. This is partly true. uses sets of binary digits to form instructions.

Along with the most basic form of code binary file also represents the smallest amount of data that flows through all complex complex hardware and software systems that handle today's resources and data assets. The smallest amount of data is called a bit. current lines bits become code or data that is interpreted by the computer.

binary number

In mathematics and digital electronics, a binary number is a number expressed in the base-2 or binary number system. digital system, which uses only two characters: 0 (zero) and 1 (one).

The base-2 number system is a positional notation with a radius of 2. Each digit is referred to as a bit. Due to its simple implementation in digital electronic circuits using logical rules, the binary system is used by almost all modern computers and electronic devices.

History

The modern binary number system as the basis for the binary code was invented by Gottfried Leibniz in 1679 and presented in his article "Binary Arithmetic Explained". Binary numerals were central to Leibniz's theology. He believed that binary numbers symbolize the Christian idea of ​​creativity ex nihilo, or creation from nothing. Leibniz was trying to find a system that would transform the verbal statements of logic into purely mathematical data.

Binary systems predating Leibniz also existed in ancient world. An example is the Chinese binary system I Ching, where the text for divination is based on the duality of yin and yang. In Asia and Africa, slit drums with binary tones were used to encode messages. The Indian scholar Pingala (circa 5th century BC) developed a binary system for describing prosody in his work Chandashutrema.

The inhabitants of Mangareva Island in French Polynesia used a hybrid binary-decimal system until 1450. In the 11th century, the scientist and philosopher Shao Yong developed a method for organizing hexagrams that corresponds to a sequence from 0 to 63, as represented in binary format, with yin being 0 and yang being 1. The order is also the lexicographic order in blocks of elements selected from a two-element set.

new time

In 1605 he discussed a system in which the letters of the alphabet could be reduced to sequences of binary digits, which could then be encoded as subtle font variations in any random text. It is important to note that it was Francis Bacon who supplemented the general theory binary coding the observation that this method can be used with any object.

Another mathematician and philosopher named George Boole published an article in 1847 entitled " Mathematical analysis logic, which describes the algebraic system of logic known today as boolean algebra. The system was based on a binary approach, which consisted of three basic operations: AND, OR and NOT. This system was not put into use until an MIT graduate student named Claude Shannon noticed that the Boolean algebra he had learned was like an electrical circuit.

Shannon wrote a dissertation in 1937 that drew important conclusions. Shannon's thesis became the starting point for the use of binary code in practical applications such as computers and electrical circuits.

Other forms of binary code

The bit string is not the only type of binary code. Binary system in general is any system that allows only two options, such as a switch in electronic system or a simple true or false test.

Braille is a type of binary code widely used by blind people to read and write by touch, named after its creator, Louis Braille. This system consists of grids of six points each, three per column, in which each point has two states: raised or recessed. Various combinations dots are capable of representing all letters, numbers and punctuation marks.

The American Standard Code for Information Interchange (ASCII) uses a 7-bit binary code to represent text and other characters in computers, communications equipment, and other devices. Each letter or symbol is assigned a number from 0 to 127.

Binary coded decimal or BCD is a binary coded representation of integer values ​​that uses a 4-bit graph to encode decimal digits. Four binary bits can encode up to 16 different values.

In BCD-encoded numbers, only the first ten values ​​in each nibble are valid and encode decimal digits with zero through nine. The remaining six values ​​are invalid and may cause either a native exception or unspecified behavior, depending on computer implementation BCD arithmetic.

BCD arithmetic is sometimes preferred number formats floating point in commercial and financial applications, where complex number rounding behavior is undesirable.

Application

Majority modern computers use a binary code program for instructions and data. CDs, DVDs and Blu-ray discs represent sound and video in binary form. Phone calls transferred to digital form in intercity and mobile networks telephone communication using pulse code modulation and in voice over IP networks.

Top Related Articles