Download presentation on binary coding. Presentation on the topic: "Binary coding of character information" presentation for a lesson in informatics and ict (grade 10) on the topic. Binary coding of text information


2 Table of contents Binary coding in a computer Analog and discrete form of information representation Analog and discrete form of information representation Binary coding of graphic images Binary coding of graphic images Binary coding of audio Binary coding of video information Binary coding text information


3 Binary coding in a computer All information that a computer processes must be represented by a binary code using two digits: 0 and 1. These two characters are usually called binary digits or bits. A computer must be organized: encoding and decoding Encoding - converting input information into the form perceived by the computer, i.e. binary code Decoding - converting data from binary code to a human-readable form Hello!


4 Why binary coding It is convenient to encode information as a sequence of zeros and ones, if these values ​​are represented as two possible stable states of an electronic element: 0 - no electrical signal; 1 - the presence of an electrical signal. The disadvantage of binary coding is long codes. But in technology it's easier to deal with big amount simple elements than with a small number of complex ones. The ways of encoding and decoding information in a computer, first of all, depend on the type of information, namely, what should be encoded: numbers, text, graphic images or sound.


5 Analogue and discrete form of information representation A person is able to perceive and store information in the form of images (visual, sound, tactile, gustatory and olfactory). visual images can be stored in the form of images (drawings, photographs, and so on), and sound ones are recorded on records, magnetic tapes, laser disks, and so on. Information, including graphic and sound, can be presented in analog or discrete form. a quantity takes on an infinite set of values, and its values ​​change continuously In a discrete representation, a physical quantity takes on a finite set of values, and its value changes stepwise


6 Analog and discrete form of information representation An example of analog and discrete representation of information: the position of a body on an inclined plane and on a ladder is given by the values ​​of the X and Y coordinates. When a body moves along an inclined plane, its coordinates can take on an infinite number of continuously changing values ​​from a certain only a certain set of values ​​\u200b\u200bup the stairs, and changing abruptly


7 Discretization An example of analog representation graphic information painting, the color of which changes continuously, and discrete image printed with inkjet printer and consisting of individual dots of different colors An example of analog storage sound information is a vinyl record (the sound track changes its shape continuously), and a discrete audio CD (the sound track of which contains sections with different reflectivity) continuous (analogue) audio signal to individual elements. In the process of discretization, encoding is performed, that is, assigning a specific value to each element in the form of a code. Discretization is a transformation continuous images and sound into a set of discrete values ​​in the form of codes






10 Step 1. Discretization: pixelization. Bitmap encoding Step 2. A single color is determined for each pixel. A pixel is the smallest element in a picture for which a color can be independently set. Resolution: pixels per inch, dots per inch (dpi) screen 96 dpi, print dpi, print 1200 dpi


11 True Color Raster Coding Step 3. From Color to Numbers: Model RGB color = R + G + B red red blue blue green green R = 218 G = 164 B = 32 R = 135 G = 206 B = 250 Step 4. Numbers - in the binary system. How much memory is needed to store the color of 1 pixel? ? How many different colors can be encoded? ? 256 256 256 = (True Color) R: 256=2 8 choices, need 8 bits = 1 byte R G B: 3 bytes total Color Depth


12 RGB color model Color images can have different color depths, which is given by the number of bits used to encode the color of a point. If we encode the color of one point of the image with three bits (one bit for each RGB color), then we get all eight different colors.


13 True Color In practice, to store information about the color of each point of a color image in the RGB model, 3 bytes (i.e. 24 bits) are usually allocated - 1 byte (i.e. 8 bits) for the color value of each component. Thus, each RGB component can take a value in the range from 0 to 255 (total 2 8 = 256 values), and each point of the image, with such a coding system, can be painted in one of the colors. This set of colors is commonly called True Color (true colors ), because the human eye is still not able to distinguish a greater variety


14 Calculate the amount of video memory In order for an image to be formed on the monitor screen, information about each point (the color code of the point) must be stored in the video memory of the computer Those. total 1280 * 1024 = dots. With a color depth of 32 bits per point, the required amount of video memory: 32 * = bits = bytes = 5120 KB = 5 MB


