Format for presenting data on a computer. Data formats: representation and encoding of information in a computer. Raster data formats - PSD

There are two formats for presenting graphical information:

l raster;

l vector.

In a raster format, an image is stored in a file as a mosaic set of many dots corresponding to the pixels of the image displayed on the display screen. The file created by the scanner is in a raster format in the computer memory (the so-called bitmap). It is not possible to edit this file using standard text and graphic editors, because they do not work with mosaic representation of information.

In vector format, information is identified by the characteristics of fonts, character codes, paragraphs, etc. Standard word processors are designed to work with precisely this representation of information.

The fundamental difference between vector formats and raster formats can be shown with the following example: in a vector format, a circle is identified by its radius, the coordinates of its center, the thickness and type of line; The raster format simply stores sequential rows of dots that geometrically form a circle.

Raster graphics formats

PSD format– native format of Adobe Photoshop, image editing (supports all color models, layers without restrictions, and each layer can contain up to 24 alpha channels).

BMP format(bitmap) or DIB(device-independent bitmap) - a format for storing graphic images. Color depth from 1 to 48 bits per pixel - designed for Windows, allows the use of palettes of 2, 16, 256 or 16 million colors. There are several varieties of this format:

Regular, with extension .bmp;

Compressed, expanded .rle; compression occurs losslessly, but is supported
4- and 8-bit color only;



Device Independent Bitmap with extension .dib.

TGA format(Truevision Graphic Adapter) - for video images, maximally adapted to television standards, as well as for saving graphics on computers with the MS DOS operating system, supports 32-bit color.

TIFF format(Tagged Image File Format) is a universal graphic file format for digital images, the widest range of color reproduction from monochrome to the 24-bit RGB model and the 32-bit CMYK model, and is portable to different platforms. Format TIFF supports LZW- compaction without loss of information.

JPEG format(Joint Photographic Experts Group) - the most popular format for storing photographic images, including a standard for the Internet, provides compression of raster images up to 100 times (almost 5 to 15 times).

GIF format(Graphics Interchange Format) - a format for exchanging graphic information, provides a small file size, is used on the Internet, and is second only to the format in terms of compression ratio JPEG. The format is limited to a 256 color palette and is not very suitable for storing photographic images.

PNG format(Portable Network Graphics) – portable network graphics, based on a variation of the lossless compression algorithm (as opposed to GIF compresses raster images both horizontally and vertically), supports color graphic images with a color depth of up to 48 bits, and allows you to store complete information about the degree of transparency at each point of the image in the form of a so-called alpha channel.

Flashpix (FPX) format– a graphics format that allows you to save images at multiple resolutions for presentation on CD-ROM or on the Internet, allowing you to work with high-quality images without using a significant amount of memory and disk space. Some digital cameras save pictures in this format.

A bitmap requires a very large amount of memory to store it. Thus, a bitmap from one sheet of an A4 document (204297 mm) with a resolution of 10 dots/mm and without halftone transmission (line image) occupies about 1 MB of memory, and when reproducing 16 shades of gray - 4 MB, when reproducing a high-quality color image (HighColor standard - 65,536 colors) - 16 MB.

To reduce the amount of memory required to store bitmaps, various information compression methods are used. The most common raster compression algorithm, proposed by the International Telegraph and Telephone Consultative Committee CCITTGroup 4, gives an information compression ratio of up to 40:1 (depending on the content of the file - graphics are compressed much better than text).

Other compression formats used: CTIFF(CompressedTagged Image File Format) Group 3, MPEG family (Multimedia Photographics Experts Group), JPEG (Joint Photographics Experts Group), GIF (Graphics Interchange Format) and others.

Uncompressed formats: Uncompressed TIFF (Tagged Image File Format), BMP(BitMaP) and others.

The scanner is usually used in conjunction with image recognition programs - OCR (Optical Character Recognition). The OCR system recognizes the bit (mosaic) contours of characters read by the scanner from a document and encodes them with ASCII codes, translating them into a format convenient for text editors.

Some OCR systems must first be trained - templates and prototypes of recognized characters and their corresponding codes must be entered into the scanner's memory. Difficulties arise when distinguishing letters that have the same style in different alphabets (for example, in Latin (English) and in Russian - Cyrillic) and different font sets. But most systems do not require training: recognized characters are already stored in their memory. Thus, one of the best OCR - FineReader - recognizes texts in dozens of languages ​​(including Basic, C++, etc. programming languages), uses a large number of electronic dictionaries, checks spelling during recognition, prepares texts for publication on the Internet, etc. .

In recent years, intelligent image recognition programs such as Omnifont (for example, Cunei Form 2000) have appeared, which recognize characters not by points, but by the individual topology characteristic of each of them.

If there is an image recognition system, the text is written into the PC memory not in the form of a bitmap, but in the form of codes, and it can be edited with ordinary text editors.

It is reasonable to store files in raster format only if:

l documents and corresponding files should not be edited during their use;

l the document must be stored in the form of facsimile copies of the original (photos, drawings, documents with resolutions, etc.);

l there are technical capabilities for storing and viewing a large number of huge (1–20 MB) files.

Key factors to consider when choosing a scanner:

l the size, color and shape (sheet, bound, etc.) of documents to be scanned must correspond to the capabilities of the scanner;

l the resolution of the scanner must ensure the reproduction of high-quality copies of documents from their electronic images;

