Encoding text information in a computer is sometimes an essential condition for the correct operation of a device or the display of a particular fragment. How this process occurs during computer operation with text and visual information, sound - we will analyze all this in this article.

Introduction

Electronic computer(which we are in everyday life We call it a computer) perceives text in a very specific way. For her, encoding text information is very important, since she perceives each text fragment as a group of symbols isolated from each other.

What are the symbols?

Not only Russian, English and other letters act as symbols for a computer, but also punctuation marks and other characters. Even the space we use to separate words when typing on a computer is perceived by the device as a symbol. In some ways it is very reminiscent of higher mathematics, because there, according to many professors, zero has a double meaning: it is both a number and at the same time does not mean anything. Even for philosophers, the question of white space can be a pressing issue. A joke, of course, but, as they say, there is some truth in every joke.

What kind of information is there?

So, to perceive information, the computer needs to start processing processes. What kind of information is there anyway? The topic of this article is the encoding of textual information. We will pay special attention to this task, but we will also deal with other micro-topics.

Information can be text, numeric, audio, graphic. The computer must run processes that encode textual information in order to display on the screen what we, for example, type on a keyboard. We will see symbols and letters, this is understandable. What does the machine see? She perceives absolutely all information - and now we are not just talking about text - as a certain sequence of zeros and ones. They form the basis of the so-called binary code. Accordingly, the process that converts information received by the device into something it can understand is called “binary coding of text information.”

Brief principle of operation of binary code

Why is it that binary coding of information is most widespread in electronic machines? The text base, which is encoded using zeros and ones, can be absolutely any sequence of symbols and signs. However, this is not the only advantage that binary text encoding of information has. The thing is that the principle on which this coding method is based is very simple, but at the same time quite functional. When there is an electrical impulse, it is marked (conditionally, of course) with a unit. There is no impulse - marked with zero. That is, text encoding of information is based on the principle of constructing a sequence of electrical impulses. A logical sequence made up of binary code symbols is called machine language. At the same time, encoding and processing text information using binary code allows operations to be carried out in a fairly short period of time.

Bits and bytes

A number perceived by a machine contains a certain amount of information. It is equal to one bit. This applies to every one and every zero that make up one or another sequence of encrypted information.

Accordingly, the amount of information in any case can be determined simply by knowing the number of characters in the binary code sequence. They will be numerically equal to each other. 2 digits in the code carry 2 bits of information, 10 digits - 10 bits, and so on. The principle of determining the information volume that lies in a particular fragment of binary code is quite simple, as you can see.

Coding text information in a computer

Right now you are reading an article that consists of a sequence, as we believe, of letters of the Russian alphabet. And the computer, as mentioned earlier, perceives all information (and in this case too) as a sequence not of letters, but of zeros and ones, indicating the absence and presence of an electrical impulse.

The thing is that you can encode one character that we see on the screen using a conventional unit of measurement called a byte. As written above, binary code has a so-called information load. Let us recall that numerically it is equal to the total number of zeros and ones in the selected code fragment. So, 8 bits make 1 byte. In this case, the combinations of signals can be very different, as can be easily seen by drawing a rectangle on paper, consisting of 8 cells of equal size.

It turns out that text information can be encoded using an alphabet with a capacity of 256 characters. What's the point? The meaning lies in the fact that each character will have its own binary code. Combinations “tied” to certain characters start from 00000000 and end with 11111111. If you move from the binary to the decimal number system, then you can encode information in such a system from 0 to 255.

Do not forget that now there are various tables that use the encoding of letters of the Russian alphabet. These are, for example, ISO and KOI-8, Mac and CP in two variations: 1251 and 866. It is easy to make sure that text encoded in one of these tables will not be displayed correctly in an encoding other than this one. This is due to the fact that in different tables different characters correspond to the same binary code.

This was a problem at first. However, nowadays programs already have built-in special algorithms that convert text, bringing it to the correct form. 1997 was marked by the creation of an encoding called Unicode. In it, each character has 2 bytes at its disposal. This allows you to encode text with a much larger number of characters. 256 and 65536: is there a difference?

Graphics coding

Coding text and graphic information has some similarities. As you know, to display graphic information, it is used peripheral device computer called a monitor. Graphics now (we are talking about computer graphics now) are widely used in a variety of fields. Fortunately, hardware capabilities personal computers allow you to solve quite complex graphic problems.

Processing video information has become possible in recent years. But the text is much “lighter” than the graphics, which, in principle, is understandable. Because of this, the final size of graphics files must be increased. You can overcome such problems by knowing the essence in which graphic information is presented.

Let's first figure out what groups this type of information is divided into. Firstly, it is raster. Secondly, vector.

Raster images are quite similar to checkered paper. Each cell on such paper is painted over with one color or another. This principle is somewhat reminiscent of a mosaic. That is, it turns out that in raster graphics the image is divided into separate elementary parts. They are called pixels. Translated into Russian, pixels mean “dots”. It is logical that the pixels are ordered relative to the lines. The graphic grid consists of just a certain number of pixels. It is also called a raster. Considering these two definitions, we can say that a raster image is nothing more than a collection of pixels that are displayed on a rectangular grid.

Monitor raster and pixel size affect image quality. The larger the monitor's raster, the higher it will be. Raster sizes are screen resolution, which every user has probably heard of. One of the most important characteristics that computer screens have is the resolution, not just the resolution. It shows how many pixels there are per unit of length. Typically, monitor resolution is measured in pixels per inch. The more pixels per unit length, the higher the quality will be, since the “grain” is reduced.

Audio stream processing

Text and audio information, like other types of coding, has some features. We will now talk about the last process: encoding audio information.

The representation of an audio stream (as well as an individual sound) can be produced using two methods.

Analogue form of audio information representation

In this case, the quantity can take on a truly huge number of different values. Moreover, these same values ​​do not remain constant: they change very quickly, and this process is continuous.

Discrete form of representation of audio information

If we talk about the discrete method, then in this case the quantity can take only a limited number of values. In this case, the change occurs spasmodically. You can discretely encode not only audio, but also graphic information. As for the analog form, by the way.

Analog audio information is stored on vinyl records, for example. But the CD is already a discrete way of presenting audio information.

At the very beginning, we talked about the fact that the computer perceives all information in machine language. To do this, information is encoded in the form of a sequence of electrical impulses - zeros and ones. Encoding audio information is no exception to this rule. To process sound on a computer, you first need to turn it into that very sequence. Only after this can operations be performed on a stream or a single sound.

When the encoding process occurs, the stream is subject to time sampling. The sound wave is continuous; it develops over small periods of time. The amplitude value is set for each specific interval separately.

Conclusion

So, what did we find out during this article? Firstly, absolutely all information that is displayed on a computer monitor is encoded before appearing there. Secondly, this coding involves translating information into machine language. Thirdly, machine language is nothing more than a sequence of electrical impulses - zeros and ones. Fourthly, there are separate tables for encoding different characters. And, fifthly, graphic and sound information can be presented in analog and discrete form. Here, perhaps, are the main points that we have discussed. One of the disciplines that studies this area is computer science. Coding of textual information and its basics are explained at school, since there is nothing complicated about it.

Text information consists of symbols: letters, numbers, punctuation marks, etc. One byte is enough to store 256 different values, which allows you to place any of the alphanumeric characters in it. The first 128 characters (occupying the least significant seven bits) are standardized using the ASCII (American Standard Code for Information Interchange) encoding. The essence of encoding is that each character is assigned a binary code from 00000000 to 11111111 or a corresponding decimal code from 0 to 255. To encode Russian letters, various code tables are used (KOI-8R, CP1251, CP10007, ISO-8859-5 ):

