How to read binary code. Translation of text into digital code. Bits and bytes

Because it is the simplest and meets the requirements:

  • The fewer values ​​there are in the system, the easier it is to manufacture individual elements that operate on these values. In particular, two digits of the binary number system can be easily represented by many physical phenomena: there is a current - there is no current, the magnetic field induction is greater than a threshold value or not, etc.
  • The fewer states an element has, the higher the noise immunity and the faster it can operate. For example, to encode three states through the magnitude of the magnetic field induction, you will need to enter two threshold values, which will not contribute to noise immunity and reliability of information storage.
  • Binary arithmetic is quite simple. Simple are the tables of addition and multiplication - the basic operations with numbers.
  • It is possible to use the apparatus of logical algebra 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 Gray code 00 01 11 10 3-bit Gray code 000 001 011 010 110 111 101 100 4-bit Gray code 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 11 10 1010 1011 1001 1000 Gray code a number system in which two adjacent values ... ... Wikipedia

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

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

    To improve this article, would you like to: Wikify the article. Rework the design in accordance with the rules for writing articles. Correct the article according to Wikipedia stylistic rules... Wikipedia

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

    In the narrow sense of the word, the phrase currently means “Attempt on a security system,” and is more inclined to the meaning of the following term, Cracker attack. This happened due to a distortion of the meaning of the word “hacker” itself. Hacker... ... Wikipedia


Aryabhata
Cyrillic
Greek Georgian
Ethiopian
Jewish
Akshara-sankhya Other Babylonian
Egyptian
Etruscan
Roman
Danube Attic
Kipu
Mayan
Aegean
KPPU symbols Positional , , , , , , , , , , Nega-positional Symmetrical Mixed systems Fibonacci Non-positional Unit (unary)

Binary number system- positional number system with base 2. Thanks to its direct implementation in digital electronic circuits using logic gates, the binary system is used in almost all modern computers and other computing electronic devices.

Binary notation of numbers

In the binary number system, numbers are written using two symbols ( 0 And 1 ). To avoid confusion as to which number system the number is written in, it is provided with an indicator at the bottom right. For example, a number in the decimal system 5 10 , in binary 101 2 . Sometimes a binary number is denoted by a prefix 0b or symbol & (ampersand), For example 0b101 or accordingly &101 .

In the binary number system (as in other number systems except decimal), the digits are read one at a time. For example, the number 101 2 is pronounced “one zero one.”

Integers

A natural number written in binary number system as (a n − 1 a n − 2 … a 1 a 0) 2 (\displaystyle (a_(n-1)a_(n-2)\dots a_(1)a_(0))_(2)), has the meaning:

(a n − 1 a n − 2 … a 1 a 0) 2 = ∑ k = 0 n − 1 a k 2 k , (\displaystyle (a_(n-1)a_(n-2)\dots a_(1)a_( 0))_(2)=\sum _(k=0)^(n-1)a_(k)2^(k),)

Negative numbers

Negative binary numbers are denoted in the same way as decimal numbers: by a “−” sign in front of the number. Namely, a negative integer written in binary number system (− a n − 1 a n − 2 … a 1 a 0) 2 (\displaystyle (-a_(n-1)a_(n-2)\dots a_(1)a_(0))_(2)), has the value:

(− a n − 1 a n − 2 … a 1 a 0) 2 = − ∑ k = 0 n − 1 a k 2 k . (\displaystyle (-a_(n-1)a_(n-2)\dots a_(1)a_(0))_(2)=-\sum _(k=0)^(n-1)a_( k)2^(k).)

additional code.

Fractional numbers

A fractional number written in binary number system as (a n − 1 a n − 2 … a 1 a 0 , a − 1 a − 2 … a − (m − 1) a − m) 2 (\displaystyle (a_(n-1)a_(n-2)\dots a_(1)a_(0),a_(-1)a_(-2)\dots a_(-(m-1))a_(-m))_(2)), has the value:

(a n − 1 a n − 2 … a 1 a 0 , a − 1 a − 2 … a − (m − 1) a − m) 2 = ∑ k = − m n − 1 a k 2 k , (\displaystyle (a_( n-1)a_(n-2)\dots a_(1)a_(0),a_(-1)a_(-2)\dots a_(-(m-1))a_(-m))_( 2)=\sum _(k=-m)^(n-1)a_(k)2^(k),)

