the Internet Windows Android

Hi in binary code. Binary code

Since it is the easiest and complies with the requirements:

  • Than less values There is a system, the easier it is to make separate elements that operate with these values. In particular, the two digits of the binary number system can be easily represented by many physical phenomena: there is current - no current, the induction of the magnetic field is greater than the threshold value or not, etc.
  • The smaller the number of states at the element, 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 rather simple. Simples are tables of addition and multiplication - basic actions on numbers.
  • It is possible to use the device algebra logic to perform beaten operations over numbers.

Links

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

Wikimedia Foundation. 2010.

Watch what is "binary code" 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 Gray System Number in which two adjacent values ... ... Wikipedia

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

    In mathematics, there is a vial in mathematics, which is not divided by any single square, except 1. For example, 10 is infrequent, and 18 is not, since 18 is divided by 9 \u003d 32. The beginning of the sequence of invadant numbers is: 1, 2, 3, 5, 6, 7, ... ... Wikipedia

    To improve this article, it is desirable?: Vicitive article. Proceed design in accordance with the rules for writing articles. Fix an article according to the Wikipedia Stylistic Rules ... Wikipedia

    This term has other values, see Python. Python Language Class: Mu ... Wikipedia

    In the narrow sense of the word Currently, the phrase is understood as "attempted security system", and it is inclined rather to the meaning of the next term of the cracker attack. This happened because of the distortion of the meaning of the word "hacker". Hacker ... ... Wikipedia

Many characters with which the text is written, called alphabet.

The number of characters in the alphabet is its power.

Formula for determining the number of information: N \u003d 2 b,

where n is the power of the alphabet (the number of characters),

b - the number of bits (symbol information).

Alphabet with a power of 256 characters can be placed almost all the necessary characters. Such an alphabet is called sufficient.

Because 256 \u003d 2 8, then weight 1 symbol - 8 bits.

Unit of measurement 8 bits appropriated name 1 byte:

1 byte \u003d 8 bits.

The binary code of each symbol in the computer text takes 1 memory byte.

What way text information is presented in the computer's memory?

Convenience of over-off symbol encoding is obvious, because bytes - the smallest addressable part of the memory and, therefore, the processor can refer to each character separately by performing text processing. On the other hand, 256 characters are quite enough to represent the most varied symbolic information.

Now the question arises which eight-bit binary code to put in line with each symbol.

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

All symbols of the computer alphabet are numbered from 0 to 255. Even the number corresponds to the eight-bit binary code from 00000000 to 11111111. This code is simply the sequence number of the symbol in the binary number system.

A table in which all the characters of the computer alphabet are made in compliance with the sequence numbers, is called the encoding table.

For different types EUM uses various encoding tables.

The International Standard for PC has become a table ASCII.(Reading ASKI) (American standard code for information exchange).

The ASCII code 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), before 127 (01111111).

ASCII Encoding Table Structure

Serial number

The code

Symbol

0 - 31

00000000 - 00011111

Symbols with numbers from 0 to 31 are called managers.
Their function is to control the process of outputting text on the screen or print, the sound signal, text markup, etc.

32 - 127

00100000 - 01111111

Standard part Tables (English). This includes lowercase and capital letters of the Latin alphabet, decimal numbers, punctuation marks, all kinds of brackets, commercial and other characters.
Symbol 32 - space, i.e. Empty position in the text.
All other are reflected by 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 with 10,000,000 and ending 11111111), may have different options, each option has its own number.
The code page is primarily used to accommodate national alphabets other than Latin. In Russian national encodings, the symbols of the Russian alphabet are placed in this part of the table.

The first half of the ASCII codes table


I draw your attention to the fact that in the table of encoding the letter (uppercase and lowercase) are arranged in alphabetical order, and the numbers are ordered by increasing values. Such adherence to the lexicographic order in the arrangement of the symbols is called the principle of sequential coding of the alphabet.

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

The second half of the ASCII codes table


