How to set up smartphones and PCs. Informational portal

Convert number to binary. Encoding text information

Since it is the most simple and meets the requirements:

  • The fewer values ​​exist in the system, the easier it is to manufacture individual elements operating with 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 the threshold value or not, etc.
  • The fewer the number of states an element has, the higher the noise immunity and the faster it can work. 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 pretty straightforward. The tables of addition and multiplication, the basic operations on numbers, are simple.
  • It is possible to use the apparatus of logic 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 1110 1010 1011 1001 1000 Gray code is a number system in which two adjacent values ... ... Wikipedia

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

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

    To improve this article, is it desirable ?: Wikify the article. Redesign 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 "Attempt on the security system", and tends more towards the meaning of the next term Cracker attack. This happened due to the distortion of the meaning of the word "hacker". Hacker ... ... Wikipedia

Binary code is a form of recording information in the form of ones and zeros. This is positional with a base 2. Today, the binary code (the table presented a little below contains some examples of writing numbers) is used in all digital devices without exception. Its popularity is due to the high reliability and simplicity of this form of recording. Binary arithmetic is very simple, and accordingly, it is easy to implement on the hardware level. components (or as they are also called - logical) are very reliable, since they operate in only two states: a logical unit (there is a current) and a logical zero (no current). Thus, they compare favorably with analog components, the operation of which is based on transient processes.

How is the binary notation made up?

Let's see how such a key is formed. One bit of a binary code can contain only two states: zero and one (0 and 1). When using two digits, it becomes possible to write four values: 00, 01, 10, 11. A three-digit record contains eight states: 000, 001 ... 110, 111. As a result, we get that the length of the binary code depends on the number of digits. This expression can be written using the following formula: N = 2m, where: m is the number of digits, and N is the number of combinations.

Types of binary codes

In microprocessors, such keys are used to record a variety of processed information. The bit depth of a binary code can significantly exceed its built-in memory. In such cases, long numbers take up several storage locations and are processed with multiple commands. In this case, all memory sectors that are allocated for a multibyte binary code are considered as one number.

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

  • unsigned;
  • direct integer character codes;
  • signed backs;
  • iconic additional;
  • Gray code;
  • Gray-Express code .;
  • fractional codes.

Let's consider each of them in more detail.

Unsigned binary

Let's see what this type of recording is. In unsigned integer codes, each digit (binary) represents a power of two. In this case, the smallest number that can be written in this form is equal to zero, and the maximum can be represented by the following formula: M = 2 p -1. These two numbers completely define the key range that can be used to express such a binary code. Let's consider the possibilities of the mentioned form of registration. When using this type of unsigned key, consisting of eight bits, the range of possible numbers will be from 0 to 255. A sixteen-bit code will have a range from 0 to 65535. In eight-bit processors, two memory sectors are used to store and write such numbers, which are located in adjacent destinations ... Working with such keys is provided by special commands.

Direct integer signed codes

In this kind of binary keys, the most significant bit is used to record the sign of a number. Zero is positive and one is negative. As a result of the introduction of this bit, the range of encoded numbers is shifted to the negative side. It turns out that an eight-bit signed integer binary key can write numbers in the range from -127 to +127. Sixteen-bit - in the range from -32767 to +32767. In eight-bit microprocessors, two adjacent sectors are used to store such codes.

The disadvantage of this form of notation is that the signed and digital digits of the key must be processed separately. The algorithms of programs working with these codes are very complex. To change and highlight the sign bits, it is necessary to use masking mechanisms for this symbol, which contributes to a sharp increase in the size of the software and a decrease in its performance. In order to eliminate this drawback, a new type of key was introduced - a reverse binary code.

Signed reverse key

This form of notation differs from direct codes only in that a negative number in it is obtained by inverting all the digits of the key. In this case, the digital and sign digits are identical. Due to this, the algorithms for working with this type of code are greatly simplified. However, the reverse key requires a special algorithm to recognize the character of the first digit, to calculate the absolute value of the number. And also the restoration of the sign of the resulting value. Moreover, in reverse and forward codes of numbers, two keys are used to write zero. Although this value has no positive or negative sign.