KOI8R- eight-bit standard for encoding letters of the Cyrillic alphabets (for the UNIX operating system). Developers KOI8R placed the Russian alphabet characters at the top of the extended ASCII table so that the positions of the Cyrillic characters correspond to their phonetic counterparts in the English alphabet at the bottom of the table. This means that from the text written in KOI8R, the result is text written in Latin characters. For example, the words “high house” take the form “dom vysokiy”;

CP1251– eight-bit encoding standard used in OS Windows;

CP10007- eight-bit encoding standard used in the Cyrillic alphabet of the Macintosh operating system (Apple computers);

ISO-8859-5 – an eight-bit code approved as a standard for encoding the Russian language.

Encoding graphic information

Graphic information can be presented in two forms: analog And discrete. Painting canvas created by the artist is analog representation example, and the image printed using a printer, consisting of individual (elements) points of different colors, is discrete representation.

By splitting a graphic image (sampling), graphic information is converted from analogue form to discrete form. In this case, coding is performed - assigning a specific value in the form of a code to each element of the graphic image. Creation and storage of graphic objects is possible in several types - as vector, fractal or raster images. A separate item considered 3D (three-dimensional) graphics, which combines vector and raster image generation methods.

Vector graphics used to represent graphic images such as pictures, drawings, diagrams.

They are formed from objects - a set of geometric primitives (points, lines, circles, rectangles), which are assigned certain characteristics, for example, line thickness, fill color.

An image in vector format simplifies the editing process, since the image can be scaled, rotated, and deformed without loss. Moreover, each transformation destroys the old image (or fragment), and a new one is built in its place. This presentation method is good for diagrams and business graphics. When encoding a vector image, it is not the image of the object itself that is stored, but the coordinates of the points, using which the program recreates the image each time.

Main disadvantage vector graphics is inability to produce photographic quality images. In vector format, the image will always look like a drawing.

Raster graphics. Any picture can be divided into squares, thus obtaining raster - two-dimensional array squares. The squares themselves - raster elements or pixels(picture's element) - elements of a picture. The color of each pixel is encoded with a number, which allows you to specify the order of color numbers (from left to right or top to bottom) to describe the picture. The number of each cell in which the pixel is stored is recorded in memory.

Drawing in raster format

Each pixel is assigned brightness, color, and transparency values, or a combination of these values. A raster image has a number of rows and columns. This storage method has its drawbacks: a larger amount of memory required for working with images.

The volume of a raster image is determined by multiplying the number of pixels by the information volume of one point, which depends on the number of possible colors. IN modern computers The following screen resolutions are mainly used: 640 by 480, 800 by 600, 1024 by 768 and 1280 by 1024 pixels. The brightness of each point and its coordinates can be expressed using integers, which allows the use of binary code to process graphics data.

In the simplest case (a black and white image without grayscale), each point on the screen can have one of two states - “black” or “white”, that is, 1 bit is needed to store its state. Color images are generated according to the binary color code of each pixel stored in video memory. Color images can have different color depths, which are determined by the number of bits used to encode the color of the dot. The most common color depths are 8, 16, 24, 32, 64 bits.

To encode color graphic images, an arbitrary color is divided into its components. The following coding systems are used:

HSB (H - hue, S - saturation, B - brightness),

RGB (Red - red,Green - green, Blue- blue) And

CMYK ( C yan - blue, Magenta - purple, Yellow - yellow and Black - black).

The first system is convenient for person, the second - for computer processing, and the last one is for printing houses. The use of these color systems is due to the fact that the luminous flux can be formed by radiation that is a combination of “pure” spectral colors: red, green, blue or their derivatives.

Fractal is an object whose individual elements inherit the properties of parent structures. Since a more detailed description of smaller-scale elements occurs using a simple algorithm, such an object can be described with just a few mathematical equations. Fractals allow you to describe images that require relatively little memory to represent in detail.

Drawing in fractal format

3D graphics (3D) operates with objects in three-dimensional space. Three-dimensional computer graphics are widely used in cinema and computer games, where all objects are represented as a set of surfaces or particles. All visual transformations in 3D graphics are controlled using operators having a matrix representation.

Encoding of audio information

Music, like any sound, is nothing more than sound vibrations, which, having registered, can be reproduced quite accurately. To represent an audio signal in computer memory, it is necessary to represent the received acoustic vibrations in digital form, that is, convert them into a sequence of zeros and ones. Using a microphone, sound is converted into electrical vibrations, after which the amplitude of the vibrations can be measured at regular intervals (several tens of thousands of times per second) using a special device - analog-to-digital converter (ADC). To reproduce sound, a digital signal must be converted to analog using digital-to-analog converter (DAC). Both of these devices are built into sound card computer. The indicated sequence of transformations is presented in Fig. 2.6..

Transformation of an analog signal into a digital signal and vice versa

Every sound measurement is recorded in binary code. This process is called sampling (sampling), performed using an ADC.

Sample (sample English sample) is the time interval between two measurements of the amplitude of an analog signal. In addition to a period of time, a sample is also called any sequence of digital data that is obtained through analog-to-digital conversion. An important parameter sampling is frequency - the number of measurements of the analog signal amplitude per second. Audio sampling rate range from 8000 to 48000 measurements per second.

Graphical representation of the sampling process

Playback quality is affected sampling rate and resolution(the size of the cell allocated for recording the amplitude value). For example, recording music to CDs uses 16-bit values ​​and a sampling rate of 44032 Hz.

By hearing, a person perceives sound waves with a frequency ranging from 16 Hz to 20 kHz (1 Hz - 1 vibration per second).

In the Audio DVD CD format, the signal is measured 96,000 times in one second, i.e. A sampling frequency of 96 kHz is used. To save hard disk space in multimedia applications, lower frequencies are often used: 11, 22, 32 kHz. This leads to a decrease in the audible frequency range, which means that what is heard is distorted.

Information coding is the process of converting information from a form convenient for direct use into a form convenient for transmission, storage or automatic processing.

Encoding text information

To record textual (character) information, some kind of language (natural or formal) is always used.

The entire set of symbols used in a language is called alphabet. Total number of alphabet characters N call him power. When writing text, any of the following may appear in each position: N characters of the alphabet, i.e. it can happen N events. Therefore, each character of the alphabet contains i bit of information where i is determined from the inequality (Hartley formula): 2 i N. Then the total amount of information in the text is determined by the formula:

V = k * i ,

Where V– amount of information in the text; k– the number of characters in the text (including punctuation marks and even spaces), i- the number of bits allocated for encoding one character.

Since each bit is a 0 or a 1, any text can be represented as a sequence of zeros and ones. This is how text information is stored in computer memory. Assigning a particular binary code to an alphabet character is a matter of convention, recorded in a code table. Currently, code tables are widely used ASCII And Unicode.


ASCII(American Standard Code for Informational Interchange) has been used for a long time. 8 bits are allocated to store the code of one character, therefore, the code table supports up to 28 = 256 characters. The first half of the table (128 characters) contains control characters, numbers and letters of the Latin alphabet. The second half is reserved for symbols of national alphabets. Unfortunately, currently there are as many as five variants of code tables for Russian letters (KOI-8, Windows-1251, ISO, DOS, MAC), so texts created in one encoding are displayed incorrectly in another. (You've probably come across Russian-language sites whose texts look like a meaningless set of characters?).

Unicode- has become widespread in recent years. 16 bits are allocated to store the code of one character, therefore, the code table supports up to 216 = 65536 characters. This space is enough to unite all “living” official (state) writings in one standard. By the way, the ASCII standard became part of Unicode.

If coding is the translation of information from one language to another (recording in a different symbol system, in a different alphabet), then decoding– reverse translation.

When encoding, one character of the original message can be replaced by one character of the new code or several characters, or vice versa - several characters of the original message are replaced by one character in the new code (Chinese characters denote entire words and concepts), so the encoding can be uniform And uneven. With uniform encoding, all symbols are encoded with codes of equal length; with uneven encoding, different symbols can be encoded with codes of different lengths, which makes decoding difficult.

decode from beginning, if fulfilled Fano condition: no codeword is the beginning of another codeword. The encoded message can be unambiguously decode from end, if fulfilled inverse Fano condition: no codeword is the end of another codeword. The Fano condition is a sufficient but not necessary condition for unambiguous decoding.

Solving problems on coding text information

1. The automatic device recoded an information message in Russian with a length of 20 characters, originally written in a 2-byte Unicode code, into an 8-bit KOI-8 encoding. By how many bits did the message length decrease? Write down only the number in your answer.

Solution:

1) with 16-bit encoding, the message volume is 16*20 bits

2) when it was recoded into an 8-bit code, its volume became equal to 8*20 bits