15 Raster coding (True Color) CMYK-model Subtractive (subtractive), used when preparing images for printing on a professional printer and serves as the basis for four-color printing technology. The color components of this model are the colors obtained by subtracting the primary ones from white: cyan (Cuan) = white - red = green - blue; purple (Magenta) = white - green = red + blue; yellow (Yellow) \u003d white - blue \u003d red + green. The problem of the SMU color model: in practice, no paint is absolutely pure and necessarily contains impurities; superimposing complementary colors on top of each other in practice does not give pure black. Therefore, a pure black component was included in this color model.




17 Coding of vector images A vector image is a set of graphic primitives (point, segment, ellipse…). Each primitive is described by mathematical formulas. Application Environment Envy Coding by Dignity vector graphics is that files that store vector graphics are relatively small. It is also important that vector graphics can be enlarged or reduced without loss of quality.


18 Vector drawings Constructed from geometric shapes: segments, polylines, rectangles, circles, ellipses, arcs smooth lines (Bezier curves) For each figure, the following are stored in memory: dimensions and coordinates in the figure color and border style fill color and style (for closed figures) Formats Files: WMF (Windows Metafile) CDR (CorelDraw) AI ( Adobe Illustrator)FH (Freehand)


19 Vector drawings The best way for storing drawings, diagrams, maps; when encoding there is no loss of information; there is no distortion when resizing; smaller file size, depends on the complexity of the picture; not effective for photos and blurry images


20 Graphic formats File Formats graphic files determine the method of storing information in a file (raster or vector), as well as the form of information storage (compression algorithm used) The most popular raster formats: BMP GIF JPEG TIFF PNG


21 Bit Map image (BMP) graphic file formats universal format bitmap graphic files, used in the operating Windows system. Supported by many graphic editors, including Paint editor. Recommended for storing and exchanging data with other applications Tagged Image File Format (TIFF) is a raster image file format supported by all major graphics editors and computer platforms. Includes a lossless compression algorithm. Used to exchange documents between different programs. Recommended for use with publishing systems


22 Graphic file formats Graphics Interchange Format (GIF) is a raster graphic file format supported by applications for various operating systems. Includes a lossless compression algorithm that allows you to reduce the file size by several times. Recommended for storing images created programmatically(diagrams, graphs, and so on) and drawings (application type) with a limited number of colors (up to 256). Used to place graphics on Web pages on the Internet. Portable Network Graphic (PNG) is a raster graphics file format similar to the GIF format. The Joint Photographic Expert Group (JPEG) is a raster graphics file format that implements an efficient compression algorithm (JPEG method) for scanned photographs and illustrations for placing graphics on Web pages on the Internet. The compression algorithm allows you to reduce the size of the file dozens of times, however, it leads to the irreversible loss of some information. Supported by applications for various operating systems. Used to place graphics on Web pages on the Internet


23 Questions and tasks: What types of computer images do you know? Which maximum amount colors can be used in the image, if 3 bits are allocated for each point? What do you know about the RGB color model? Calculate the required amount of video memory for graphics mode: screen resolution 800 x 600, color quality 16 bit.




25 Sound coding Sound is a wave with continuously changing amplitude and frequency: the larger the amplitude, the louder it is for a person, the higher the frequency, the higher the tone Complex continuous sound signals can be represented with sufficient accuracy as the sum of a certain number of simple sinusoidal oscillations Each sinusoid, can be precisely specified by some set of numerical parameters - amplitude, phase and frequency, which can be considered as a sound code at some point in time


26 Temporal sampling of sound In the process of encoding an audio signal, its temporal sampling is performed - a continuous wave is divided into separate small time sections and a certain amplitude value is set for each such section. Thus, the continuous dependence of the signal amplitude on time is replaced by a discrete sequence of loudness levels


27 The quality of binary audio coding is determined by the coding depth and sampling rate. Sampling frequency - the number of signal level measurements per unit of time The number of volume levels determines the encoding depth. Modern sound cards provide 16-bit audio encoding depth. In this case, the number of volume levels is N = 2 I = 2 16 = 65536