Signed's complement binary number

This type of record does not have the listed disadvantages of the previous keys. Such codes allow direct summation of both positive and negative numbers. In this case, the analysis of the sign discharge is not carried out. All of this is made possible by the fact that complementary numbers represent a natural ring of symbols, not artificial formations such as forward and backward keys. Moreover, an important factor is that it is extremely easy to perform binary's complement computations. To do this, it is enough to add a unit to the reverse key. When using this type of sign code, consisting of eight digits, the range of possible numbers will be from -128 to +127. A sixteen-bit key will have a range of -32768 to +32767. In eight-bit processors, two adjacent sectors are also used to store such numbers.

Binary's complement is interesting for the observed effect, which is called the sign propagation phenomenon. Let's see what this means. This effect is that in the process of converting a one-byte value to a two-byte value, it is enough to assign each bit of the high byte to the values ​​of the sign bits of the low byte. It turns out that the most significant bits can be used to store the signed. In this case, the key value does not change at all.

Gray Code

This form of recording is, in fact, a one-step key. That is, in the process of moving from one value to another, only one bit of information changes. In this case, an error in reading data leads to a transition from one position to another with a slight offset in time. However, obtaining a completely incorrect result for the angular position in such a process is completely ruled out. The advantage of such a code is its ability to mirror information. For example, by inverting the most significant bits, you can simply change the direction of the sample. This is due to the Complement control input. In this case, the output value can be either increasing or decreasing with one physical direction of rotation of the axis. Since the information recorded in the Gray key is exclusively encoded in nature, which does not carry real numerical data, then before further work, it is required to first convert it into the usual binary form of notation. This is done using a special converter - the Gray-Binar decoder. This device is easily implemented on elementary logic gates both in hardware and software.

Gray Express Code

The standard one-step key Gray is suitable for solutions that are represented as numbers, two. In cases where it is necessary to implement other solutions, only the middle section is cut out and used from this form of recording. As a result, one-step key is preserved. However, in such code, the start of the numeric range is not zero. It is shifted by the specified value. During data processing, half the difference between the initial and reduced resolution is subtracted from the generated pulses.

Fixed-point binary fractional representation

In the process of work, one has to operate not only with whole numbers, but also with fractional ones. Such numbers can be written using forward, backward and complementary codes. The principle of construction of the mentioned keys is the same as for integers. Until now, we have assumed that the binary comma should be to the right of the least significant bit. But this is not the case. It can be located both to the left of the most significant bit (in this case, only fractional numbers can be written as a variable), and in the middle of a variable (mixed values ​​can be written).

Floating point binary code representation

This form is used to write, or vice versa - very small. An example is interstellar distances or the size of atoms and electrons. When calculating such values, one would have to use a binary code with a very large bit depth. However, we do not need to take into account cosmic distance with millimeter precision. Therefore, the fixed-point form is ineffective in this case. Algebraic form is used to display such codes. That is, the number is written as the mantissa multiplied by ten to the power that reflects the desired order of the number. You should know that the mantissa should not be more than one, and zero should not be written after the comma.

Binary calculus is believed to have been invented in the early 18th century by the German mathematician Gottfried Leibniz. However, as scientists recently discovered, long before the Polynesian island, Mangareva used this type of arithmetic. Despite the fact that colonization almost completely destroyed the original numbering systems, scientists have restored complex binary and decimal forms of counting. In addition, Cognitive scholar Nunez argues that binary coding was used in ancient China as early as the 9th century BC. e. Other ancient civilizations, such as the Maya Indians, also used complex combinations of decimal and binary systems to track time intervals and astronomical phenomena.

The set of characters with which text is written is called alphabet.

The number of characters in the alphabet is his power.

Formula for determining the amount of information: N = 2 b,

where N is the cardinality of the alphabet (number of characters),

b - number of bits (informational weight of the character).

The alphabet with a capacity of 256 characters can accommodate almost all the necessary characters. This alphabet is called sufficient.

Because 256 = 2 8, then the weight of 1 character is 8 bits.