3) thus, the message was reduced by 16*20 – 8*20 = 8*20 = 160 bits

Answer: 160

2. Determine the information volume of the text in bits

Bambarbia! Kergudu!

Solution:

1) this text contains 19 characters (be sure to count spaces and punctuation marks)

2) if not additional information, we assume that an 8-bit encoding is used (most often it is explicitly indicated that the encoding is 8- or 16-bit), so the message contains 19*8 = 152 bits of information

Answer: 152

3. The table below shows the part code table ASCII:

Symbol

Decimal code

Hex code

What is the hexadecimal code for the character "q"?


Solution:

1) in the ASCII code table, all capital Latin letters A-Z are arranged in alphabetical order, starting with the character with code 65=4116

2) all lowercase Latin letters a-z arranged alphabetically, starting with the symbol with code 97=6116

3) it follows that the difference in the codes of the letters “q” and “a” is equal to the difference in the codes of the letters “Q” and “A”, that is, 5116 – 4116 = 1016

4) then the hexadecimal code of the character “q” is equal to the code of the letter “a” plus 1016

5) from here we find 6116 + 1016 = 7116.

Answer: 71

4. To encode a certain sequence consisting of the letters A, B, C, D and D, a non-uniform binary code is used, which makes it possible to unambiguously decode the resulting binary sequence. Here is the code: A-00, B-010, B-011, G-101, D-111. Is it possible to shorten the length of the codeword for one of the letters so that the code can still be decoded unambiguously? The codes of the remaining letters should not change. Select correct option answer.

1) for the letter B - this is impossible

3) for the letter B – for the letter G – 01

Solution(1 way - checking Fano conditions):

3) for unambiguous decoding it is enough that one of the Fano conditions is satisfied: the direct or inverse Fano condition;

4) check options 1, 3 and 4 sequentially; if none of them are suitable, you will have to choose option 2 (“this is impossible”);

3) check option 1: A–00, B–01, C–011, G–101, D–111.

the “direct” Fano condition is not satisfied (the code of the letter B coincides with the beginning of the code of the letter B);

the “reverse” Fano condition is not satisfied (the code of the letter B coincides with the end of the code of the letter G); therefore this option is not suitable;

4) check option 3: A–00, B–010, C–01, G–101, D–111.

the “direct” Fano condition is not satisfied (the code of the letter B coincides with the beginning of the code of the letter B);

the “reverse” Fano condition is not satisfied (the code of the letter B coincides with the end of the code of the letter G); therefore this option is not suitable;

5) check option 4: A–00, B–010, C–011, G–01, D–111.

the “direct” Fano condition is not satisfied (the code of the letter G coincides with the beginning of the codes of the letters B and C); But the “inverse” Fano condition is satisfied(the code of the letter G does not coincide with the end of the codes of the other letters); therefore this option is suitable;

Answer: 4

Solution(2 way, wood):

1) build a binary tree in which two branches depart from each node, corresponding to the choice of the next code digit - 0 or 1; Let's place the letters A, B, C, D and D on this tree so that their code is obtained as a sequence of numbers on the edges that make up the path from the root to this letter (the code of the letter B is highlighted in red - 011):

https://pandia.ru/text/78/419/images/image003_52.gif" width="391" height="166">DIV_ADBLOCK100">

3) but we don’t need the parity bit at all not needed, something else is important: the fifth bit in each five can be discarded!

4) divide the given sequence into groups of 5 bits each:

01010, 10010, 01111, 00011.

5) discard the fifth (last) bit in each group:

0101, 1001, 0111, 0001.

These are the binary codes of the transmitted numbers:

01012 = 5, 10012 = 9, 01112 = 7, 00012 = 1.

6) thus, the numbers 5, 9, 7, 1 or the number 5971 were transmitted.

Answer: 2

Training objectives:

1) The automatic device recoded the information message in Russian, originally recorded in 16-bit code Unicode, to 8-bit encoding
KOI-8. At the same time, the information message was reduced by 800 bits. What is the length of the message in characters?

2) The table below shows part of the ASCII code table:

Symbol

Decimal code

Hex code

What is the hexadecimal code for the character "p"?

3) A text document consisting of 3072 characters was stored in 8-bit KOI-8 encoding. This document has been converted to 16-bit Unicode. Indicate how many additional KB you will need to store the document. Write down only the number in your answer.

4) To encode the letters A, B, C, D, we decided to use two-digit sequential binary numbers (from 00 to 11, respectively). If you encode the sequence of GBAV symbols in this way and write the result in the hexadecimal number system, you get:

5) For 5 letters of the Latin alphabet, their binary codes are given (for some letters - from two bits, for some - from three). These codes are presented in the table:

Determine which set of letters is encoded by a binary string

1) baade 2) badde 3) bacde 4) bacdb

6) To encode the letters A, B, C, D, three-bit sequential binary numbers starting with 1 (from 100 to 111, respectively) are used. If you encode the CDAB character sequence in this way and write the result in hexadecimal code, you get:

1) А5СD16 4) DE516

7) For 6 letters of the Latin alphabet, their binary codes are specified (for some letters, two bits, for some, three). These codes are presented in the table:

Determine which sequence of 6 letters is encoded in a binary string.

8) To encode a message consisting only of the letters A, B, C and D, a binary code of uneven length is used:

If you encode the sequence of characters GAVBVG in this way and write the result in hexadecimal code, you get:

1) 62DD2) 6213316

9) To transmit a message over a communication channel consisting only of the letters A, B, C, D, they decided to use a code of uneven length: A=1, B=01, B=001. How should the letter G be encoded so that the code length is minimal and the encoded message can be unambiguously divided into letters?

10) To transmit numbers over a noisy channel, a parity check code is used. Each of its digits is written in binary representation, with leading zeros added to a length of 4, and the sum of its elements modulo 2 is added to the resulting sequence (for example, if we transmit 23, we get a sequence). Determine what number was transmitted over the channel in the form?

11) To encode a certain sequence consisting of the letters A, B, C, D and D, a non-uniform binary code is used, which makes it possible to unambiguously decode the resulting binary sequence. Here is the code: A-10, B-11, B-000, G-001, D-011. Is it possible to shorten the length of the codeword for one of the letters so that the code can still be decoded unambiguously? The codes of the remaining letters should not change. Choose the correct answer.

1) this is impossible 2) for the letter B – 1

3) for the letter G – for the letter D – 01

12) To encode a certain sequence consisting of the letters A, B, C, D and D, we decided to use a non-uniform binary code, which allows us to unambiguously decode the binary sequence appearing on the receiving side of the communication channel. Code used: A–111, B–110, C–100, D–101. Indicate what code word can be used to encode the letter D. The code must satisfy the property of unambiguous decoding. If more than one codeword can be used, enter the shortest one.

13) To transmit a message over a communication channel consisting only of the letters A, B, C, D, they decided to use a code of uneven length: A=1, B=000, B=001. How should the letter G be encoded so that the code length is minimal and the encoded message can be unambiguously divided into letters?

Encoding graphic information

Conversion of graphic information from analogue to discrete form is carried out by sampling, i.e., dividing a continuous graphic image into individual elements. The sampling process involves encoding, i.e., assigning each element a specific value in the form of a code.