29 Presentation of video information Processing of video information requires very high speed computer system What is a film in terms of computer science? First of all, it is a combination of sound and graphic information. In addition, to create the effect of movement on the screen, a discrete technology for quickly changing static pictures is used. Studies have shown that if more than one frame is replaced in one second, then the human eye perceives changes in them as continuous.


30 Representation of video information When using traditional methods of storing information, the electronic version of the film will turn out to be too large. An obvious improvement is to remember the first frame in its entirety (in the literature it is commonly called the key frame), and in the following ones, only differences from the initial frame (difference frames) are saved.


31 Some video file formats There are many different formats for representing video data. video for Windows based on universal files with the AVI extension (Audio Video Interleave - interleaving audio and video) Recently, video compression systems have become more widespread, allowing some distortions of the image that are invisible to the eye in order to increase the compression ratio. The most famous standard of this class is MPEG (Motion Picture Expert Group). The methods used in MPEG are not easy to understand and rely on rather complex mathematics. A technology called DivX (Digital Video Express) has become more widespread. Thanks to DivX, it was possible to achieve a compression ratio that made it possible to fit a high-quality recording of a full-length film onto one CD - compress a 4.7 GB DVD movie to 650 MB


32 Formats sound files MIDI - recording of musical works in the form of commands to a synthesizer, compact, do not reproduce a person's voice, (corresponding to a vector representation in graphics) WAV is a universal sound format, it stores full information about digitized sound (corresponds to the bmp format in graphics). Takes up a very large amount of memory (15 MB for 1 minute of sound) MP3 is an audio information compression format with adjustable loss of information that allows you to compress files several times depending on the specified bitrate (11 times on average). Even at the highest bit rate - 320 kbps - it provides 4 times compression compared to APE CDs - an audio information compression format without loss of information (and therefore quality), a compression ratio of about 2


33 Multimedia Multimedia (multimedia, from English multi - a lot and media - media, environment) computer technology, simultaneously using several information media: text, graphics, video, photography, animation, sound effects, high-quality sound accompaniment The word "multimedia" means the impact on the user through several information channels simultaneously. Multimedia is a combination of an image on a computer screen (including graphic animation and video frames) with text and sound. Multimedia systems are most widely used in the field of education, advertising, and entertainment.




35 Binary coding of textual information Since the 60s, computers have been increasingly used to process textual information, and at present most of the PCs in the world are occupied with the processing of textual information. Traditionally, to encode one character, the amount of information = 1 byte (1 byte = 8 bits) is used.




37 Binary coding of textual information Encoding consists in assigning a unique binary code from to to each character (or a decimal code from 0 to 255) It is important that assigning a specific code to a character is a matter of agreement, which is fixed by the code table


38 Encoding table A table in which serial numbers (codes) are assigned to all characters of the computer alphabet is called an encoding table. different types Computers use different encodings. With the spread of the IBM PC, the spreadsheet became an international standard. ASCII encodings(American Standard Code for Information Interchange) - American Standard Code for Information Interchange


39 ASCII encoding table Standard in this table is only the first half, ie. characters with numbers from 0 () to 127 (). This includes the letter of the Latin alphabet, numbers, punctuation marks, brackets and some other symbols. The remaining 128 codes are used in different versions. In Russian encodings, characters of the Russian alphabet are placed. Currently there are 5 different code tables for Russian letters (KOI8, СР1251, СР866, Mac, ISO). Currently, the new international standard Unicode has become widespread, which allocates two bytes for each character. With it, you can encode (2 16 =) different characters.


42 The most common currently used encoding is Microsoft Windows, abbreviated as CP1251 ("CP" stands for "Code Page", "code page").CP1251


45 The International Standards Organization (ISO) has approved another encoding called ISO ISO as a standard for the Russian language.


46


48 Information volume of the text Today, many people use computers to prepare letters, documents, articles, books, etc. text editors. Computer editors mainly work with an alphabet of 256 characters. In this case, it is easy to calculate the amount of information in the text. If 1 character of the alphabet carries 1 byte of information, then you just need to count the number of characters; the resulting number will give the informational volume of the text in bytes. Let a small book made with a computer contain 150 pages; 40 lines per page, 60 characters per line. So the page contains 40x60=2400 bytes of information. The volume of all information in the book: 2400 x 150 = bytes