The 8-bit unit was named 1 byte:

1 byte = 8 bits.

The binary code of each character in computer text takes up 1 byte of memory.

How is text information represented in the computer memory?

The convenience of byte encoding of characters is obvious, since a byte is the smallest addressable part of memory and, therefore, the processor can access each character separately, performing text processing. On the other hand, 256 characters is quite a sufficient number to represent a wide variety of character information.

Now the question arises, what kind of eight-bit binary code to associate with each character.

It is clear that this is a conditional matter, you can come up with many encoding methods.

All characters of the computer alphabet are numbered from 0 to 255. Each number corresponds to an eight-bit binary code from 00000000 to 11111111. This code is simply the ordinal number of the character in the binary number system.

The table in which all the characters of the computer alphabet are assigned serial numbers is called the encoding table.

Different coding tables are used for different types of computers.

The international standard for the PC has become the table ASCII(read asci) (American Standard Code for Information Interchange).

The ASCII table is divided into two parts.

The international standard is only the first half of the table, i.e. symbols with numbers from 0 (00000000), up to 127 (01111111).

ASCII encoding table structure

Serial number

The code

Symbol

0 - 31

00000000 - 00011111

Symbols with numbers from 0 to 31 are usually called control characters.
Their function is to control the process of displaying text on the screen or printing, giving a sound signal, marking text, etc.

32 - 127

00100000 - 01111111

Standard part of the table (English). This includes lowercase and uppercase letters of the Latin alphabet, decimal digits, punctuation marks, all kinds of brackets, commercial and other symbols.
Character 32 is a space, i.e. empty position in the text.
All others are reflected in certain signs.

128 - 255

10000000 - 11111111

Alternative part of the table (Russian).
The second half of the ASCII code table, called the code page (128 codes, starting from 10000000 and ending with 11111111), can have different variants, each variant has its own number.
The code page is primarily used to accommodate national alphabets other than Latin. In Russian national encodings, this part of the table contains symbols of the Russian alphabet.

The first half of the ASCII table


I draw your attention to the fact that in the encoding table, letters (uppercase and lowercase) are arranged in alphabetical order, and numbers are ordered in ascending order of values. This observance of the lexicographic order in the arrangement of characters is called the principle of sequential coding of the alphabet.

For the letters of the Russian alphabet, the principle of sequential coding is also observed.

The second half of the ASCII table


Unfortunately, there are currently five different Cyrillic encodings (KOI8-R, Windows. MS-DOS, Macintosh and ISO). Because of this, problems often arise with the transfer of Russian text from one computer to another, from one software system to another.

Chronologically, one of the first standards for encoding Russian letters on computers was KOI8 ("Information exchange code, 8-bit"). This encoding was used back in the 70s on computers of the ES computer series, and from the mid 80s it began to be used in the first Russified versions of the UNIX operating system.

From the beginning of the 90s, the time of the dominance of the MS DOS operating system, the CP866 encoding remains ("CP" stands for "Code Page").

Apple computers running Mac OS use their own Mac encoding.

In addition, the International Organization for Standardization (International Standards Organization, ISO) approved another encoding called ISO 8859-5 as a standard for the Russian language.

Currently, the most common encoding is Microsoft Windows, abbreviated as CP1251.

Since the late 90s, the problem of character coding standardization has been solved by the introduction of a new international standard called Unicode... This is a 16-bit encoding i.e. it allocates 2 bytes of memory for each character. Of course, this doubles the amount of memory used. But on the other hand, such a code table allows the inclusion of up to 65536 characters. The complete specification of the Unicode standard includes all the existing, extinct and artificially created alphabets of the world, as well as many mathematical, musical, chemical and other symbols.

Let's try to use an ASCII table to imagine how words will look in computer memory.

Internal representation of words in computer memory

Sometimes it happens that a text consisting of letters of the Russian alphabet, received from another computer, cannot be read - some kind of "gibberish" is visible on the monitor screen. This is due to the fact that computers use different encoding of the characters of the Russian language.

08. 06.2018