Sampling it is the transformation of a continuous image into a set of discrete values ​​in the form of a code.

During the image encoding process, spatial sampling. Spatial sampling of an image can be compared to constructing an image from a mosaic. The image is divided into separate small fragments (dots), each of which is assigned a color code.

As a result of spatial discretization, graphic information is presented in the form bitmap. A raster image consists of a certain number of lines, each of which contains a certain number of dots (pixels).

Image quality depends on resolution.

The resolution of a raster image is determined by the number of horizontal dots (X) and the number of vertical dots ( Y) per unit image length.

The smaller the dot size, the greater the resolution (more raster lines and dots per line) and, accordingly, the higher the image quality.
The resolution value is expressed in (dot per inch - dots per inch), i.e., the number of dots in an image strip 1 inch long (1 inch = 2.54 cm). Digitization of graphic images from paper or film is done using a scanner. Scanning is performed by moving photosensitive elements along the image. Scanner characteristics are expressed in two numbers, for example 1200x2400 dpi. The first number determines the number of photosensitive elements per inch of the strip and is the optical resolution. The second is the hardware resolution and determines the number of microsteps when moving one inch along the image.

The sampling process can use different color palettes. Each color can be considered as a possible state of a point. The number of colors N in the palette and the amount of information for encoding the color of each point are related to each other by the well-known Hartley formula: N=2I, where I is the color depth, and N is the number of colors (palette).

The amount of information that is used to encode the color of a point in an image is called depth colors. The most common color depth values ​​are the values ​​from the table:

Table. Color depth and number of colors displayed.

Color depth (i)

Number of displayed colors (N)

The quality of the image on the monitor screen depends on the size spatial resolution and color depth. The spatial resolution of a monitor screen is defined as the product of the number of image lines and the number of pixels per line. Resolution can be: 800x600, 1024x768, 1152x864 and higher. The number of colors displayed can vary from 256 colors to more than 16 million.

Video memory

Point number

Binary dot color code

.........................................................................................

..........................................................................................

Rice. Formation of a raster image on the screen.

Let's consider an example of the formation of a raster image on the monitor screen, consisting of 600 lines of 800 dots in each line (total dots) and a color depth of 8 bits. The binary color code of all points is stored in the computer's video memory, which is located on the video card.

Periodically, with a certain frequency, the color codes of the dots are read from video memory and the dots are displayed on the monitor screen. The image reading frequency affects the stability of the image on the screen. In modern monitors, the image is updated at a frequency of 75 or more times per second, which ensures a comfortable user experience.

Information volume of required video memory can be calculated using the formula:

V =I · X · Y,

where V is the information volume of video memory in bits;
X Y - number of image pixels (screen resolution);
I - color depth in bits per dot.

For example, the required amount of video memory for graphics mode with a resolution of 800x600 pixels and 24-bit color depth is:

V =I · X · Y= 24 x 800 x 600 = bit = 1 byte.

The color image on the monitor screen is formed by mixing the basic colors: red, green and blue ( RGB palette). To obtain a rich palette of colors, the base colors can be set to different intensities. For example, with a color depth of 24 bits, 8 bits are allocated for each color, i.e. for each color, N=28=256 intensity levels are possible, specified in binary codes from minimum to maximum.

Table. Formation of some colors at a color depth of 24 bits.

Name

Intensity

Color is often written as #RRGGBB, where RR is the hex code for the red color component, GG is the hex code for the green color component, and BB is the hex code for the blue color component. The higher the component value, the greater the glow intensity of the corresponding base color. 00 – no glow, FF – maximum glow (FF16=25510), 8016 – average brightness value. If the component has color intensity<8016 , то это даст темный оттенок, а если >=8016, then light.

For example,

#FF0000 – red color (the red component is maximum, and the rest are zero)

#000000 – black color (no components light up)

#FFFFFF – white color (all components are maximum and identical, the brightest color)

#404040 – dark gray color (all components are the same and the values ​​are less than the average brightness value)

#8080FF – light blue (the blue component has the maximum brightness, and the brightness of the other components is the same and equal to 8016).

Solving problems on encoding graphic information

1. To store a raster image of 32x32 pixels, 512 bytes of memory were allocated. What is the maximum possible number of colors in the image palette?

Solution: When encoding with a palette, the number of bits per 1 pixel ( K) depends on the number of colors in the palette N, they are related by the formula: https://pandia.ru/text/78/419/images/image005_31.gif" width="71" height="21 src="> (2), where is the number of bits per pixel, and – total number of pixels.

1) find the total number of pixels https://pandia.ru/text/78/419/images/image009_17.gif" width="61" height="19">bytebytebitbit

3) determine the number of bits per pixel: #ХХХХХХ", where in quotes are given hexadecimal values intensity of color components in the 24-bit RGB model.

What color will the page color specified by the tag be close to? ?

1) white 2) gray 3) yellow 4) purple

Solution: The highest color intensity (99) is found in the red and blue components. This produces a purple color.

Answer: 4

3. What is the width (in pixels) of a rectangular 64-color unpacked bitmap that occupies 1.5 MB of disk space if its height is half the width?

Solution: Since the amount of memory for the entire image is calculated using formula (1), where is the number of bits per pixel, and https://pandia.ru/text/78/419/images/image014_12.gif" width="36" height=" 41 src=">.

64=26. From here K= 6.

Substitute these values ​​into formula (1), we get:

*6=1.5*220*23. After reduction: x2 = 222. From here: x= 211=2048.

ABOUTanswer: 4

Training objectives:

1. To store a raster image measuring 128 x 128 pixels, 4 kilobytes of memory were allocated. What is the maximum possible number of colors in the image palette?

2. To encode the background color of an Internet page, use the bgcolor="#ХХХХХХ" attribute, where hexadecimal values ​​of the intensity of color components in the 24-bit RGB model are specified in quotes. What color will the color of the page specified by the tag be close to? ?

1) yellow 2) pink 3) light green 4) light blue

3. What is the width (in pixels) of a rectangular 16-color unpacked bitmap that occupies 1 MB of disk space if its height is twice its width?

Encoding of audio information

Sound is a sound wave with continuously varying amplitude and frequency. The greater the amplitude of the signal, the louder it is; the higher the frequency, the higher the tone. In order for a computer to process sound, a continuous audio signal must be converted into a sequence of electrical pulses (binary ones and zeros).

In the process of encoding a continuous audio signal, its time sampling is performed. In this case, the sound wave is divided into small temporary sections, for each of which the amplitude value is set.

Time sampling – a process in which, during encoding of a continuous audio signal, the sound wave is divided into separate small time sections, and for each such section a certain amplitude value is set. The greater the amplitude of the signal, the louder the sound.

On the graph (see figure) this looks like replacing a smooth curve with a sequence of “steps”, each of which is assigned a volume level value. The more volume levels allocated during the encoding process, the better the sound will be.

Rice. Time sampling of audio

Audio depth (encoding depth) -number of bits per audio encoding.

Volume levels (signal levels)- sound can have different volume levels. The number of different volume levels is calculated using Hartley's formula: N= 2 I WhereI– sound depth, and N – volume levels.

Modern sound cards provide 16-bit audio encoding depth. The number of different signal levels can be calculated using the formula: N=216=65536. Thus, modern sound cards provide encoding of 65536 signal levels. Each amplitude value is assigned a 16-bit code.

When binary coding a continuous audio signal, it is replaced by a sequence discrete levels signal. The quality of encoding depends on the number of measurements of the signal level per unit time, i.e., the sampling frequency. The greater the number of measurements taken in 1 second (the higher the sampling frequency), the more accurate the binary coding procedure.

Sampling frequency number of level measurements input signal per unit of time (per 1 second). The higher the sampling rate, the more accurate the binary encoding procedure. Frequency is measured in Hertz (Hz).

1 measurement per 1 second -1 Hz, 1000 measurements per 1 second 1 kHz.