l the scanner performance must be high enough with acceptable quality of the resulting image;

l a minimum error in the dimensions of the resulting electronic image in relation to the original must be ensured if the dimensions of the image from the electronic document serve as the basis for making calculations;

l availability of software for compressing raster files when storing them in computer memory;

l availability of image recognition software (OCR) when storing vector files in computer memory;

l availability of software and hardware to improve image quality in raster files (increasing the contrast and brightness of the image, removing background “noise”);

l the quality and type of carrier paper, within certain limits, should not greatly affect the quality of the resulting electronic image;

l operation of the scanner should be convenient and simple and eliminate errors when scanning due to incorrect loading of the media;

l cost of the scanner.

The scanner can connect to a PC via parallel (LPT) or serial (USB) interfaces. To work with the scanner, the PC must have a special driver, preferably a driver that complies with the TWAIN standard. In the latter case, it is possible to work with a large number of TWAIN-compatible scanners and process files with programs that support the TWAIN standard, for example, common graphic editors CorelDraw, Adobe Photoshop, MaxMate, Picture Publisher, Photo Finish, etc.

Digitizers

A digitizer, or graphics tablet, is a device whose main purpose is to digitize images (Fig. 14.5).

Fig. 14.5. Digitizer.

It consists of two parts: a base (tablet) and a target designation device (pen or cursor) moved along the surface of the base. When you press the cursor button, its position on the tablet surface is fixed and the coordinates are transferred to the computer.

A digitizer can be used to enter a drawing created by the user into a computer: the user moves the cursor pen over the tablet, but the image does not appear on paper, but is captured in a graphic file. The operating principle of the digitizer is based on fixing the cursor location using a grid of thin conductors built into the tablet with a fairly large pitch between adjacent conductors (from 3 to 6 mm). The registration mechanism allows you to obtain a logical step for reading information, much smaller than the grid step (up to 100 lines per 1 mm).

TIFF (Tagged Image File Format). The format is designed for storing high-quality raster images (file name extension.TIF). It is widely used and is portable across platforms. (IBM PC and Apple Macintosh), is supported by most graphics, layout and design programs.

PSD (PhotoShop Document). Adobe Photoshop's own format (file name extension.PSD), one of the most powerful in terms of storage capabilities for raster graphic information. Allows you to remember the parameters of layers, channels, degrees of transparency, and many masks.

PCX, The format appeared as a format for storing raster data in the PC PaintBrush program from Z-Soft and is one of the most common (file name extension.PCX). The inability to store color-separated images, insufficient color models and other limitations led to the loss of popularity of the format. Currently considered obsolete.

PhotoCD. The format was developed by Kodak for storing high-quality digital raster images (file name extension.PCD). The format for storing data in the file itself is called Image Ras. The file has an internal structure that provides storage of images with fixed resolution values, and therefore the sizes of any files differ only slightly from each other and are in the range of 4-5 MB.

Windows Bitmap. The format for storing bitmap images in the Windows operating system (file name extension.BMP). Accordingly, it is supported by all applications running in this environment.

JPEG (Joint Photographic Experts Group). The format is intended for storing raster images (file name extension. JPG). Allows you to adjust the relationship between file compression rate and image quality. The compression methods used are based on removing “redundant” information, so the format is recommended to be used only for electronic publications.

GIF (Graphics Interchange Format). Standardized in 1987 as a means of storing compressed images with a fixed (256) number of colors (file name extension .GiF). Gained popularity on the Internet due to its high compression ratio. Latest format version GIF89a allows you to load images interlaced and create images with a transparent background.

PNG (Portable Network Graphics). A relatively new (1995) format for storing images for publishing on the Internet (file name extension .PNG). Three types of images are supported - color with a depth of 8 or 24 bits and black and white with the tradition of 256 shades of gray. Information compression occurs with virtually no loss, 254 alpha channel levels and interlaced scanning are provided.

WMF (Windows MetaFile). Windows operating system vector image storage format (file name extension.WMF). By definition, it is supported by all applications of this system. However, the lack of tools for working with standardized color palettes accepted in printing and other shortcomings limit its use.

EPS (Encapsulated PostScript). A format for describing both vector and raster images in the Adobe PostScript language, the de facto standard in the field of prepress processes and printing (file name extension. EPS). Since the PostScript language is universal, vector and raster graphics, fonts, clipping paths (masks), equipment calibration parameters, color profiles.

PDF (Portable Document Format). Document description format developed by Adobe (file name extension.PDF). Although this format is primarily intended for storing entire documents, its impressive capabilities allow for efficient presentation of images. The format is hardware-independent, so images can be displayed on any device - from a monitor screen to a photographic exposure device.

When working with numbers, the user can specify different formats for their presentation. You can change the output format of calculation results by selecting the File Preferences command. This will open the Preferences dialog box.

Make sure Command Window is selected from the list in the left pane. In this case, the Command Window Preferences panel will be displayed on the right. The number format is selected from the Numeric format drop-down list located in the Text display area of ​​this panel. The default format for this drop-down list is short.

To specify a different format for presenting calculation results, select its name in the Numeric Format list and click OK. This format will be used to display the results of all subsequent calculations until you change it.

The formats available in the Numeric Format drop-down list are described in the table

Example: represent the number 3/7 in different formats:

Format short – 0.4286

Format long – 0.42857142857143

Format short e – 4.2857e-001

Format long e – 4.285714285714286e-001