Unfortunately, there are currently five different Cyrillic encodings (koi8-p, 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 of coding Russian letters on computers was koi8 ("information exchange code, 8-bit"). This encoding was used in the 70s on the computers of the EU EU 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 domination of the MS DOS operating system, the CP866 encoding remains ("CP" means "Code Page", "code page").

Apple computers running the Mac OS operating system use their own Mac encoding.

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

The most common is currently encoding. Microsoft Windows.denoted by the reduction of CP1251.

Since the end of the 90s, the problem of standardization of symbol coding is solved by the introduction of a new international standard called Unicode.. This is a 16-bit encoding, i.e. In it, each symbol is given 2 byte of memory. Of course, the amount of memory occupied by 2 times. But this code table allows you to enable up to 65536 characters. The complete specification of the Unicode standard includes all existing, extinct and artificially created alphabets of the world, as well as many mathematical, musical, chemical and other symbols.

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

Internal word view in computer memory

Sometimes it happens that the text consisting of the letters of the Russian alphabet, obtained from another computer, cannot be read - some "abrakadabra" can be visible on the monitor screen. This happens because the computers use different encoding of the symbols of the Russian language.

Appointment of service. The service is designed to transfer numbers from one number system to another in online mode. To do this, select the system base from which you want to translate the number. You can enter both as integers and points.

Number

Translation from 10 2 8 16 Number Systems. Translate at 2 10 8 16 Number System.
For fractional numbers, use 2 3 4 5 6 7 8 decimal sign.

You can enter as integers, for example 34, and fractional, for example, 637.333. For fractional numbers, the accuracy of the transfer after the comma is indicated.

Together with this calculator also use the following:

Methods of representing numbers

Binary (Binary) Numbers - Each digit means a value of one bit (0 or 1), a senior bit is always written on the left, after the number is set "B". For the convenience of perception, the tetrad can be separated by spaces. For example, 1010 0101B.
Hexadecimal (Hexadecimal) Numbers - Each Tetrad is represented by one symbol of 0 ... 9, A, B, ..., F. It may be denoted by such a representation in different ways, only the symbol "H" after the last hexadecimal figure is used. For example, A5H. In the text texts, the same number can be designated both as 0HA5, and as 0a5h, depending on the syntax of the programming language. An insignificant zero (0) is added to the left of the senior hexadecimal figure depicted by the letter to distinguish between numbers and symbolic names.
Decimal (Decimal) numbers - each byte (word, double word) seems to be in conventional number, and a sign of a decimal representation (the letter "D") is usually lowered. Byte from previous examples has a decimal value of 165. Unlike the binary and hexadecimal recording form, it is difficult to determine the value of each bit that sometimes have to do.
Octic (Octal) Numbers - Each Troika Bit (separation begins with the younger) is written in the form of a figure of 0-7, a sign "O" is placed at the end. The same number will be recorded as 245O. The octal system is inconvenient by the fact that the byte cannot be divided equally.

Algorithm for the transfer of numbers from one number system to another

Transfer of whole decimal numbers to any other numbering system is carried out by dividing the number to the base new system Note until the residue remains the number of smaller base of the new number system. The new number is written in the form of separation residues, starting with the latter.
The transition of the correct decimal fraction into another PSS is carried out by multiplying only the fractional part of the number on the base of the new number system until all zeros remain in the fractional part or the specified translation accuracy will not be reached. As a result of the execution of each multiplication operation, one digit of the new number starting with the elder is formed.
Translation of incorrect fraction is carried out in 1 and 2 rule. The whole and fractional part are recorded together, separating the comma.

Example number 1.



Translation from 2 to 8 to 16 number systems.
These systems are multiple two, therefore, the translation is carried out using a correspondence table (see below).

To transfer a number from a binary numbering system in an octairic (hexadecimal), it is necessary to break down from the comma to the right and binary number For groups of three (four - for hexadecimal) discharge, complementing, if necessary, with zeros of extreme groups. Each group is replaced with an appropriate octal or hexadecimal digit.

Example number 2. 1010111010,1011 \u003d 1.010.111.010,101.1 \u003d 1272,51 8
here 001 \u003d 1; 010 \u003d 2; 111 \u003d 7; 010 \u003d 2; 101 \u003d 5; 001 \u003d 1.

When transferring to a hexadecimal system, it is necessary to divide the number on the parts, four digits, following the same rules.
Example number 3. 1010111010,1011 \u003d 10.1011.1010,1011 \u003d 2B12.13 Hex
here 0010 \u003d 2; 1011 \u003d B; 1010 \u003d 12; 1011 \u003d 13.

The translation of numbers from 2, 8 and 16 to a decimal calculus system is produced by splitting the number to individual and multiplying it to the base of the system (from which the number is translated) erected into a degree in accordance with its sequence number in the translating number. In this case, the numbers are numbered to the left of the semicolon (the first number is number 0) with an increase, and on the right side with decrease (that is, with a negative sign). The results are folded.

Example number 4.
An example of translation from binary to a decimal number system.

1010010,101 2 \u003d 1 · 2 6 + 0 · 2 5 + 1 · 2 4 + 0 · 2 3 + 0 · 2 2 + 1 · 2 1 + 0 · 2 0 + 1 · 2 -1 + 0 · 2 - 2 + 1 · 2 -3 \u003d
\u003d 64 + 0 + 16 + 0 + 0 + 2 + 0 + 0.5 + 0 + 0.125 \u003d 82.625 10 Example of translating from octal to a decimal number system. 108.5 8 \u003d 1 * · 8 2 + 0 · 8 1 + 8 · 8 0 + 5 · 8 -1 \u003d 64 + 0 + 8 + 0.625 \u003d 72.625 10 Example of translation from hexadecimal to a decimal number system. 108.5 16 \u003d 1 · 16 2 + 0 · 16 1 + 8 · 16 0 + 5 · 16 -1 \u003d 256 + 0 + 8 + 0.3125 \u003d 264.3125 10

Once again we repeat the algorithm for the translation of numbers from one number system to another PSS

  1. From the decimal number system:
    • split the number on the basis of the translated number system;
    • find the balance from dividing the whole part of the number;
    • write all the remnants from dividing in the reverse order;
  2. From binary number system
    • To transfer to a decimal number system, it is necessary to find the amount of the products of the base 2 to the corresponding degree of discharge;
    • To transfer the number to the octal, it is necessary to split the number on the triads.
      For example, 1000110 \u003d 1 000 110 \u003d 106 8
    • To transfer the number from a binary number system to hexadecimal, it is necessary to split the number into groups of 4 categories.
      For example, 1000110 \u003d 100 0110 \u003d 46 16
The position is called the systemFor which the significance or weight of the number depends on its location in number. The ratio between systems is expressed by the table.
Table matching table:
Binary SSHexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A.
1011 B.
1100 C.
1101 D.
1110 E.
1111 F.

Table for transfer to the octal number system

Let's figure it out like all the same translate texts into digital code? By the way, on our site you can translate any text in a decimal, hexadecimal, binary code using the CODE Calculator online.

Coding text.

According to computer theory, any text consists of individual characters. These symbols include: letters, numbers, lowercase punctuation marks, special symbols (", No, (), etc.), to them, as well as gaps between words.

Required luggage knowledge. Many characters, with which you write down the text, is called the alphabet.

The number of characters taken in the alphabet represents its power.

The amount of information can be determined by the formula: n \u003d 2b

  • N is the most power (many characters),
  • b - bits (weight of the symbol taken).

Alphabet in which it will be 256 can accommodate almost everything symbols. Such alphabets are called sufficient.

If you take the alphabet with a capacity of 256, and keep in mind that 256 \u003d 28

  • 8 bits are always called 1 byte:
  • 1 byte \u003d 8 bits.

If you translate each symbol into binary code, then this computer text code will occupy 1 byte.

How can text information look like a computer memory?

Any text is typing on the keyboard, on the keyboard keys, we see the familiar signs for us (numbers, letters, etc.). In the operational memory of the computer, they fall only in the form of a binary code. The binary code of each symbol looks like an eight-digit number, for example 00111111.

Since, byte is the smallest addressable particle of memory, and the memory is drawn to each symbol separately - the convenience of such coding is obvious. However, 256 characters are a very convenient number for any symbolic information.

Naturally, the question arose: what specifically eight bit code Belongs to each symbol? And how to make text translation into digital code?

This process is conditional, and we have the right to come up with various methods for encoding characters. Each character of the alphabet has its own number from 0 to 255. And each number is assigned the code from 00000000 to 11111111.

The encoding table is a "cheat sheet", which indicates the symbols of the alphabet in accordance with the sequence number. For different types EUM use different tables for encoding.

ASCII (or ASKI) has become an international standard for personal computers. The table has two parts.

The first half for the ASCII table. (It is the first half, became the standard.)

Compliance with the lexicographic order, that is, in the table, the letter (lowercase and capital) are indicated in strict alphabetical order, and the numbers ascending are called the principle of successive alphabet coding.

For the Russian alphabet also observe principle of sequential coding.

Now, in our time, use as much as five coding systems Russian alphabet (Koi8-p, Windows. MS-DOS, Macintosh and ISO). Due to the number of encoding systems and the lack of one standard, misunderstandings arise with the transfer of Russian text to a computer view.

One of the first Standards for the coding of the Russian alphabeta. personal computers Consider koi8 ("information sharing code, 8-bit"). This encoding was used in the mid-seventies in the EU computer series of computer computers, and from the middle of the eighties, it is started to use UNIX operating systems in the first translated into Russian.

Since the beginning of the nineties, the so-called time, when dominated operating system MS DOS, the CP866 coding system appears ("CP" means "Code Page", "Code Page").

Giant computer firms Apple, with its innovative system, under the abolition of which they also worked (Mac OS), begin to use their own system for coding the MAC alphabet.

International Standardization Organization (International Standards Organization, ISO) appoints another one for another alphabet Coding Systemcalled ISO 8859-5.

And the most common, nowadays, the system for encoding the alphabet, is invented in Microsoft Windows, and is called CP1251.

From the second half of the nineties, the problem of the text of the translation of the text into the digital code for the Russian language was solved and not only, introducing into the system standard, called Unicode. It is represented by sixteen diffidal encoding, it means that each symbol is given exactly two bytes. random access memory. Of course, with such an encoding, the memory costs are doubled. However, such a code system allows you to translate into electronic code up to 65536 characters.

Specificity standard system Unicode, is the inclusion of absolutely any alphabet, whether it is existing, extinct, fictional. Ultimately, absolutely any alphabet, in addition to this, UNICODE system includes a lot of mathematical, chemical, musical and general symbols.

Let's see the ASCII table, see how the word may look in the memory of your computer.

It often happens that your text, which is written by letters from the Russian alphabet, is not read, this is due to the difference in alphabet encoding systems on computers. This is a very common problem that is quite often detected.

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 other conventions could be hypothetically in their place, but it is all the values \u200b\u200bthat denote the absence (0, empty) and the presence of a signal (1 or "wand") will help us to 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 for us the following is: the electronic devices were able to distinguish the specified sequence of 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 Using 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 a 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: HDD discs;

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 will be able to deepen into an independent study of 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.