Let's denote the sampling rate by the letterF. For encoding, choose one of three frequencies:44.1 KHz, 22.05 KHz, 11.025 KHz.

It is believed that the range of frequencies that a person hears is from 20 Hz to 20 kHz.

The quality of binary audio encoding is determined by the encoding depth and sampling rate.

The sampling frequency of an analog audio signal can range from 8 kHz to 48 kHz. At a frequency of 8 kHz, the quality of the sampled audio signal corresponds to the quality of a radio broadcast, and at a frequency of 48 kHz, the quality of the sound of an audio CD. It should also be taken into account that both mono and stereo modes are possible.

Audio adapter (sound card) – a device that converts electrical vibrations of sound frequency into a numerical binary code when inputting sound and vice versa (from a numerical code into electrical vibrations) when playing sound.

Audio adapter specifications:sampling frequency and register bit depth.

Register size - number of bits in the audio adapter register. The larger the bit depth, the smaller the error of each individual value conversion electric current to a number and back. If the bit depth is I, then when measuring the input signal 2 can be obtainedI = Ndifferent meanings.

Digital mono audio file size (A) is measured by the formula:

A=F*T* I/8 ,

WhereF –sampling frequency (Hz),T– time of sound playing or recording,I register width (resolution). According to this formula, the size is measured in bytes.

Digital stereo audio file size (A) is measured by the formula:

A=2* F* T* I/8 ,

the signal is recorded for two speakers, since the left and right sound channels are encoded separately.

Example. Let's try to estimate the information volume of a stereo audio file with a sound duration of 1 second at high quality audio (16 bit, 48 kHz). To do this, the number of bits must be multiplied by the number of samples per second and multiplied by 2 (stereo):

16 bits*48,000 *2 = 1,536,000 bits = 192,000 bytes = 187.5 KB

Table 1 shows how many MB an encoded one minute of audio information will occupy at different sampling rates:

Signal type

Sampling frequency, kHz

16 bit, stereo

16 bit, mono

8 bit, mono

Examples of tasks:

1. Determine the size (in bytes) of a digital audio file whose playing time is 10 seconds at a sampling rate of 22.05 kHz and a resolution of 8 bits. The file is not compressed.

Solution:

Formula for calculating size (in bytes) digital audio file: A= F* T* I/8.

To convert to bytes, the resulting value must be divided by 8 bits.

22.05 kHz =22.05 * 1000 Hz =22050 Hz

A= F* T* I/8 = 22050 x 10 x 8 / 8 = 220500 bytes.

Answer: 220500

2. The user has a memory capacity of 2.6 MB at his disposal. It is necessary to record a digital audio file with a sound duration of 1 minute. What should the sampling frequency and bit depth be?

Solution:

Formula for calculating the sampling frequency and bit depth: F* I = A/T

(memory capacity in bytes) : (sounding time in seconds):

2.6 MB = 26 bytes

F* I =A/T= 26 bytes: 60 = 45438.3 bytes

F=45438.3 bytes: I

The adapter width can be 8 or 16 bits. (1 byte or 2 bytes). Therefore the sampling frequency can be either 45438.3 Hz = 45.4 kHz ≈ 44.1 kHz– standard characteristic sampling frequency, or 22719.15 Hz = 22.7 kHz ≈ 22.05 kHz- standard characteristic sampling rate

Answer:

Sampling frequency

Audio adapter capacity

1 option

Option 2

3. The amount of free memory on the disk is 5.25 MB, the bit depth of the sound card is 16. What is the duration of the sound of a digital audio file recorded with a sampling frequency of 22.05 kHz?

Solution:

Formula for calculating sound duration: T=A/F/I

(memory capacity in bytes) : (sampling frequency in Hz) : (sound card capacity in bytes):

5.25 MB = 5505024 bytes

5505024 bytes: 22050 Hz: 2 bytes = 124.8 sec
Answer: 124,8

4. Calculate how many bytes of information one second of stereo recording occupies on a CD (frequency 44032 Hz, 16 bits per value). How long does one minute take? What is the maximum disk capacity (assuming a maximum duration of 80 minutes)?

Solution:

Formula for calculating memory size A= F* T* I:
(recording time in seconds) * (sound card capacity in bytes) * (sampling frequency). 16 bits -2 bytes.
1) 1s x 2 x 44032 Hz = 88064 bytes (1 second stereo recording on a CD)
2) 60s x 2 x 44032 Hz = 5283840 bytes (1 minute of stereo CD recording)
3) 4800s x 2 x 44032 Hz = byte = 412800 KB = 403.125 MB (80 minutes)

Answer: 88064 bytes (1 second), 5283840 bytes (1 minute), 403.125 MB (80 minutes)

Training objectives:

1) Single-channel (mono) sound recording is performed with a sampling frequency of 22 kHz and a coding depth of 16 bits. The recording lasts 2 minutes, its results are written to a file, data compression is not performed. Which of the following numbers is closest to the size of the resulting file, expressed in megabytes?

2) Two-channel (stereo) sound recording is performed with a sampling frequency of 48 kHz and a coding depth of 24 bits. The recording lasts 1 minute, its results are written to a file, data compression is not performed. Which of the following numbers is closest to the size of the resulting file, expressed in megabytes?

3) Single-channel (mono) sound recording was carried out with a sampling frequency of 16 kHz and 24-bit resolution. The result was a 3 MB file; no data compression was performed. Which of the following values ​​is closest to the time during which the recording was made?

1) 30 sexsecsec

4) Single-channel (mono) sound recording is performed with a sampling frequency of 128 Hz. 64 sampling levels were used during recording. The recording lasts 6 minutes 24 seconds, its results are written to a file, and each signal is encoded with the minimum possible and the same number of bits. Which of the numbers below is closest to the size of the resulting file, expressed in kilobytes?

5) Two-channel (stereo) sound recording is performed with a sampling frequency of 16 kHz and a coding depth of 32 bits. The recording lasts 12 minutes, its results are written to a file, and no data compression is performed. Which of the following numbers is closest to the size of the resulting file, expressed in megabytes?

Lesson topic: "Coding of text information".

Item: Computer Science and ICT.

Class: 8

Teacher: Strokach Natalya Petrovna

Lesson outline

Equipment : computer, multimedia projector, blackboard, student workstations (personal computers), textbook “Informatics and ICT. 9th grade" N.D. Ugrinovich.

Lesson type : combined.

Forms of work : frontal, collective, individual.

Material for the lesson: presentation, code tables (ASCII, 5 code tables of the Russian language:Windows, ISO, Mac, MS- DOS, KOI-8), task sheets practical work.

Lesson objectives:

Educational:

    Introduce the concepts of textual information;

    to form in students an idea of ​​how text information is encoded in computer memory;

    Learn to determine a character code and a character by code using code tables and a text editor. Learn to encode and recode text information.

Educational:

    Development of logical thinking, attention, memory;

    Development of sustainable cognitive interest among students;

Educational:

    Formation of interest in the subject, formation of a worldview;

    Fostering a culture of behavior in the classroom and listening skills.

Requirements for knowledge and skills:

Students should know:

    The principle of encoding text information;

    ASCII encoding table structure.

Students should be able to:

    Encode and decode characters using a code table;

Lesson plan:

    Organizational moment (3 min)

    Updating knowledge

    Learning new material - read the presentation (15 min)

    Fixing the material. Completing tasks (17 min)

    Testing, grading, homework (5 min)

Lesson progress:

    Organizational moment.

    Statement of a cognitive task

Question:

    What types of information can a computer process? (numeric, graphic, text, audio, video)

Question:

    In what form is information presented in computer memory? (in binary)

Question:

    How is graphic information converted from analog to discrete? (by spatial sampling, the image is divided into pixels)

Question:

    How is sound converted to digital form? (using time sampling)

Question:

    What information do you think a person most often processes using a computer?