Adding, subtracting and multiplying binary numbers

Addition table

An example of column addition (the decimal expression 14 10 + 5 10 = 19 10 in binary looks like 1110 2 + 101 2 = 10011 2):

Example of column multiplication (the decimal expression 14 10 * 5 10 = 70 10 in binary looks like 1110 2 * 101 2 = 1000110 2):

Starting with the number 1, all numbers are multiplied by two. The dot that comes after the 1 is called the binary dot.

Converting binary numbers to decimal

Let's say we're given a binary number 110001 2 . To convert to decimal, write it as a sum by digits as follows:

1 * 2 5 + 1 * 2 4 + 0 * 2 3 + 0 * 2 2 + 0 * 2 1 + 1 * 2 0 = 49

Same thing a little differently:

1 * 32 + 1 * 16 + 0 * 8 + 0 * 4 + 0 * 2 + 1 * 1 = 49

You can write this in table form like this:

512 256 128 64 32 16 8 4 2 1
1 1 0 0 0 1
+32 +16 +0 +0 +0 +1

Move from right to left. Under each binary unit, write its equivalent on the line below. Add the resulting decimal numbers. Thus, the binary number 110001 2 is equivalent to the decimal number 49 10.

Converting fractional binary numbers to decimal

Need to convert the number 1011010,101 2 to the decimal system. Let's write this number as follows:

1 * 2 6 + 0 * 2 5 + 1 * 2 4 + 1 * 2 3 + 0 * 2 2 + 1 * 2 1 + 0 * 2 0 + 1 * 2 −1 + 0 * 2 −2 + 1 * 2 −3 = 90,625

Same thing a little differently:

1 * 64 + 0 * 32 + 1 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 0 * 1 + 1 * 0,5 + 0 * 0,25 + 1 * 0,125 = 90,625

Or according to the table:

64 32 16 8 4 2 1 0.5 0.25 0.125
1 0 1 1 0 1 0 , 1 0 1
+64 +0 +16 +8 +0 +2 +0 +0.5 +0 +0.125

Transformation by Horner's method

In order to convert numbers from binary to decimal system using this method, you need to sum the numbers from left to right, multiplying the previously obtained result by the base of the system (in in this case 2). Horner's method is usually used to convert from binary to decimal system. The reverse operation is difficult, as it requires skills in addition and multiplication in the binary number system.

For example, binary number 1011011 2 converted to decimal system as follows:

0*2 + 1 = 1
1*2 + 0 = 2
2*2 + 1 = 5
5*2 + 1 = 11
11*2 + 0 = 22
22*2 + 1 = 45
45*2 + 1 = 91

That is, in the decimal system this number will be written as 91.

Converting the fractional part of numbers using Horner's method

The digits are taken from the number from right to left and divided by the number system base (2).

For example 0,1101 2

(0 + 1 )/2 = 0,5
(0,5 + 0 )/2 = 0,25
(0,25 + 1 )/2 = 0,625
(0,625 + 1 )/2 = 0,8125

Answer: 0.1101 2 = 0.8125 10

Converting decimal numbers to binary

Let's say we need to convert the number 19 to binary. You can use the following procedure:

19/2 = 9 with remainder 1
9/2 = 4 with remainder 1
4/2 = 2 without remainder 0
2/2 = 1 without remainder 0
1/2 = 0 with remainder 1

So we divide each quotient by 2 and write the remainder at the end of the binary notation. We continue dividing until the quotient is 0. We write the result from right to left. That is, the bottom digit (1) will be the leftmost, etc. As a result, we get the number 19 in binary notation: 10011 .

Converting fractional decimal numbers to binary

If the original number has an integer part, then it is converted separately from the fractional part. Converting a fractional number from the decimal number system to the binary system is carried out using the following algorithm:

  • The fraction is multiplied by the base of the binary number system (2);
  • In the resulting product, the integer part is isolated, which is taken as the most significant digit of the number in the binary number system;
  • The algorithm ends if the fractional part of the resulting product is equal to zero or if the required calculation accuracy is achieved. Otherwise, calculations continue on the fractional part of the product.

Example: You need to convert a fraction decimal number 206,116 to a fractional binary number.