49 Pay attention! Numbers are encoded according to the ASCII standard in two cases - during input-output and when they occur in the text. If the numbers are involved in calculations, then they are converted into another binary code (see the lesson "representing numbers in a computer"). Let's take the number 57. When used in the text, each digit will be represented by its own code in accordance with the ASCII table. In the binary system, this is - When used in calculations, the code of this number will be obtained according to the rules for converting to the binary system and we get -


50 Questions and tasks: What is the coding of textual information in a computer? Encode your last name, first name, class number using ASCII code. What message is encoded in Windows-1251 encoding: Assuming that each character is encoded by one byte, estimate the informational volume of the following sentence from Pushkin's quatrain: Singer-David was small in stature, But he knocked down Goliath!


51 Questions and tasks: Calculate the required amount of video memory for graphics mode: screen resolution 800 x 600, color quality 16 bit. To store a bitmap image of 64 * 64 pixels, 1.5 KB of memory was allocated. What is the maximum possible number of colors in an image's palette? Specify the minimum amount of memory (in KB) sufficient to store any 64*64 pixel bitmap if the image is known to use a palette of 256 colors. The palette itself does not need to be stored. How many seconds does it take for a modem transmitting messages at a bit/s rate to transmit a color bitmap of 800*600 pixels in size, provided that there are 16 million colors in the palette? A color image of 10*10 cm in size is scanned. The resolution of the scanner is 1200*1200 dpi, the color depth is 24 bits. What information volume will the resulting graphic file have?

Since the 60s, computers have been increasingly used for processing text information, and at present most of the PCs in the world are occupied with processing text information.

Traditionally, to encode one character, the amount of information = 1 byte (1 byte = 8 bits) is used.

Binary coding of text information

Encoding is that each character is assigned a unique binary code from 00000000 to 11111111 (or a decimal code from 0 to 255).

It is important that the assignment of a specific code to a symbol is a matter of agreement, which is fixed by the code table.

ASCII encoding table

Only the first half is standard in this table, i.e. characters with numbers from 0 (00000000) to 127 (0111111). This includes the letter of the Latin alphabet, numbers, punctuation marks, brackets and some other symbols.

The remaining 128 codes are used in different versions. In Russian encodings, characters of the Russian alphabet are placed.

IN currently there are 5 different code tables for Russian letters (KOI8, СР1251, СР866, Mac, ISO).

IN The new international standard Unicode is now in widespread use.

ASCII standard part table

Table

extended code

Note! !

Numbers are encoded according to the ASCII standard in two cases - during input-output and when they occur in the text. If the numbers are involved in the calculations, then they are converted to another binary code.

Let's take the number 57.

When used in text, each digit will be represented

its code in accordance with the ASCII table. In binary, this is 00110101 00110111 .

When used in calculations, the code of this number will be obtained according to the rules for converting to a binary system and we will get - 00111001.

To use the preview of presentations, create an account for yourself ( account) Google and sign in: https://accounts.google.com


Slides captions:

Binary coding

Discretization Discretization of information is the process of converting information from a continuous form of representation to a discrete one.

Discretization process Point # Coordinates 1 (2.1) 2 (5.4) 3 (0.7) …

Binary coding An alphabet is a finite set of distinct symbols (characters) used to represent information. The power of the alphabet is the number of symbols (characters) included in it.

Binary Encoding An alphabet containing two characters is called a binary alphabet.

Binary code 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Character sequence number 1 2 3 4 Two-digit binary code 00 01 10 11 Character sequence number 1 2 3 4 5 6 7 8 Three-digit binary code 000 001 010 011 100 10 1 110 111

The length of the binary chain - the number of characters in the binary code - is called the bit depth of the binary code. Binary coding Bit depth of binary code 1 2 3 4 5 6 7 8 9 10 Number of code combinations 2 4 8 16 32 64 128 256 512 1024 : N = 2i