Currently, most of the personal computers in the world (both in number and in time) are busy processing text information.(slide 1,2)

3. Message of the topic, conveying the objectives of the lesson

Today the topic of our lesson is: “Coding text information”(slide 3,4).

Purpose of the lesson (slide 5)

    Get acquainted with the concepts of coding text information, code table.

    Learn to determine a character code and a character by code using text editors.

4.Introduction of new knowledge.

Question:

    How many characters are needed to encode text information?

Let's use the "estimation" method. To do this, we need to remember what symbols we use in writing.

33*2(uppercase and lowercase) + 10(numbers) + 10(punctuation) = 86 characters.

    Question:

Are all texts in Russian? What characters should I add to my keyboard?

For the English alphabet 26 + 26 = 52;

It turns out that 127 characters are needed. There are still 129 values ​​left that can be used to indicate punctuation marks, arithmetic marks, service operations (line feed, space, etc.).

The set of all symbols with which text is written is called the alphabet. (Slide 6)

The number of characters in an alphabet is called its cardinality. (slide7)

So, the keyboard has 256 characters. The computer must be able to recognize all of these characters and convert them into binary code.(slide 8)

    Question:

How does a computer differentiate between characters?

The computer distinguishes symbols by a combination of electrical impulses - the binary code of the symbol

How many bits of information can be encoded for 1 character if there are 256 such characters?

Let's remember the formulaN=2 i . (slide 9)

256=2 8 Therefore, 1 character is encoded in 8 bits or 1 byte.(slides 10,11,12).

The binary code of each character can be written as a decimal number.

    )Question:

Can you tell which words are coded by the numbers on the board?(slide 13)

65; 112; 112; 108; 101

200; 216; 228; 224

Question: What is needed to be able to decode these words? (Tables for translation)

Take the table from the edge of the table and tell me what the first word you came up with (Apple)

What's the second word? A problematic situation has arisen - tables with codes greater than 127, five. And according to different code tables, different words are obtained. (Code – according to ISO table)

Code table – a table in which the correspondence between numeric codes and symbols is established. (Slide No. 14)

There is an internationally accepted code table called ASCII (American Standard Code for Information Interchange). information exchange. (Slide No. 15)

Parts of the ASCII code table:

0-32 are commands and function keys;

33-127 – international part (Latin);

128-255 – national part.

Historically, the national part of the code tables appeared inconsistently in different countries and in different operating systems. ISO and KOI-8 code tables appeared in the USSR. The MS-DOS code table was developed for the operating system Microsoft systems DOS, Windows code table - for the operating system Microsoft Windows. Mac code table used in operating rooms Mac systems OS.

Currently there are 5 encoding tables for Russian letters (Windows, MS-DOS, KOI-8, Mac, ISO), so texts created in one encoding will not display correctly in another.

Russian encodings (Cyrillic): (Slide No. 16)

Windows

MS- DOS,

KOI-8,

Mac,

ISO.

Question: Why do you think the last character in the code table is numbered 255, and earlier it was said that there are 256 codes. (Because the numbering starts from 0.)

Sometimes it becomes necessary to use more than two languages ​​in one text document. For example, when printing text on geometry, you may need Russian symbols, Latin letters, and Greek letters. What to do in such a situation?

There are approximately 6,800 different languages ​​in the world. If you read text printed in Japan on a computer in Russia or the USA, you will not be able to understand it. So that the letters of any country can be read on any computer, inIn 1991, a new code standard was proposed, where 2 bytes of memory were allocated for each character.

The code table was called Unicode (Slide No. 17)

There are 65536 characters in the Unicode code table (Slide No. 18)

Unicode includes almost all modern scripts, including: Arabic, Armenian, Bengali, Burmese, Greek, Georgian, Devanagari, Hebrew, Cyrillic, Coptic, Khmer, Latin, Tamil, Hangul, Han (China, Japan, Korea), Cherokee, Ethiopian, Japanese (katakana, hiragana, kanji) and others.

For academic purposes, many historical scripts have been added, including: ancient Greek, Egyptian hieroglyphs, cuneiform, Mayan writing, and the Etruscan alphabet.

Unicode provides a wide range of mathematical and musical symbols and pictograms.

Notebook entry: (Slide No. 19)

Code tables:

ASCII

Unicode

Number of bytes per character

1 byte

2 bytes

Number of characters

256

65536

So, let's conclude: the same code in different code tables gives different characters.

5. Practical work

Remember the objectives of the lesson.

The first goal is to get acquainted with the concept of coding text information, a code table. Tell me, have we achieved this goal? (Yes )

We also set goals for ourselves, which the practical work “Coding Text Information” will help us achieve. (Slide No. 21)

What goals will we set for ourselves in practical work? (Learn to encode text information, learn to determine a character code and a character by code using code tables and a text editor )

Practical work consists of two parts:

The first part consists of three tasks and is performed on a computer:

Read the tasks that need to be completed on the computer. What program will we use to complete these tasks? (Text editors MS Word and Notepad).

Now in front of you on the screen is a text editor window. (Slide No. 22)

We will determine the symbol code and find the symbol by code by inserting special symbols (Insert → Symbols).

When selecting the required symbol, we see its numeric code in the lower right corner of the window. All symbols in the table are ordered by ascending numeric codes, so you can find a symbol with a given numeric code.

You need to write down all the results in a notebook.

Do you have questions about completing practical work? (No).

You can start completing tasks on your computers. Take notebooks and pens. Do not forget about safety rules and maintaining health when working at the computer.

Students do work on computers, the teacher observes, helps, corrects the work, and ensures correct seating at the computer.

Students who have completed the first part turn off their computers, return to their desks and complete the second part of the practical work.

The teacher monitors the work and helps if difficulties arise.

Result:

« WORD»

200 205 212 206 208 204 192 210 200 202 192- “INFORMATICS” in “Windows»

STUDENT

“Notepad”: abvgdezhiy rstufhtchshshch I want to study

The second part consists of two tasks and is completed in notebooks using code tables: (slide 23)

204 224 242 229 236 224 242 232 247 229 241 234 232 233 32 235 232 246 229 233

    Masha sent her friend Olya a letter written in Windows encoding, and Olya read it in ISO encoding. The result was a meaningless phrase: “Yayuchf№rtyўў!” Help Olya read the letter.

For those who can complete the tasks faster, the work offers an additional task: Encode the phrase “I came, I saw, I conquered” in ISO encoding.

3. Additional task

Using the Windows code table, decode the phrase:

205 229 32 246 226 229 242 251 130 224 32 226 255 237 243 242

205 229 32 235 224 228 238 248 232 130 32 224 32 232 236 232 245 235 238 239 224 254 242

205 229 32 225 229 235 252 184 130 32 224 32 232 245 32 240 224 231 226 229 248 232 226 224 254 242

205 224 32 237 232 245 32 236 238 230 237 238 32 226 229 248 224 242 252 32 235 224 239 248 243

Divide the children into 4 groups of 3 people. Give each group 1 line. When all students complete the task, their completion is checked. Each of the four options has encoded lines from the riddle.

Not flowers, but withering
Not clapping hands, but clapping them,
Not laundry, but they are hung out
You can hang noodles on them.

Students take turns reading their versions of the text. Let's guess together!

6. Lesson summary

Let's summarize the lesson.

Answer the following questions about the lesson material: (Slide No. 25)

    What is needed to encode text information on a computer? (Code table)

    What is the name of the international code table? (ASCII)

    How many Russian language encodings are there? (Five)

    For what purpose was Unicode introduced, which allows you to encode 65,536 different characters?(to encode not only Russian and Latin alphabets, numbers, signs and mathematical symbols, but also Greek, Arabic, Hebrew and other alphabets).

Let's remember the objectives of the lesson: (Slide No. 26)

    Get acquainted with the concept of coding text information, code table.

    Learn to encode and recode text information using code tables.

    Learn to determine a character code and a character by code using a text editor.