Translation of the whole part gives 206 10 =11001110 2 according to the previously described algorithms. We multiply the fractional part of 0.116 by base 2, entering the integer parts of the product into the decimal places of the desired fractional binary number:

0,116 2 = 0 ,232
0,232 2 = 0 ,464
0,464 2 = 0 ,928
0,928 2 = 1 ,856
0,856 2 = 1 ,712
0,712 2 = 1 ,424
0,424 2 = 0 ,848
0,848 2 = 1 ,696
0,696 2 = 1 ,392
0,392 2 = 0 ,784
etc.

Thus 0.116 10 ≈ 0, 0001110110 2

We get: 206.116 10 ≈ 11001110.0001110110 2

Applications

In digital devices

The binary system is used in digital devices because it is the simplest and meets the requirements:

  • The fewer values ​​there are in the system, the easier it is to manufacture individual elements that operate on these values. In particular, two digits of the binary number system can be easily represented by many physical phenomena: there is a current (the current is greater than the threshold value) - there is no current (the current is less than the threshold value), the magnetic field induction is greater than the threshold value or not (the magnetic field induction is less than the threshold value) etc.
  • The fewer states an element has, the higher the noise immunity and the faster it can operate. For example, to encode three states through the magnitude of voltage, current or magnetic field induction, you will need to introduce two threshold values ​​and two comparators.

IN computer technology Notation of negative binary numbers in two's complement is widely used. For example, the number −5 10 could be written as −101 2 but would be stored as 2 on a 32-bit computer.

In the English system of measures

When indicating linear dimensions in inches, binary fractions are traditionally used rather than decimal, for example: 5¾″, 7 15/16″, 3 11/32″, etc.

Generalizations

The binary number system is a combination of the binary coding system and an exponential weighting function with a base equal to 2. It should be noted that a number can be written in binary code, and the number system may not be binary, but with a different base. Example: BCD encoding, in which decimal digits are written in binary and the number system is decimal.

Story

  • A complete set of 8 trigrams and 64 hexagrams, analogous to 3-bit and 6-bit numerals, was known in ancient China in the classical texts of the Book of Changes. The order of hexagrams in book of changes, arranged in accordance with the values ​​of the corresponding binary digits (from 0 to 63), and the method for obtaining them was developed by the Chinese scientist and philosopher Shao Yong in the 11th century. However, there is no evidence to suggest that Shao Yun understood the rules of binary arithmetic, arranging two-character tuples in lexicographical order.
  • Sets, which are combinations of binary digits, were used by Africans in traditional divination (such as Ifa) along with medieval geomancy.
  • In 1854, English mathematician George Boole published a landmark paper describing algebraic systems as applied to logic, which is now known as Boolean algebra or algebra of logic. His logical calculus was destined to play an important role in the development of modern digital electronic circuits.
  • In 1937, Claude Shannon submitted his Ph.D. thesis for defense. Symbolic analysis of relay and switching circuits in which Boolean algebra and binary arithmetic were used in relation to electronic relays and switches. All modern digital technology is essentially based on Shannon's dissertation.
  • In November 1937, George Stibitz, who later worked at Bell Labs, created the “Model K” computer based on relays. K itchen", the kitchen where the assembly took place), who performed binary addition. In late 1938, Bell Labs launched a research program led by Stiebitz. The computer created under his leadership, completed on January 8, 1940, was able to perform operations with complex numbers. During a demonstration at the American Mathematical Society conference at Dartmouth College on September 11, 1940, Stibitz demonstrated the ability to send commands to a remote complex number calculator by telephone line using a teletype. This was the first attempt to use remote computer via telephone line. Conference participants who witnessed the demonstration included John von Neumann, John Mauchly and Norbert Wiener, who later wrote about it in their memoirs.

see also

Notes

  1. Popova Olga Vladimirovna. Computer Science Textbook (undefined) .

If you're interested in learning how to read binary numbers, it's important to understand how binary numbers work. The binary system is known as a "base 2" numbering system, which means there are two possible numbers for each digit; one or zero. Large numbers are written by adding extra binary ones or zeros.



Understanding Binary Numbers


Knowing how to read binary files is not critical to using computers. But it is good to understand the concept to better understand how computers store numbers in memory. It also allows you to understand terms such as 16-bit, 32-bit, 64-bit and memory measurements such as bytes (8 bits).