Format short g – 0.42857

Format long g – 0.428571428571429

Format bank - 0.43

Format rational – 3/7

It should be noted that numbers that are too large or too small when the short format is set can be displayed in exponential form, i.e. in floating point format.

You can also set the number format by entering the following command at the command line.

>> format format

Here format is the name of the required format. For example, to represent a number in hexadecimal form, enter the following command at the command line.

>> format hex

And to set the long representation of a number in floating point format, enter the following command.

>> format long

If you enter the command into the command line

>> help format

you can display in the command window information about all formats available in MATLAB

Changing the number output format only affects the display of numbers on the screen and does not in any way affect their true values.

  • II. THE ETERNAL IDEA OF GOD IN THE ELEMENT OF CONSCIOUSNESS AND REPRESENTATION, OR DISTINCTION; KINGDOM OF THE SON page 2
  • II. THE ETERNAL IDEA OF GOD IN THE ELEMENT OF CONSCIOUSNESS AND REPRESENTATION, OR DISTINCTION; KINGDOM OF THE SON Page 3
  • II. THE ETERNAL IDEA OF GOD IN THE ELEMENT OF CONSCIOUSNESS AND REPRESENTATION, OR DISTINCTION; KINGDOM OF THE SON page 4
  • II. The body as an integral system. Age periodization of development. General patterns of growth and development of the body. Physical development……………………………………………………………………………….p. 2
  • Algorithm for creating a theatrical performance script
  • All programs and data are stored in the long-term (external) memory of the computer in the form of files.

    File- this is a certain amount of information (program or data) that has a name and is stored in long-term (external) memory.

    File name. The file name consists of two parts, separated by a dot: the actual file name and the extension that determines its type (program, data, and so on). The actual name of the file is given by the user, and the file type is usually set automatically by the program when it is created (Table 4.2).

    Different operating systems have different filename formats. In the MS-DOS operating system, the file name itself must contain no more than 8 letters of the Latin alphabet, numbers and some special characters, and the extension consists of three Latin letters, for example: proba.txt

    In the Windows operating system, the file name can be up to 255 characters long, and you can use the Russian alphabet, for example: Information units.doc

    File system. Each storage medium (floppy, hard or laser disk) can store a large number of files. The order in which files are stored on disk is determined by the file system used.

    Each disk is divided into two areas: a file storage area and a directory. The directory contains the name of the file and an indication of where it begins on disk. If we draw an analogy between a disk and a book, the file storage area corresponds to its contents, and the directory corresponds to the table of contents. Moreover, a book consists of pages, and a disk consists of sectors.

    For disks with a small number of files (up to several dozen) can be used single-level file system, when the directory (disk table of contents) is a linear sequence of file names (Table 4.3). Such a catalog can be compared to the table of contents of a children's book, which contains only the titles of individual stories.

    If hundreds and thousands of files are stored on the disk, then for ease of searching, use multi-level hierarchical file system, which has a tree structure. Such a hierarchical system can be compared, for example, with the table of contents of a given textbook, which is a hierarchical system of sections, chapters, paragraphs and points.



    The initial, root directory contains subdirectories of the 1st level, in turn, each of the latter can contain subdirectories of the 2nd level, and so on. It should be noted that files can be stored in directories of all levels.

    For example, the root directory may contain two 1st level subdirectories (Directory_1, Directory_2) and one file (File_1). In turn, in the 1st level directory (Directory_1) there are two subdirectories of the second level (Directory_1.1 and Directory_1.2) and one file (File_1.1) - fig. 4.21.

    File systemis a file storage and directory organization system.

    Let's look at a hierarchical file system using a specific example. Each disk has a logical name (A:, B: - floppy disks, C:, D:, E: and so on - hard and laser disks).



    Let the root directory of drive C: have two 1st level directories (GAMES, TEXT), and the GAMES directory have one 2nd level directory (CHESS). At the same time, in the TEXT directory there is a file proba.txt, and in the CHESS directory there is a file chess.exe (Fig. 4.22).

    The path to the file. How to find existing files (chess.exe, proba.txt) in a given hierarchical file system? To do this, you need to specify the path to the file. The path to the file includes the logical name of the disk, written through the "\" separator, and a sequence of names of nested directories, the last of which contains the desired file. The paths to the above files can be written as follows:

    The path to the file along with the file name is sometimes called full file name.

    Example of a full file name:

    With \GAMES\CHESS\chess.exe

    Presentation of the file system using a graphical interface. The MS-DOS hierarchical file system containing directories and files is represented in the Windows operating system through a graphical interface in the form of a hierarchical system of folders and documents. A folder in Windows is analogous to an MS-DOS directory

    However, the hierarchical structure of these systems is somewhat different. In the MS-DOS hierarchical file system, the top of the object hierarchy is the root directory of the disk, which can be compared to the trunk of a tree on which branches (subdirectories) grow, and on the branches are leaves (files).

    In Windows, at the top of the folder hierarchy is the folder Desktop. The next level is represented by folders My computer, Trash And network(if the computer is connected to a local network) - fig. 4.23.

    The work was added to the site website: 2016-03-30

    Order writing a unique work

    formats for presenting data in computer memory. Machine codes

    Formats for presenting data in computer memory. Machine codes.

    " xml:lang="ru-RU" lang="ru-RU">Plan.

    1. " xml:lang="ru-RU" lang="ru-RU">
      1. " xml:lang="ru-RU" lang="ru-RU">Representing numbers in fixed-point form
      2. " xml:lang="ru-RU" lang="ru-RU">Representation of numbers in floating point form
    2. " xml:lang="ru-RU" lang="ru-RU">

    Formats for presenting data in computer memory.

    " xml:lang="ru-RU" lang="ru-RU">To represent numbers (data) in the computer memory, a certain number of bits are allocated." xml:lang="ru-RU" lang="ru-RU">In contrast" xml:lang="ru-RU" lang="ru-RU"> from the numbering of the digits of the number, the bits in a byte are numbered from left to right, starting from 0. Each byte in the computer memory has its own sequence number, which is called" xml:lang="ru-RU" lang="ru-RU">absolute byte addresses" xml:lang="ru-RU" lang="ru-RU">. The byte is the main unit of data storage; it is the smallest addressable unit of information exchange in the computer's RAM, that is, the minimum unit of information exchange that has an address in the computer's memory.

    " xml:lang="ru-RU" lang="ru-RU">A sequence of several adjacent bytes forms" xml:lang="ru-RU" lang="ru-RU">data field" xml:lang="ru-RU" lang="ru-RU">. The number of bytes of the field is called" xml:lang="ru-RU" lang="ru-RU">field length" xml:lang="ru-RU" lang="ru-RU">, and the address of the leftmost byte of the field is" xml:lang="ru-RU" lang="ru-RU">field address" xml:lang="ru-RU" lang="ru-RU">. Information can be processed either byte-by-byte or by data fields (or data format). Data formats show how information is placed in RAM and computer registers. Formats data is distinguished by length, data type and structure, and each value contained in a byte can be interpreted in different ways:

    • " xml:lang="ru-RU" lang="ru-RU">encoded representation of an external alphabet character (for data input and output);
    • " xml:lang="ru-RU" lang="ru-RU">integer signed or unsigned number (with internal representation of numbers in computer memory);
    • " xml:lang="ru-RU" lang="ru-RU">part of a command or a more complex unit of data, etc.

    " xml:lang="ru-RU" lang="ru-RU">On a computer there are the following forms of representing integers:" xml:lang="ru-RU" lang="ru-RU">half-word" xml:lang="ru-RU" lang="ru-RU">(byte)," xml:lang="ru-RU" lang="ru-RU"> word" xml:lang="ru-RU" lang="ru-RU"> (two consecutive bytes, numbered from left to right from 0 to 15)," xml:lang="ru-RU" lang="ru-RU">double" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">word" xml:lang="ru-RU" lang="ru-RU"> (4 bytes).

    " xml:lang="ru-RU" lang="ru-RU">If numbers are placed in the specified formats, then the weights of their digits increase from right to left.

    " xml:lang="ru-RU" lang="ru-RU">In a computer, it is used to represent numbers" xml:lang="ru-RU" lang="ru-RU">natural" xml:lang="ru-RU" lang="ru-RU"> (fixed point number representation) and" xml:lang="ru-RU" lang="ru-RU">semi-logarithmic" xml:lang="ru-RU" lang="ru-RU"> (representation of a floating point number) form.

    " xml:lang="ru-RU" lang="ru-RU">Representation of numbers in fixed form;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">h" xml:lang="ru-RU" lang="ru-RU">koy.

    " xml:lang="ru-RU" lang="ru-RU"> In the number representations used, the “comma” or “decimal point” is a conventional symbol, predetermined;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">a" xml:lang="ru-RU" lang="ru-RU">meant to separate the integer and fractional parts of a number. The comma therefore has an exact mathematical meaning, regardless of the number system used, and its position does not change the calculation algorithm at all or pho;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">р" xml:lang="ru-RU" lang="ru-RU">mu result.

    " xml:lang="ru-RU" lang="ru-RU">If the numbers being processed are of the same order of magnitude, you can fix the position of a comma or a period (this representation is called a fixed-point representation). Then when processing numbers in m;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">a" xml:lang="ru-RU" lang="ru-RU">the bus does not need to take into account the position (represent) of the decimal point. And then its position at the program level is considered the same and is taken into account only in the result.

    " xml:lang="ru-RU" lang="ru-RU">There are basically 2 ways to fix the decimal point:

    " xml:lang="ru-RU" lang="ru-RU">1) the point is located to the right of the lowest digit of the number, and we have c;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">e" xml:lang="ru-RU" lang="ru-RU">low numbers;

    " xml:lang="ru-RU" lang="ru-RU">2) the point is located to the left of the highest digit of the number, and we have fractional numbers in absolute value;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">a" xml:lang="ru-RU" lang="ru-RU">less than one.

    " xml:lang="ru-RU" lang="ru-RU">Positive integers can be represented directly in the binary number system (binary code). In this form of representation, binary arithmetic is easily implemented on a computer.

    " xml:lang="ru-RU" lang="ru-RU">If negative numbers are also needed, then the sign of the number can be encoded as a separate bit (usually the most significant bit). The most significant bit is signed if it contains" xml:lang="ru-RU" lang="ru-RU">1" xml:lang="ru-RU" lang="ru-RU">, then the number" xml:lang="ru-RU" lang="ru-RU">negative" xml:lang="ru-RU" lang="ru-RU">, if" xml:lang="ru-RU" lang="ru-RU">0" xml:lang="ru-RU" lang="ru-RU">, then the number" xml:lang="ru-RU" lang="ru-RU">positive" xml:lang="ru-RU" lang="ru-RU">.

    " xml:lang="ru-RU" lang="ru-RU">With a sixteen-bit grid we have:

    " xml:lang="ru-RU" lang="ru-RU">In the general case, the range of representation of integers is (" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU"> number of digits in the format):

    • " xml:lang="ru-RU" lang="ru-RU">for unsigned" xml:lang="ru-RU" lang="ru-RU">0;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">≤" xml:lang="en-US" lang="en-US">x" xml:lang="ru-RU" lang="ru-RU"> ≤ 2;vertical-align:super" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU"> (if" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">=8 from 0 to 255)
    • " xml:lang="ru-RU" lang="ru-RU">for symbolic" xml:lang="ru-RU" lang="ru-RU">-2;vertical-align:super" xml:lang="en-US" lang="en-US">n;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU">≤" xml:lang="en-US" lang="en-US">x" xml:lang="ru-RU" lang="ru-RU"> ≤ +2;vertical-align:super" xml:lang="en-US" lang="en-US">n;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU">(when" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">=8 from -128 to 127);

    " xml:lang="ru-RU" lang="ru-RU">Format

    " xml:lang="ru-RU" lang="ru-RU">Number of digits

    " xml:lang="ru-RU" lang="ru-RU">Range

    " xml:lang="ru-RU" lang="ru-RU">sign

    " xml:lang="ru-RU" lang="ru-RU">unsigned

    " xml:lang="ru-RU" lang="ru-RU">Byte

    " xml:lang="ru-RU" lang="ru-RU">8

    " xml:lang="ru-RU" lang="ru-RU">-128; 127

    " xml:lang="ru-RU" lang="ru-RU">0; 255

    " xml:lang="ru-RU" lang="ru-RU">Word

    " xml:lang="ru-RU" lang="ru-RU">16

    " xml:lang="ru-RU" lang="ru-RU">-32768; 32767

    " xml:lang="ru-RU" lang="ru-RU">0; 65535

    " xml:lang="ru-RU" lang="ru-RU">Double word

    " xml:lang="ru-RU" lang="ru-RU">32

    " xml:lang="ru-RU" lang="ru-RU">-2147483648; 2147483647

    " xml:lang="ru-RU" lang="ru-RU">0; 4294967295

    " xml:lang="ru-RU" lang="ru-RU">Fig. Format of unsigned integers

    " xml:lang="ru-RU" lang="ru-RU">Fig. Format of signed integers

    " xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-1

    " xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-2

    " xml:lang="ru-RU" lang="ru-RU">1

    " xml:lang="ru-RU" lang="ru-RU">0

    " xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-1

    " xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-2

    " xml:lang="ru-RU" lang="ru-RU">1

    " xml:lang="ru-RU" lang="ru-RU">0

    " xml:lang="ru-RU" lang="ru-RU">...

    " xml:lang="en-US" lang="en-US">S

    " xml:lang="ru-RU" lang="ru-RU">...

    " xml:lang="ru-RU" lang="ru-RU"> significant bits

    " xml:lang="ru-RU" lang="ru-RU">⌂

    " xml:lang="ru-RU" lang="ru-RU">binary point location

    " xml:lang="ru-RU" lang="ru-RU">^" xml:lang="ru-RU" lang="ru-RU">sign

    " xml:lang="ru-RU" lang="ru-RU"> significant bits

    " xml:lang="ru-RU" lang="ru-RU">⌂

    " xml:lang="ru-RU" lang="ru-RU">location

    " xml:lang="ru-RU" lang="ru-RU">binary point

    " xml:lang="ru-RU" lang="ru-RU">A significant disadvantage of this method of representation is the limited range of representation of values, which leads to overflow of the bit grid when it goes beyond the permissible limits and distortion of the result, for example, if we consider a five-digit sign grid, then when adding two numbers +22 and +13 n;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">o" xml:lang="ru-RU" lang="ru-RU">beam:

    " xml:lang="ru-RU" lang="ru-RU">Representation of numbers in floating form;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">h" xml:lang="ru-RU" lang="ru-RU">koy.

    " xml:lang="ru-RU" lang="ru-RU">Real numbers in mathematics are represented as finite or infinite fractions. However, in a computer, numbers are stored in registers and memory cells, which are a sequence of bytes with a limited number of digits. Consequently, infinite or very long numbers are truncated to a certain length and appear as approximations in computer representation.

    " xml:lang="ru-RU" lang="ru-RU">To represent real numbers, both very small and very large, it is convenient to use the form of writing numbers as a product:

    " xml:lang="ru-RU" lang="ru-RU">A =;font-family:"Arial"" xml:lang="ru-RU" lang="ru-RU">±" xml:lang="ru-RU" lang="ru-RU"> М·" xml:lang="en-US" lang="en-US">n;font-family:"Arial";vertical-align:super" xml:lang="ru-RU" lang="ru-RU">±;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">;vertical-align:super" xml:lang="en-US" lang="en-US">p

    " xml:lang="ru-RU" lang="ru-RU">where" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU"> - base of the number system;

    " xml:lang="en-US" lang="en-US">M" xml:lang="ru-RU" lang="ru-RU"> mantissa;

    " xml:lang="ru-RU" lang="ru-RU">р" xml:lang="ru-RU" lang="ru-RU"> an integer called" xml:lang="ru-RU" lang="ru-RU">in order" xml:lang="ru-RU" lang="ru-RU">(defines the location of the decimal point in the number).

    " xml:lang="ru-RU" lang="ru-RU">This way of writing numbers is called number representation" xml:lang="ru-RU" lang="ru-RU">floating point" xml:lang="ru-RU" lang="ru-RU">.

    " xml:lang="ru-RU" lang="ru-RU">Example:" xml:lang="ru-RU" lang="ru-RU"> -245.62=-0.24565 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">3" xml:lang="ru-RU" lang="ru-RU">, 0.00123=0.123·10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-2" xml:lang="ru-RU" lang="ru-RU">=1.23 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-3" xml:lang="ru-RU" lang="ru-RU">=12.3 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-4

    " xml:lang="ru-RU" lang="ru-RU">Obviously, this idea is not unique.;color:#000000" xml:lang="ru-RU" lang="ru-RU">

    " xml:lang="ru-RU" lang="ru-RU">If the mantissa is enclosed between n;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU"> and 1 (i.e. 1/n;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU"> |M|<1), то представление числа становится однозначным, а такая форма называется " xml:lang="ru-RU" lang="ru-RU">normalized" xml:lang="ru-RU" lang="ru-RU">.

    " xml:lang="ru-RU" lang="ru-RU">Example" xml:lang="ru-RU" lang="ru-RU">: for the decimal number system - 0.1< |m| < 1 (мантисса - число меньше 1, и первая цифра после запятой отлична от нуля, т.е. значащая).

    " xml:lang="ru-RU" lang="ru-RU">Real numbers are written differently in different types of computers, however, there are several international standard formats that differ in precision, but have the same structure.;color:#000000" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">For standard-based" xml:lang="en-US" lang="en-US">IEEE" xml:lang="ru-RU" lang="ru-RU"> 754 (defines the representation of numbers with single precision (" xml:lang="ru-RU" lang="ru-RU">float" xml:lang="ru-RU" lang="ru-RU">) and with double precision (" xml:lang="ru-RU" lang="ru-RU">double" xml:lang="ru-RU" lang="ru-RU">)) representation of a real number in a computer is used" xml:lang="en-US" lang="en-US">m" xml:lang="ru-RU" lang="ru-RU">+" xml:lang="en-US" lang="en-US">p" xml:lang="ru-RU" lang="ru-RU">+1 bits, distributed as follows: one digit (" xml:lang="en-US" lang="en-US">S" xml:lang="ru-RU" lang="ru-RU">) - used for the mantissa sign," xml:lang="en-US" lang="en-US">p" xml:lang="ru-RU" lang="ru-RU"> digits determine the order," xml:lang="en-US" lang="en-US">m" xml:lang="ru-RU" lang="ru-RU"> digits determine the absolute value of the mantissa. To write a number in single precision floating point format, a thirty-two-bit word is required. To write double precision numbers, a sixty-four-bit word is required.

    " xml:lang="en-US" lang="en-US">1

    " xml:lang="en-US" lang="en-US">p-1 0

    " xml:lang="en-US" lang="en-US">m-1" xml:lang="ru-RU" lang="ru-RU">0

    " xml:lang="en-US" lang="en-US">S

    " xml:lang="ru-RU" lang="ru-RU">Order

    " xml:lang="ru-RU" lang="ru-RU">Fractional part M

    " xml:lang="ru-RU" lang="ru-RU">Since the order can be positive or negative, it is necessary to solve the problem of its sign. The value of the order is represented in excess, i.e., instead of the true value of the order, a number is stored , called" xml:lang="ru-RU" lang="ru-RU">characteristics" xml:lang="ru-RU" lang="ru-RU"> (or" xml:lang="ru-RU" lang="ru-RU">shifted order" xml:lang="ru-RU" lang="ru-RU">).

    " xml:lang="ru-RU" lang="ru-RU">The offset is required so as not to introduce another sign into the number. The offset order is always a positive number. For single precision, the offset is taken to be 127, and for double precision 1023 (" xml:lang="ru-RU" lang="ru-RU">2;vertical-align:super" xml:lang="en-US" lang="en-US">p;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-1" xml:lang="ru-RU" lang="ru-RU">-1)" xml:lang="ru-RU" lang="ru-RU">. The decimal mantissa may contain digits 1:9 after the decimal point, but only 1 in the binary mantissa. Therefore, a separate bit is not allocated to store the unit after the binary decimal point. floating point number." xml:lang="ru-RU" lang="ru-RU">The unit is implied, like the binary comma" xml:lang="ru-RU" lang="ru-RU">. In addition, in the floating point format it is accepted that the mantissa is always greater than 1. That is, the range of mantissa values ​​lies in the range from 1 to 2.

    " xml:lang="ru-RU" lang="ru-RU">Examples" xml:lang="ru-RU" lang="ru-RU">:

    " xml:lang="ru-RU" lang="ru-RU">1) Determine the floating point number lying in four adjacent bytes:

    " xml:lang="ru-RU" lang="ru-RU">11000001 01001000 00000000 00000000

    " xml:lang="ru-RU" lang="ru-RU">We divide the binary representation into sign (1 bit), order (8 bits) and mantissa (23 bits):

    " xml:lang="ru-RU" lang="ru-RU">1 10000010 10010000000000000000000

    • " xml:lang="ru-RU" lang="ru-RU">A sign bit equal to 1 indicates that the number is negative.
    • " xml:lang="ru-RU" lang="ru-RU">The exponent 10000010 in decimal form corresponds to the number 130. Let's adjust the order: subtract the number 127 from 130, we get the number 3.
    • " xml:lang="ru-RU" lang="ru-RU">Add a hidden unit to the left of the mantissa" xml:lang="ru-RU" lang="ru-RU">1" xml:lang="ru-RU" lang="ru-RU">,100 1000 0000 0000 0000 0000, move the order from the hidden unit to the right to the resulting order value:" xml:lang="ru-RU" lang="ru-RU">1" xml:lang="ru-RU" lang="ru-RU">100, 1000 0000 0000 0000 0000.
    • " xml:lang="ru-RU" lang="ru-RU">And finally, let's define the decimal number: 1100.1;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">2" xml:lang="ru-RU" lang="ru-RU"> = 12.5;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">10
    • " xml:lang="ru-RU" lang="ru-RU">Finally we have -12.5

    " xml:lang="ru-RU" lang="ru-RU">2) Determine the floating point number lying in four adjacent bytes:

    " xml:lang="ru-RU" lang="ru-RU">01000011 00110100 00000000 00000000

    • " xml:lang="ru-RU" lang="ru-RU">A sign bit equal to 0 indicates that the number is positive.
    • " xml:lang="ru-RU" lang="ru-RU">The exponent 10000110 in decimal form corresponds to the number 134. Subtracting the number 127 from 134, we get the number 7.
    • " xml:lang="ru-RU" lang="ru-RU">Now let's write the mantissa:" xml:lang="ru-RU" lang="ru-RU">1" xml:lang="ru-RU" lang="ru-RU">,011 0100 0000 0000 0000 0000
    • " xml:lang="ru-RU" lang="ru-RU">And finally, let's define the decimal number: 10110100;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">2" xml:lang="ru-RU" lang="ru-RU">=180;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">10

    " xml:lang="ru-RU" lang="ru-RU">Since a certain number of digits are allocated for the mantissa and order, respectively" xml:lang="en-US" lang="en-US">m" xml:lang="ru-RU" lang="ru-RU"> and" xml:lang="en-US" lang="en-US">p" xml:lang="ru-RU" lang="ru-RU">, then you can estimate the range of numbers that can be represented in normalized form in the radix number system" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">.

    " xml:lang="ru-RU" lang="ru-RU">If" xml:lang="en-US" lang="en-US">m" xml:lang="ru-RU" lang="ru-RU">=23 and p=8 (4 bytes), then the range of numbers presented is from 1.5 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-45" xml:lang="ru-RU" lang="ru-RU"> up to 3.4 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">+38" xml:lang="ru-RU" lang="ru-RU"> (provides precision with 7-8 significant figures).

    " xml:lang="ru-RU" lang="ru-RU">If" xml:lang="en-US" lang="en-US">m" xml:lang="ru-RU" lang="ru-RU">=52 and p=11 (8 bytes), then the range of numbers presented is from 5.0 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">-324" xml:lang="ru-RU" lang="ru-RU"> up to 1.7 10;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">+308" xml:lang="ru-RU" lang="ru-RU"> (provides precision with 15-16 significant figures).

    " xml:lang="ru-RU" lang="ru-RU">The more digits allocated for writing the mantissa, the higher the accuracy of the number representation. The more digits the order occupies, the wider the range from the smallest non-zero number to the largest number , representable in a computer given a given format.

    " xml:lang="ru-RU" lang="ru-RU">When performing floating point operations, there are fewer problems with bit grid overflow than for fi operations;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">k" xml:lang="ru-RU" lang="ru-RU">with a floating point. However, floating point operations are more complex, since they require normalization and;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">e" xml:lang="ru-RU" lang="ru-RU">normalization of mantissas.

    Machine codes: direct, reverse, additional.

    " xml:lang="ru-RU" lang="ru-RU">In binary arithmetic, as in ordinary arithmetic, a distinction is made between positive and negative numbers. In the binary number system, there are three ways to represent h;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">and" xml:lang="ru-RU" lang="ru-RU">sat down with a sign.

    " xml:lang="ru-RU" lang="ru-RU">- representation of absolute value and sign separately (or direct code);

    " xml:lang="ru-RU" lang="ru-RU">- representation of negative numbers in addition;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">and" xml:lang="ru-RU" lang="ru-RU">body code;

    " xml:lang="ru-RU" lang="ru-RU">- representation of negative numbers in reverse code.

    " xml:lang="ru-RU" lang="ru-RU">В;text-decoration:underline" xml:lang="ru-RU" lang="ru-RU">direct" xml:lang="ru-RU" lang="ru-RU"> in the code, the most significant digit encodes the sign of the number, and the rest the modulus of the number. Conventionally, the “+” sign denotes 0 and the “-” sign – 1. For example, the number +10 in pr;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">i" xml:lang="ru-RU" lang="ru-RU">in my code will be represented as 0;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1010;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">pc" xml:lang="ru-RU" lang="ru-RU">, and -10;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU"> 1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1010;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">pc" xml:lang="ru-RU" lang="ru-RU">.

    " xml:lang="ru-RU" lang="ru-RU">В;text-decoration:underline" xml:lang="ru-RU" lang="ru-RU">additional" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">in the code, a positive number is encoded in the same way as in the direct one, and to represent a negative number in the complementary code, you need to write" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-bit module of this number, change the zeros in it to ones, ones to 0 and add one to the least significant bit;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">i" xml:lang="ru-RU" lang="ru-RU">du.

    " xml:lang="ru-RU" lang="ru-RU">Example" xml:lang="ru-RU" lang="ru-RU">: represent the number -10 in additional;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">l" xml:lang="ru-RU" lang="ru-RU">literary code.

    " xml:lang="ru-RU" lang="ru-RU">Binary equivalent +10 = 0;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1010 pcs.

    " xml:lang="ru-RU" lang="ru-RU">;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">a" xml:lang="ru-RU" lang="ru-RU">zom:

    " xml:lang="ru-RU" lang="ru-RU"> 1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">0101

    " xml:lang="ru-RU" lang="ru-RU">+ 1

    " xml:lang="ru-RU" lang="ru-RU">1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">0110dk = -10

    " xml:lang="ru-RU" lang="ru-RU">We can offer" xml:lang="ru-RU" lang="ru-RU">second" xml:lang="ru-RU" lang="ru-RU"> method of transition to additional code: must be written down" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-bit module of this number, leave all zeros in the low-order digits and the first low-order one unchanged, and invert the remaining digits.

    " xml:lang="ru-RU" lang="ru-RU">Example" xml:lang="ru-RU" lang="ru-RU">;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">l" xml:lang="ru-RU" lang="ru-RU">literary code.

    " xml:lang="ru-RU" lang="ru-RU">Binary equivalent +50 = 0;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">0110010pk.

    " xml:lang="ru-RU" lang="ru-RU">Additional code is obtained as follows;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">a" xml:lang="ru-RU" lang="ru-RU">zom: 1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1001110dk, and according to the first rule:

    " xml:lang="ru-RU" lang="ru-RU"> 1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1001101

    " xml:lang="ru-RU" lang="ru-RU">+ 1

    " xml:lang="ru-RU" lang="ru-RU">1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1001110dk = -50

    " xml:lang="ru-RU" lang="ru-RU">Exercise" xml:lang="ru-RU" lang="ru-RU">: represent the number -33 in additional;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">l" xml:lang="ru-RU" lang="ru-RU">indicative code. It should be 1|1011111dk.

    " xml:lang="ru-RU" lang="ru-RU">You can get an additional code for a negative number X using the third rule: Хдк=2;vertical-align:super" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">-|" xml:lang="en-US" lang="en-US">X" xml:lang="ru-RU" lang="ru-RU">|, where" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU"> length of the machine word.

    " xml:lang="ru-RU" lang="ru-RU">Example" xml:lang="ru-RU" lang="ru-RU">: represent the number -50 in additional;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">l" xml:lang="ru-RU" lang="ru-RU">literary code (where" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU"> =8).

    " xml:lang="ru-RU" lang="ru-RU">2;vertical-align:super" xml:lang="en-US" lang="en-US">n" xml:lang="ru-RU" lang="ru-RU">=2;vertical-align:super" xml:lang="ru-RU" lang="ru-RU">8" xml:lang="ru-RU" lang="ru-RU">=64=100000000;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">2

    " xml:lang="ru-RU" lang="ru-RU">|" xml:lang="en-US" lang="en-US">X" xml:lang="ru-RU" lang="ru-RU">|=50=110010;vertical-align:sub" xml:lang="ru-RU" lang="ru-RU">2

    " xml:lang="ru-RU" lang="ru-RU">100000000

    " xml:lang="ru-RU" lang="ru-RU">- 110010

    " xml:lang="ru-RU" lang="ru-RU"> 11001110dk

    " xml:lang="ru-RU" lang="ru-RU">From the rules we can conclude that positive numbers, in the case of an increase in the number of digits, are supplemented on the left with zeros, and negative numbers with ones.

    ;text-decoration:underline" xml:lang="ru-RU" lang="ru-RU">Reverse" xml:lang="ru-RU" lang="ru-RU"> the code of a binary number is formed according to the following rule: the reverse code of a positive number coincides with their direct code, and to represent a negative number in the reverse code, it is necessary to replace all 1s with 0, and all 0 to 1 and place 1 in signed ra;font-family:"Calibri"" xml:lang="ru-RU" lang="ru-RU">з" xml:lang="ru-RU" lang="ru-RU">row.

    " xml:lang="ru-RU" lang="ru-RU">Example, let's take the same number -10. The binary equivalent of +10 = 0;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">1010pk, from where we get the reverse code -10: 1;font-family:"Symbol"" xml:lang="ru-RU" lang="ru-RU">" xml:lang="ru-RU" lang="ru-RU">0101ok.

    " xml:lang="ru-RU" lang="ru-RU">It should be noted that" xml:lang="ru-RU" lang="ru-RU">for positive" xml:lang="ru-RU" lang="ru-RU"> forward, inverse and complementary numbers are the same, but for negative numbers they are not.

    " xml:lang="ru-RU" lang="ru-RU">Usually negative decimal numbers, when entered into a machine, are automatically converted into inverse or complement binary code and in this form are stored, moved and involved in operations. When such numbers are output the machine converts back to negative decimal numbers.

    " xml:lang="ru-RU" lang="ru-RU">As you know, all mathematical operations in the processor come down to addition, code shift and logical operations. The use of additional and reverse codes allows you to replace subtraction, multiplication, division with the ones used operations.