Question: Have we achieved these goals? (Yes, we reached it)

Grading for the lesson.

7. Homework

Recording homework in diaries or notebooks: (Slide No. 27)

    Textbook, pp. 49 – 52, paragraph 2.1.

    Test questions on page 52

    Tasks for independent completion No. 2.1., 2.2.

8.Reflection

Students are given an individual card in which they need to highlight phrases that characterize the student’s work in the lesson in three areas.

Lesson

I'm in class

Bottom line

1. interesting

1. worked

1. understood the material

2. boring

2. rested

2. learned more than I knew

3.don't care

3.helped others

3. didn’t understand

Encoding text information

Purpose of the work: learn to identify numeric character codes, enter characters using numeric codes using encodingWindows, Unicode(Unicode).

Work order:

Task 1.

Determining the numeric code of a character using a text editor Word .

    Launch a text editorWordcommand [Programs/MicrosoftWord]

    Enter the command [insert/symbol]. A dialog box will appear on the screenSymbol . To determine the numeric code of a character in the encodingWindows from: select encoding typeCyrillic (dec.).

    Sign code: The decimal numeric code of the character will appear (in this case 192).

    To determine the hexadecimal numeric code of a character in the encodingUnicodeusing dropdown listfrom: select encoding type Unicode (hex)

    In the symbol table, select a symbol (for example, the capital letter “A”). In a text fieldSign code: The hexadecimal numeric code of the character will appear (in this case 0410).

Task2.

Entering a character using numeric codes in text editor Notebook

    Launch the standard Notepad application with the command [Programs/Accessories/Notepad]

    Alt) enter the number 0224, release the key (Alt), the symbol “a” will appear in the document. Repeat the procedure for numeric codes from 0225 to 0233, a sequence of 12 characters “abvgdezhy” will appear in the documentin encoding Windows .

    Using the optional numeric keypad while pressing (Alt) enter the number 224, the symbol “p” will appear in the document. Repeat the procedure for numeric codes from 225 to 233, a sequence of 12 characters “rstufhtchshshch” will appear in the documentin encoding MS - DOS

Task 3:

    Using encodingWindowsMicrosoftWordencode the wordINFORMATICS

    Using encodingUnicodelocated in a text editorMicrosoftWorddecode the word0423 0427 0415 041 D 0418 041A

    Using encodingWindows, located in the Notepad application, decode the sentence:

0255 0032 0245 0238 0247 0243 0032 0243 0247 0232 0242 0252 0241 0255

Piyaeva Olga Nikolaevna

Place of work: municipal budgetary educational institution "Taraskovskaya secondary school"

Job title: computer science teacher

School address: Moscow region, Kashira district, Taraskovo village, Komsomolskaya street, 22

Grade: 8

Lesson topic: Coding of text information. (first lesson on the topic “Encoding information”)

Lesson type: learning new knowledge

Lesson type: traditional using information technology

    Goals:

Educational:

    introduce students to ways of encoding information in a computer;

    consider examples of problem solving;

Developmental:

    promote the development of students' cognitive interests.

Educational:

    cultivate endurance and patience in work, a sense of camaraderie and mutual understanding.

Tasks:

Educational:

    to form students’ knowledge on the topic “Coding text information”;

Developmental:

    develop skills of analysis and self-analysis;

    promote the formation of imaginative thinking in schoolchildren;

Educational:

    develop the ability to plan your activities.

Equipment:

    student workplaces (personal computer),

    teacher's workplace,

    multimedia projector,

Software: PC, PowerPoint, tables, diagrams.

Lesson Information Card:

p/p

Lesson stage

At-

measure-

new time

Didactic

what's the goal

Forms and methods of work

Types of student activities

Organizational

moment

2 min

Include students in the business rhythm, prepare the class for work

Teacher's oral message

Productivity mindset

new activity

ness

Studying

new

material

18 min

Form cognitive motives. Ensure that students accept the purpose of the lesson. To form specific ideas about the coding of text information.

Explanation of new material using

presentation

Listening and memorizing, answering the teacher’s questions, completing a decoding task

information

Physical education minute

2 min.

Prevent children from getting tired

Doing exercises

Doing exercises

Consolidation of acquired knowledge

10 min.

Organize activities to apply new knowledge

Practical work

Execution of practical

good work

Initial check of understanding

8 min

Identify the level of primary assimilation of new material

Frontal survey

Differentiated independent work

Answer the teacher's questions

Perform independent work

Homework

2 min.

Provide information on homework and instructions for completing it.

Homework instructions

Recording homework in diaries

Summing up the lesson (reflection)

3 min.

Self-analysis of students' understanding of the topic

Acceptance of an unfinished proposal

Discussion of what we learned and how we worked

Progress of the lesson.

Organizational moment.

Guys, I’m glad to see you in full force, in a good mood and I hope for a fruitful lesson.

Sit down.

Now we will conduct a lesson readiness raid:

    show the diaries

    show me your pens

    show me the textbooks

    show me your notebooks

Everything is ready for the lesson, we can start.

Learning new material

Today we are starting to study the big topic “Coding and processing of text information”, and our first lesson is called “Coding text information”
On the screen is the first slide of a multimedia presentation with the topic of the lesson.

In today's lesson we will get acquainted with text encoding techniques that were invented by people at various stages of the development of human thought, with binary coding of information in a computer, we will learn to determine numeric character codes, enter characters using numeric codes and convert Russian-language text in a text editor.

The problem of information security has worried people for several centuries.

Codes appeared in ancient times in the form of cryptograms (which translated from Greek means “secret writing”). Sometimes sacred Jewish texts were encrypted using the substitution method. Instead of the first letter of the alphabet, the last letter was written, instead of the second, the penultimate one, etc. this ancient cipher was called atbash.

Show slide number 2

Here are several text encoding techniques that were invented at various stages of the development of human thought.

- cryptography- this is secret writing, a system of changing writing in order to make the text incomprehensible to the uninitiated;

- Morse code or an uneven telegraph code, in which each letter or sign is represented by its own combination of short elementary bursts of electric current (dots) and elementary bursts of triple duration (dash);

- sign gestures– sign language used by people with hearing impairments.

Question: What other examples of encoding text information can be given?

Students give examples . ( Viginère cipher, substitution cipher)

Show slide number 3

One of the earliest known encryption methods is named after the Roman emperor Julius Caesar (1st century BC). This method is based on replacing each letter of the encrypted text with another, by shifting the alphabet from the original letter by a fixed number of characters. So the word byte when shifted three characters to the right, it is encoded as a word dgmh . The reverse process of deciphering a given word is necessary to replace each encrypted letter with the third one to the left of it.

Show slide number 4

In Ancient Greece (2nd century BC) a cipher was known that was created using the Polybius square. For encryption, a table was used, which was a square with six columns and six rows, which were numbered from 1 to 6. One letter was written in each cell of such a table. As a result, each letter corresponded to a pair of numbers, and encryption was reduced to replacing the letter with a pair of numbers. The first digit indicates the row number, the second – the column number. The word byte is encoded in this case as follows: 12 11 25 42

Show slide number 5.

Decipher the following phrase using Polybius square

"33 11 35 36 24 32 16 36 11 45 43 51 24 32 41 63"

Question: What did you get?

Student response: We learn from examples

The answer is compared with the correct answer that appears on slide No. 5.

Binary coding of text information in a computer

Teacher: Information expressed using natural and formal languages ​​in written form is usually called text information.

Show slide number 6.

To represent text information (uppercase, lowercase letters of the Russian and Latin alphabets, numbers, signs and mathematical symbols), 256 different characters are sufficient.

If you add up all the signs:

33 lowercase letters of the Russian alphabet + 33 uppercase letters = 66;

For the Latin alphabet 26 + 26 = 52;

Numbers from 0 to 9