Dmitry Vassiyarov's blog.

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 acquaint the class with letters and numbers. And since we live in the world of digital technologies, I will tell you what 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 with various numbers and keep a corresponding record. Following this logic, the binary system uses only two characters. In our case, it is just "0" (zero) and "1" one. And here I want to warn you that, hypothetically, in their place there could be other conventions, but just such values, denoting the absence (0, empty) and the presence of a signal (1 or "stick"), will help us further understand the structure of the binary code.

Why do I need binary?

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

Their further complication led to the appearance of the first processors, which also did their job, processing already a 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 turned out to be able to distinguish a given sequence of incoming signals. Of course, it is possible to describe the conditional combination like this: “there is a signal”; "no signal"; “There is a signal”; "There is a signal." You can even simplify the notation: "is"; "No"; "there is"; "there is".

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

Undoubtedly, the processor technology has made great strides forward and now chips are able to perceive not just a sequence of signals, but entire programs written in specific 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 is, or not, it makes no difference. For a chip, any of these options is a single piece of information called a "bit" (bit is the official unit of measurement).

Conventionally, a character can be encoded as a sequence of several characters. Only four variants can be described with two signals (or their absence): 00; 01; 10; 11. This encoding method is called two-bit. But it can be:

  • four-bit (as in the example for the paragraph above 1011) allows you to write 2 ^ 4 = 16 character combinations;
  • eight-bit (for example: 0101 0011; 0111 0001). At one time it was of most interest for programming, since 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) and above. But records with such a length are already for modern more complex tasks. Modern processors use 32- and 64-bit architecture;

Frankly, there is no single official version, it so happened that the combination of eight characters has become the standard measure of stored information, called "byte". This could even be applied to one letter written in 8-bit binary code. So, my dear friends, please remember (if anyone did not know):

8 bits = 1 byte.

So it is 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 and Internet transfer (bits per second).

Binary encoding in action

To standardize the recording of information for computers, several coding systems have been developed, one of which 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 next from 32 to 127 (00100000 - 01111111) Latin alphabet and auxiliary symbols and punctuation marks;
  • the rest, up to 255th (10000000 - 11111111) - an alternative part of the table for special tasks and displaying national alphabets;

The decoding 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 conventions:

  • a byte of 8 characters will be read from right to left;
  • if in ordinary numbers we use the digits of ones, tens, hundreds, then here (reading in reverse order) for each bit different powers of "two" are presented: 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 signal "1" in the corresponding position, we take the values ​​of this bit and sum them up in the usual way. Accordingly: 0 + 0 + 0 + 32 + 16 + 0 + 2 + 1 = 51. You can verify the correctness of this method by looking at the code table.

Now, my inquisitive friends, you not only know what a binary code is, but also know how to transform 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 on the other hand, you can use it to write anything you like:

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

In addition, due to the simplicity of "presentation", various ways of recording binary information are possible: HDD disks;

The advantages of binary coding are supplemented by almost unlimited possibilities for transmitting information over any distance. It is this method of communication that is used with spaceships and artificial satellites.

So, today the binary number system is a language that is understood by most of the electronic devices we use. And what is most interesting, no other alternative for it is foreseen yet.

I think that the information I have outlined for a start will be quite enough for you. And then, if such a need arises, everyone can delve into an independent study of this topic. I will say goodbye and after a short break I will prepare for you a new article on my blog on some interesting topic.

It's better if you tell me it yourself;)

See you soon.


Greek Georgian
Ethiopian
Jewish
Akshara-sankhya Other Babylonian
Egyptian
Etruscan
Roman
Danube Attic
Kipu
Mayan
Aegean
KPPU symbols Positional , , , , , , , , , , Nonga-positional Symmetrical Mixed systems Fibonaccieva Non-positional Single (unary)

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

Binary notation of numbers

In the binary system, numbers are written using two characters ( 0 and 1 ). In order not to be confused in which number system the number is written, it is supplied with an indicator at the bottom right. For example, the decimal number 5 10 , in binary 101 2 ... Sometimes a binary number is indicated by the prefix 0b or symbol & (ampersand), For example 0b101 or respectively &101 .