"Reading" binary code usually means converting the binary number to the base 10 (decimal) number that people are familiar with. This conversion is fairly easy to do in your head once you understand how a binary language works.

Each digit in a binary number has a specific meaning unless the digit is zero. Once you have determined all of these values, you simply add them together to get the 10-digit decimal value of the binary number. To see how this works, take the binary number 11001010.


1. The best way to read a binary number - start with the rightmost digit and move left. The strength of this first location is zero, that is, the value for this digit, if it is not zero, is equal to two powers of zero or one. In this case, since the digit is zero, the value for that location will be zero.



2. Then move on to the next digit. If it's one, then calculate two to the power of one. Write down this value. In this example, the value is a power of two equal to two.



3. Continue repeating this process until you reach the leftmost number.



4. To finish, all you have to do is add all these numbers together to get the total decimal value of the binary number: 128 + 64 + 0 + 0 + 8 + 0 + 2 + 0 = 202 .


The note: Another way to see this whole process in equation form is this: 1 x 2 7 + 1 x 2 6 + 0 x 2 5 + 0 x 2 4 + 1 x 2 3 + 0 x 2 2 + 1 x 2 1 + 0 x 2 0 = 20.


Binary numbers with signature


The above method works for unsigned basic binary numbers. However, computers need a way to represent negative numbers also using binary code.


Because of this, computers use signed binary numbers. In this type of system, the leftmost digit is known as the sign bit and the remaining digits are known as amplitude bits.


Reading a signed binary number is almost the same as an unsigned one, with one small difference.


1. Follow the same procedure as above for an unsigned binary number, but stop once you reach the leftmost bit.



2. To determine the sign, look at the leftmost bit. If it is one, then the number is negative. If it is zero, then the number is positive.



3. Now do the same calculations as before, but apply the appropriate sign to the number indicated by the leftmost bit: 64 + 0 + 0 + 8 + 0 + 2 + 0 = -74 .


4. The signed binary method allows computers to represent numbers that are positive or negative. However, it consumes the leading bit, meaning that large numbers require slightly more memory than unsigned binary numbers.

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

Binary number system

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

Although the binary system was used in for various purposes in ancient Egypt, China and India, it became the language of electronics and computers modern world. It is the most efficient system for detecting the off (0) and on (1) states of an electrical signal. It is also the basis of binary code to text, which is used on computers to compose data. Even the digital text you are reading now is made up of binary numbers. But you can read this text because we decrypted the binary code translation file using the binary code word.

What is ASCII?

ASCII is a character encoding standard for electronic communications, short for American Standard Code for Information Interchange. In computers, telecommunications equipment, and other devices, ASCII codes represent text. Although many additional characters are supported, most modern circuits character encodings are based on ASCII.

ASCII is the traditional name for the coding system; The Internet Assigned Numbers Authority (IANA) prefers the updated name US-ASCII, which clarifies that the system was developed in the United States and is based on the typographic characters predominantly used. ASCII is one of the highlights of IEEE.

Binary to ASCII

Originally based on the English alphabet, ASCII encodes 128 specified seven-bit integer characters. 95 encoded characters can be printed, including numbers 0 to 9, lower case a to z, capital letters A to Z, and punctuation symbols. In addition, 33 non-printing control codes produced by Teletype machines were included in the original ASCII specification; most of them are now obsolete, although some are still widely used, such as carriage returns, line feeds, and tab codes.

For example, binary number 1101001 = hexadecimal 69 (i is the ninth letter) = decimal number 105 would represent lowercase I in ASCII.

Using ASCII

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

ASCII is important because when computers were developed, they were given a common language.

In 1963, ASCII was first used commercially as a seven-bit teleprinter code for American Telephone & Telegraph's TWX (Teletype Writer eXchange) network. TWX initially used the previous five-bit ITA2, which was also used by the competing Telex teleprinter system. Bob Boehmer introduced features such as the escape sequence. According to Boehmer, his British colleague Hugh MacGregor Ross helped popularize the work - "so much so that the code that became ASCII was first called the Boehmer-Ross Code in Europe." Because of his extensive work on ASCII, Boehmer has been called the "father of ASCII".