It turns out that 127 characters are needed. There are still 129 values ​​left that can be used to indicate punctuation marks, arithmetic marks, service operations (line feed, space, etc.)

Show slide number 7

According to the formula N = 2 I we can calculate how much information is needed to encode each character:

N = 2 I  256 = 2 I  2 8 = 2 II= 8 bits

To process text information on a computer, it is necessary to represent it in a binary sign system. We have calculated that encoding each character requires 8 bits of information, i.e. the length of the binary code of the character is eight binary characters. Each character must be assigned a unique binary code from the range from 00000000 to 11111111 (in decimal code from 0 to 255).

When text information is entered into a computer, it is binary encoded. The user presses a sign key on the keyboard, and a certain sequence of eight electrical pulses (binary sign code) is sent to the computer. In the process of displaying on a computer screen, reverse recoding is performed, i.e. converting binary code into its image.

Show slide number 8

Assigning a particular binary code to a character is a matter of convention, which is recorded in the code table. An international agreement has been adopted to assign each character its own unique code. The ASCII code table (American Standard Code for Information Interchange) has been adopted as an international standard.

This table presents codes from 0 to 127 (letters of the English alphabet, symbols of mathematical operations, service symbols, etc.), and codes from 0 to 32 are assigned not to symbols, but to function keys.

Write down the name of this code table and the range of characters to be encoded.

Codes 128 to 255 are allocated to the national standards of each country. This is sufficient for most developed countries.

Several different code table standards have been introduced for Russia (codes 128 to 255).

Show slide number 9.

Here are some of them. Let's look at and write down their names:

KOI - 8 , Windows MS-DOS , Mas, ISO.

There are approximately 6,800 different languages ​​in the world. If you read text printed in Japan on a computer in Russia or the USA, you will not be able to understand it. So that the letters of any country could be read on any computer, two bytes (16 bits) were used to encode them.

Let us also determine the number of characters that can be encoded according to this standard:

N = 2 I = 2 16 = 65536

this number of characters is enough to encode not only the Russian and Latin alphabets, but also Greek, Arabic, Hebrew and other alphabets.

Physical education minute

Now let’s do some physical education: first, use the tip of your nose to write figuratively on the ceiling “I like computer science.”

Exercise for the eyes:

    Blink quickly, close your eyes and sit quietly, slowly counting to 5. Repeat 4-5 times.

    Extend your right arm forward. Follow with your eyes, without turning your head, the slow movements of the index finger of your outstretched hand to the left and right, up and down. Repeat 4-5 times.

    Look at the index finger of your outstretched hand for the count of 1-4, then move your gaze into the distance for the count of 1-6. Repeat 4-5 times.

    At an average pace, make 3-4 circular movements with your eyes to the right side, and the same amount to the left side. Relax your eye muscles and look into the distance while counting 1-6. Repeat 1-2 times.

Consolidation of acquired knowledge.

It’s not for nothing that the Roman fabulist Phaedrus said: “Science is the captain, and practice is the soldiers.” Therefore, now let's move from theory to practice.

Open the textbook on page 152, find practical work No. 8, read it.

Write down in your notebook the topic of practical work “Coding text information”, the purpose of the work: to learn how to determine numeric character codes, enter characters using numeric codes and convert Russian-language text in a text editor.

Turn on your computers and we'll get this job done together.

Task No. 1. In the Word text editor, determine the numeric codes of several characters:

    in Windows encoding;

    in Unicode encoding (Unicode)

    Launch Word text editor

    enter the command (Insert – Symbol...). The Symbol dialog box will appear on the screen. The central part of the dialog panel is occupied by a table of symbols.

    To determine the decimal numeric code of a character in Windows encoding using the drop-down list from: select the encoding type Cyrillic (dec.).

    Select a symbol in the symbol table. The character's decimal code appears in the Character Code: text box.

    To define a hexadecimal numeric code in Unicode using the drop-down list from: select the Unicode encoding type (hex).

    Select a symbol in the symbol table. The hexadecimal numeric code for the character appears in the Character Code: text box.

    Using an electronic calculator, convert the hexadecimal numeric code into decimal system notation:

0586 16 = X 10; 1254 16 = X 10; 8569 16 = X 10;

Task No. 2. In the text editor Notepad, enter a sequence of characters in Windows and MS-DOS encodings using numeric codes.

    1. Launch the standard Notepad application with the command (Program - Standard - Notepad).

      Using the additional numeric keypad, while pressing the  Alt  key, enter the number 0224, release the  Alt  key, the symbol “a” will appear in the document. Repeat the procedure for numeric codes from 0225 to 0233, a sequence of 10 “abvgdezhy” characters in Windows encoding will appear in the document.

      Using the additional numeric keypad, while pressing the  Alt  key, enter the number 224, release the  Alt  key, the symbol “p” will appear in the document. Repeat the procedure for numeric codes from 225 to 233, a sequence of 10 characters “rstufhtchshshch” in MS – DOS encoding will appear in the document.

Initial check of understanding

Teacher Questions

1. What principle of encoding text information is used in a computer? (When text information is entered into a computer, it is binary encoded. The user presses a sign key on the keyboard, and a certain sequence of eight electrical pulses (binary sign code) is sent to the computer. In the process of displaying it on the computer screen, reverse recoding is performed, i.e. converting binary code to its image.)

2. What is the name of the international character encoding table?( ASCII(American Standard Code for Information Interchange - American standard code For exchange information )

3. List the names of encoding tables for Russian characters. (KOI - 8, MS - DOS , Mas, ISO , Windows )

The teacher distributes cards with individual tasks. (Petya and Kolya write to each other emails in KOI encoding - 8. One day Petya made a mistake and sent a letter in Windows encoding. Kolya received the letter and, as always, read it in KOI-8. The result was a meaningless text in which the word ****** was often repeated. What word was in the original text of the letter?

Option 1 – ULBOET (scanner)

Option 2 - RBNSFSH (memory)

Option 3 – RTYOFET (printer)

Option 4 – DYULEFB (floppy disk)

Option 5 – FTELVPM (trackball)

Option 6 – NPOYFPT (monitor)

Option 7 – RTPGEUUPT (processor)

Option 8 – LMBCHYBFHTB (keyboard)

Option 9 – NBFETYOULBS RMBFB ( motherboard)

Option 10 – FBLFPCHBS YBUFPFB RTPGEUUPTB ( clock frequency processor)

Homework

According to the textbook by N. Ugrinovich, paragraph 3.1. pp. 74 - 77

Encode your first and last name in code KOI - 8. Write the result as:

    binary code

    decimal code

Additional task (on card): decrypt the text using KOI -8 encoding:

254 212 207 194 205 213 196 210 207 214 201 218 206 216 208 210 207 214 201 212 216, 218 206 193 212 216 206 193 196 207 194 206 207 206 197 205 193 204 207,

228 215 193 215 193 214 206 217 200 208 215 193 215 201 204 193 218 193 208 207 205 206 201 196 204 209 206 193 222 193 204 193:

244 217 204 213 222 219 197 199 207 204 207 196 193 202, 222 197 205 222 212 207 208 207 208 193 204 207 197 211 212 216,

233 204 213 222 219 197 194 213 196 216 207 196 201 206, 222 197 205 215 205 197 211 212 197 21 203 197 205 208 207 208 193 204 207.

(To live your life wisely, you need to know a lot,

Two important rules remember for starters:

You're better off starving than eating crap

    Computer Science and information Technology. Textbook for 8th grade / N.D. Ugrinovich. - M. BINOM. Laboratory of Knowledge, 2011. – 205 pp.: ill.

    Journal "Informatics and Education", No. 4, 2003, No. 6, 2006

    Computer science 7 – 9 grades. / A.G. Kushnirenko, G.V. Lebedev, Ya.N. Zaidelman, M.: Bustard, 2001. – 336 pp.: ill.


Close