Task The leader of the Multi tribe instructed his minister to develop a binary code and translate into it all important information. binary code what bit depth would be required if the alphabet used by the Multi tribe has 16 characters? Write down all code combinations. N = 16 i = ? N = 2 I 16 = 2 I 2 * 2 * 2 * 2 = 2 I 2 4 = 2 I i = 4

Uniform and non-uniform codes Uniform codes in code combinations contain the same number of characters, uneven - different! Morse code ASCII code table

Most importantly Discretization of information is the process of converting information from a continuous form of representation to a discrete one. The alphabet of a language is a finite set of distinct characters used to represent information. An alphabet containing two characters is called a binary alphabet.

To use the preview of presentations, create a Google account (account) and sign in: https://accounts.google.com


Slides captions:

Binary coding of symbolic information 12/17/2015 1 Prepared by: Informatics teacher MBOU secondary school No. 2, Lipetsk Kukina Ekaterina Sergeevna

2 In binary encoding of textual information, each character is assigned a unique decimal code from 0 to 255 or the corresponding binary code from 00000000 to 11111111. So a person distinguishes characters by their style, and a computer by their code.

According to the formula that relates the number of messages N and the amount of information i , you can calculate how much information is needed to encode each character 3

4 The assignment of a particular binary code to a symbol is a matter of agreement, which is fixed in the code table. The first 33 codes (from 0 to 32) do not correspond to characters, but to operations (line feed, space entry, etc.). Codes from 33 to 127 are international and correspond to the characters of the Latin alphabet, numbers, signs arithmetic operations and punctuation marks.

5 Codes 128 to 255 are national, i.e. in national encodings, different characters correspond to the same code. There are 5 one-byte code tables for Russian letters, so texts created in one encoding will not be displayed correctly in another.

6 Chronologically, one of the first standards for encoding Russian letters on computers was the KOI code - 8 ("Information exchange code - 8 bit"). This encoding is used on computers running the UNIX operating system.

7 The most common encoding is the standard Microsoft Windows Cyrillic encoding, abbreviated as CP1251 (“CP” stands for “Code Page”). All Windows applications that work with the Russian language support this encoding.

8 To work in the environment operating system MS-DOS uses an "alternative" encoding, Microsoft's terminology is CP 866 encoding.

9 Apple has developed its own encoding of Russian letters for Macintosh computers (Mac)

10 The International Standards Organization (ISO) has approved another encoding called ISO 8859-5 as the standard for the Russian language.

KOI - 8 - UNIX CP1251 ("CP" stands for "Code Page") - Microsoft Windows CP 866 - MS-DOS Mac - Macintosh ISO 8859 - 5 Encoding Standards 11

Character encoding table Binary code Decimal code KOI8 CP1251 CP866 Mac ISO 0000 0000 0 ……… 0000 1000 8 Delete last character (Backspace key) ……… 0000 1101 13 Line feed (Enter key) ……… 0010 0000 32 Space 0010 0001 33 ! ……… 0101 1010 90 Z ……… 0111 1111 127 ……… 128 - b A A K ……… 1100 0010 194 B V - - T ……… 1100 1100 204 L M: : b ……… 1101 1101 221 SH E - YON ……… 1111 1111 225 b i Nerraz. space Neraz. space n 12

13 Recently, a new international standard Unicode has appeared, which assigns not one byte, but two, to each character, and therefore it can be used to encode not 256 characters, 2 16 \u003d 65,536 different characters. This encoding is supported by editors starting from MS Office 97.

Task 1: identify the symbol by the numerical code. Start the NOTEPAD Press ALT and 0224 (on the optional numeric keypad). A will appear. Repeat this operation for numeric codes from 0225 to 0233. Characters in encoding (CP 1251 Windows) will appear. Write them down in a notebook. Press ALT and 161 (on the optional numeric keypad). b will appear. Repeat this operation for the numeric codes 160, 169, 226. Characters in the encoding (CP 866 MS-DOS) will appear. Write them down in a notebook. 14

Task 2: determine the numeric code for the characters Determine the numeric code to be entered while holding the Alt key to get the characters: ☼, §, $, ♀ Explanation: given code contained in the range from 0 to 50. 15

16 Thank you for your attention!