Until December 2007, when UTF-8 was superior, ASCII was the most common character encoding in World Wide Web; UTF-8 is backward compatible with ASCII.

UTF-8 (Unicode)

UTF-8 is a character encoding that can be as compact as ASCII, but can also contain any Unicode characters (with some increased file size). UTF is a Unicode conversion format. "8" means representing a character using 8-bit blocks. The number of blocks a character must represent varies from 1 to 4. One of the really nice features of UTF-8 is that it is compatible with null-terminated strings. When encoded, no character will have a nul(0) byte.

Unicode and the Universal Character Set (UCS) ISO/IEC 10646 have a much wider range of characters, and their various encoding forms have begun to rapidly replace ISO/IEC 8859 and ASCII in many situations. Although ASCII is limited to 128 characters, Unicode and UCS support large quantity characters by separating unique identification concepts (using natural numbers, called code points) and encoding (up to UTF-8, UTF-16 and UTF-32-bit binary formats).

Difference between ASCII and UTF-8

ASCII was included as the first 128 characters in the Unicode character set (1991), so 7-bit ASCII characters in both sets have the same numeric codes. This allows UTF-8 to be compatible with 7-bit ASCII, since a UTF-8 file with only ASCII characters is identical to an ASCII file with the same character sequence. More importantly, forward compatibility is ensured because software, which only recognizes 7-bit ASCII characters as special and does not modify the bytes with the highest bit set (as is often done to support 8-bit ASCII extensions such as ISO-8859-1), will preserve UTF-8 data unchanged.

Binary code translator apps

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

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

If the screen uses 16-bit code, each pixel will be given instructions what color to display based on which bits are 0 and 1. This results in over 65,000 colors represented by 2^16. In addition to this, you will find the use of binary number systems in the branch of mathematics known as Boolean algebra.

The values ​​of logic and truth belong to this area of ​​mathematics. In this application, statements are assigned 0 or 1 depending on whether they are true or false. You can try binary to text, decimal to binary, binary to decimal conversion if you are looking for a tool that helps in this application.

The advantage of the binary number system

The binary number system is useful for a number of things. For example, the computer flips switches to add numbers. You can encourage adding a computer by adding binary numbers to the system. There are currently two main reasons for using this computer system Reckoning First, it can ensure the reliability of the safety range. Secondary and most importantly, it helps to minimize necessary diagrams. This reduces space required, energy consumption and costs.

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

(01101001) (01101100011011110111011001100101) (011110010110111101110101) is the decoded message. When you copy and paste these numbers into our binary translator you will get next text in English:

I love you

It means

(01101001) (01101100011011110111011001100101) (011110010110111101110101) = I love you

tables

binary

hexadecimal

Binary code decoding is used to translate from machine language to regular language. Online tools work quickly, although it is not difficult to do it manually.

Binary or binary code is used to transmit information digitally. A set of just two characters, such as 1 and 0, allows you to encrypt any information, be it text, numbers or an image.

How to encrypt with binary code

To manually convert any symbols into binary code, tables are used in which each symbol is assigned a binary code in the form of zeros and ones. The most common encoding system is ASCII, which uses 8-bit code notation.

The basic table shows binary codes for the Latin alphabet, numbers and some symbols.

A binary interpretation of the Cyrillic alphabet and additional characters has been added to the extended table.

To convert from binary code to text or numbers, simply select the desired codes from the tables. But, of course, doing this kind of work manually takes a long time. And mistakes, moreover, are inevitable. The computer copes with decryption much faster. And we don’t even think when typing text on the screen that at that moment the text is being translated into binary code.

Converting a binary number to decimal

To manually convert a number from a binary number system to a decimal number system, you can use a fairly simple algorithm:

  1. Below the binary number, starting with the rightmost digit, write the number 2 in increasing powers.
  2. The powers of 2 are multiplied by the corresponding digit of the binary number (1 or 0).
  3. Add the resulting values.

This is what this algorithm looks like on paper:

Online services for binary decryption

If you still need to see the decrypted binary code, or, conversely, convert the text into binary form, the easiest way is to use online services designed for these purposes.

Two windows, familiar to online translations, allow you to almost simultaneously see both versions of the text in regular and binary form. And decryption is carried out in both directions. Entering text is simple by copying and pasting.