In the binary number system (as in other number systems other than decimal), the characters are read one at a time. For example, the number 101 2 is pronounced "one zero one".

Integers

A natural number written in binary 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:

(an - 1 an - 2… a 1 a 0) 2 = ∑ k = 0 n - 1 ak 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: a "-" sign in front of the number. Namely, a negative binary integer (- 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 as (an - 1 an - 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:

(an - 1 an - 2… a 1 a 0, a - 1 a - 2… a - (m - 1) a - m) 2 = ∑ k = - mn - 1 ak 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),)

Addition, subtraction and multiplication of binary numbers

Addition table

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

An example of multiplication "column" (decimal expression 14 10 * 5 10 = 70 10 in binary looks like 1110 2 * 101 2 = 1000 110 2):

Starting with the number 1, all numbers are multiplied by two. The point after 1 is called a binary point.

Converting binary numbers to decimal

Let's say a binary number is given 110001 2 ... To convert to decimal, write it down as a digit sum as follows:

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

The same thing is slightly different:

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

You can write it down in the form of a table as follows:

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 decimal 49 10.

Converting fractional binary numbers to decimal

Need to translate 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

The same thing is slightly different:

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

Horner transformation

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

For example, the binary number 1011011 2 translated into decimal system like this:

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.

Translation of the fractional part of numbers by Horner's method

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

for instance 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 to the end of the binary notation. We continue dividing until the quotient is 0. Write the result from right to left. That is, the bottom digit (1) will be the leftmost, and so on. As a result, we get the number 19 in binary notation: 10011 .

Convert fractional decimal numbers to binary

If there is an integer part in the original number, then it is converted separately from the fractional part. The conversion of a fractional number from the decimal number system to binary is carried out according to the following algorithm:

  • The fraction is multiplied by the base of the binary number system (2);
  • In the resulting product, the integer part is highlighted, which is taken as the most significant bit 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 computational accuracy is achieved. Otherwise, calculations continue over the fractional part of the product.

Example: You want to translate a fractional decimal number 206,116 to a binary fraction.

Translation of the whole part gives 206 10 = 11001110 2 according to the previously described algorithms. The fractional part of 0.116 is multiplied by the base 2, putting the whole parts of the product in the digits after the decimal point of the desired binary fractional 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, since it is the most simple and meets the requirements:

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

In computing, it is widely used to write negative binary numbers in two's complement code. For example, the number −5 10 can be written as −101 2 but will be stored as 2 in a 32-bit computer.

In the English system of measures

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

Generalizations

The binary number system is a combination of a 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 in this case 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, an analogue of 3-bit and 6-bit numbers, was known in ancient China in the classical texts of the Book of Changes. 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 of obtaining them was developed by the Chinese scientist and philosopher Shao Yun in the 11th century. However, there is no evidence that Shao Yong understood the rules of binary arithmetic by arranging two-character tuples in lexicographic order.
  • Sets, which are combinations of binary numbers, were used by Africans in traditional divination (such as Ifa) along with medieval geomancy.
  • In 1854, the English mathematician George Boole published a landmark work describing algebraic systems as applied to logic, which is now known as Boolean algebra or algebra of logic. His calculus was destined to play an important role in the development of modern digital electronic circuits.
  • In 1937, Claude Shannon presented 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 Stiebitz, who later worked at Bell Labs, created a Model K computer on the basis of the relay. K itchen ”, the kitchen where the assembly was done), which performed binary addition. In late 1938, Bell Labs launched a research program led by Stibitz. 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, Stiebitz demonstrated the ability to send commands to a remote complex number calculator over a telephone line using a teletypewriter. This was the first attempt at using a remote computer via a telephone line. Among the conference participants who witnessed the demonstration were John von Neumann, John Mauchly and Norbert Wiener, who later wrote about it in their memoirs.
  • On the pediment of the building (the former Computing Center of the Siberian Branch of the USSR Academy of Sciences) in the Novosibirsk Academgorodok, there is a binary number 1000110, equal to 70 10, which symbolizes the date of construction of the building (

Top related articles