Units for measuring the amount and volume of information.

N- Hartley's formula.

In a computer, the smallest unit of information is bit. The representation of each bit depends on the type of storage medium. On paper, a bit is represented by a one or a zero. internal memory this corresponds to one of the two states of the cell element. On a magnetic surface, this is a point (magnetized or non-magnetized), and on the surface of an optical disk, this corresponds to the presence or absence of a depression. Any information is encoded with a certain combination, i.e. binary characters.

The amount of information.

Since each bit can take one of two values ​​(0 or 1), then a sequence of i - bits can take N=2 ͥ different values ​​=> for any N - digit alphabet (i.e., consisting of N characters), the number of bits cat. required to represent any of these characters is calculated by the formula: i = log2 N. This value is taken as the amount of information contained in a message consisting of one character of the N-digit alphabet. Power is the number of characters in the alphabet. It follows from Hartley's formula that the amount of information contained in a message consisting of M-characters (m-bit message), when each character is equally likely taken from an alphabet with power N, is equal to i = m*log2 N.

For example:

There are 11 characters in the word INFORMATICS, i.e. m=11. If the 32-character alphabet is used, then we get: i=11* log2 32 = 11*5 = 55.

Amount of information.

Unlike quantity, the amount of information recorded in binary characters in the computer's memory or on external media is calculated by the number of binary characters required for such a recording. Typically, the smallest unit of information is a byte of 8 bits => each byte can take on 256 (2^8) different values, with the smallest being 00000000 and the largest being 11111111. Bytes are combined into larger sets depending on the purpose usage (input, output, etc.). Larger units of measurement (KB, MB and GB) are also used to measure the amount of memory. The transition from a smaller unit of measurement to a larger one is carried out using the coefficient 2^10 = 1024.

1 KB = 1024 bytes

1 MB = 1024 KB

1 GB = 1024 MB

To measure larger memory, use Terabyte (Tb) = 1024 GB; and Petabyte (Pb) = 1024 Tb.

Any information is presented in a computer as a sequence of bytes, while there is nothing in the bytes themselves that allows them to be treated as numbers, text or other data. Anyway information is encoded in the form of sequences of zeros and ones, i.e. positive integer binary numbers. Them interpretation (understanding) depends on which program and what action it performs at a given and specific moment. If the program is supposed to work with numbers, then bytes are represented as numbers to which arithmetic operations are applied.


Number systems.

Number is a sign that denotes a certain amount of something.

Such signs are written on the basis of the rules that make up the number system. Numbers are written using special characters that are different from each other, which are called numbers. There are various systems (non-positional and positional). In non-positional systems The meaning of each digit does not depend on its location in the number.

For example:

In the Roman system, V is five, L is fifty, X is ten. The disadvantage of such systems is the difficulty of writing numbers and the lack of standard rules.

In positional number systems the meaning of a digit depends on its location in the number, and the notation of numbers and the rules for performing arithmetic operations with them are standardized and formalized. In this number system, the number is a shorthand for the amount.

For example:

A number is a sequence of coefficients at powers of 10. The number 10 is called the base decimal system reckoning. If we set a different number as the base, we get a different number system.

The positional number system is given by the value of the base and the set of numbers. The bases are equal to the number of digits. Least zero, each next one more than the previous one. Any quantity can be represented as a number in different number systems and these representations will be one-to-one corresponding to each other, denoting the same quantity.

(10.10.2012)

For example, consider the representation of numbers in the hexadecimal number system. Then the base is 16. Numbers: we can borrow the first ten digits (from 0 to 9) from the 10-decimal number system, the remaining six digits corresponding to numerical values ​​​​from 10 to 15 will be denoted by A, B, C, D, E, F. In this case, A = number 10, B = number 11, etc. F = number 15. We are forced to make such a designation due to the fact that it is impossible to designate numbers with using with the help of other numbers.

Arithmetic in any number system is performed in the same way as it is done in the decimal system, you only need to take into account the value of the base. For example: 15+14=31 (octal system reckoning). In a computer, all data is represented in the binary system. For example:

Four bits represent 16 decimal numbers(from 0 to 15). The hexadecimal number system is used as a shorthand for viewing or modifying binary data. Programs , providing "direct" work of a person with data stored in the computer's memory, when interacting with a person, they automatically convert the binary representation of data to hexadecimal and vice versa.

Any data written in one byte is represented by two hexadecimal digits, the first of which corresponds to the first four bits, and the second to the second four bits. This is the reason for using the hexadecimal system.

To represent information in the computer memory (both numeric and non-numeric), a binary encoding method is used.

The elementary cell of computer memory has a length of 8 bits (bytes). Each byte has its own number (it is called address). The largest sequence of bits that a computer can process as a whole is called machine word. The length of a machine word depends on the processor word length and can be 16, 32, 64 bits, etc.

Binary Decimal Encoding

In some cases, when representing numbers in computer memory, a mixed binary-decimal "number system" is used, where a nibble (4 bits) is needed to store each decimal digit, and decimal digits from 0 to 9 are represented by the corresponding binary numbers from 0000 to 1001. For example, packed decimal format, designed to store integers with 18 significant digits and occupying 10 bytes in memory (the highest of which is signed), uses this variant.

Two's Representation of Integers

Another way to represent integers is additional code. The range of values ​​depends on the number of bits of memory allocated for their storage. For example, values ​​of the Integer type (all data type names here and below are presented in the form in which they are accepted in the Turbo Pascal programming language. Other languages ​​also have such data types, but may have different names) range from -32768 ( -2 15) to 32767 (2 15 - 1) and 2 bytes (16 bits) are allocated for their storage; type LongInt - in the range from -2 31 to 2 31 - 1 and are placed in 4 bytes (32 bits); word type- in the range from 0 to 65535 (2 16 - 1) (2 bytes are used), etc.

As can be seen from the examples, the data can be interpreted as signed numbers, and unsigned. In the case of representing a quantity with a sign, the leftmost (highest) digit indicates a positive number if it contains zero, and negative if it contains one.

In general, bits are numbered from right to left, starting from 0. The bit numbering in a two-byte machine word is shown below.

Additional code positive number is the same as its direct code. The direct code of an integer can be obtained as follows: the number is converted to the binary number system, and then its binary notation is padded on the left with as many insignificant zeros as required by the data type to which the number belongs.

For example, if the number 37 (10) = 100101 (2) is declared as an Integer value ( signed 16 bit), then its direct code will be 0000000000100101, and if the value of type LongInt ( 32-bit signed), then its direct code will be. For a more compact notation, the hexadecimal representation of the code is more often used. The resulting codes can be rewritten as 0025 (16) and 00000025 (16) respectively.

The additional code of a negative integer can be obtained using the following algorithm:

  1. write down the direct code of the module of the number;
  2. invert it (replace ones with zeros, zeros with ones);
  3. add one to the inverse code.

For example, let's write the two's complement code of -37, interpreting it as a LongInt value (32-bit signed):

  1. there is a direct code for the number 37;
  2. inverse code;
  3. additional code or FFFFFFDB (16) .

When obtaining a number by its additional code, first of all, it is necessary to determine its sign. If the number turns out to be positive, then simply translate its code into a decimal number system. In the case of a negative number, the following algorithm must be performed.

LECTURE №1 "The concept of information, general characteristics processes of collection, transmission, processing and accumulation of information"

Information. Types of existence of information. Information properties. Representation of data in a computer. Notation. Positional number systems. Converting numbers from one number system to another. Information encoding. Units of measurement of information. Transfer of information. Data processing. Data storage. magnetic memory. optical memory.

Information

Term "information" comes from the Latin word "information", which means information, clarification, presentation. Despite the widespread use of this term, the concept of information is one of the most controversial in science. Currently, science is trying to find common properties and patterns inherent in a multifaceted concept. information, but so far this concept remains largely intuitive and receives various semantic fillings in various branches of human activity.

In everyday life, for example , information refers to any data or information that is of interest to someone. "Inform" in this sense means "tell something,previously unknown".

Norbert Wiener, the "father" of cybernetics, formulated the modern scientific conception of information very accurately. Namely: Information is a designation of the content received from the outside world in the process of our adaptation to it and the adaptation of our feelings to it.

People exchange information in the form of messages. A message is a form of information representation in the form of speech, texts, gestures, views, images, digital data, graphs, tables, etc.

In cases where they say about automated work with information through any technical devices, usually, the first thing they are interested in is not the content of the message, but how many characters this message contains.

In relation to computer data processing, information is understood as a certain sequence of symbolic designations (letters, numbers, encoded graphic images and sounds, etc.) that carry a semantic load and are presented in a form understandable to a computer. Each new character in such a sequence of characters increases the information volume of the message.



Types of existence of information

The information may be in the form:

Texts, drawings, drawings, photographs;

light or sound signals;

radio waves;

Electrical and nerve impulses;

magnetic records; etc.

Objects, processes, phenomena of a material or non-material property, considered from the point of view of their information properties, are called information objects.

Information can be:

All these processes associated with certain operations on information are called information processes.

Information properties

Information is reliable if it reflects the true state of affairs. Incorrect information can lead to misunderstandings or wrong decisions.

Reliable information may become unreliable over time, as it has the property of becoming obsolete, that is, it ceases to reflect the true state of affairs.

information is full if it is sufficient for understanding and decision making. Both incomplete and redundant information hinders decision making or can lead to errors.

Information Accuracy is determined by the degree of its proximity to the real state of the object, process, phenomenon, etc.

The value of information depends on how important it is for solving the problem, as well as on how much in the future it will find application in any kind of human activity.

Only timely information received can bring expected benefits. Equally undesirable is both the premature supply of information (when it cannot yet be assimilated) and its delay.

If valuable and timely information is expressed in an incomprehensible way, it can become useless.

Information becomes clear, if it is expressed in the language spoken by those to whom this information is intended.

Information must be presented in an accessible(according to the level of perception) form. Therefore, the same questions are presented differently in school textbooks and scientific publications.

information on the same issue. can be summarized(concise, without irrelevant details) or voluminously(detailed, verbose). The brevity of information is necessary in reference books, encyclopedias, textbooks, all kinds of instructions.

Representation of data in a computer

All information in the computer is stored in the form of sets of bits, that is, combinations of 0 and 1. Numbers are represented by binary combinations in accordance with the number formats adopted for working in this computer, and character code matches letters and other characters to binary combinations.

There are three number formats for numbers:

Binary fixed point;

Binary floating point;

Binary Coded Decimal (BCD).

Floating point numbers are processed on a special coprocessor (FPU - floating point unit), which, starting from MP I486, is part of the LSI microprocessor. Data is stored in 80-bit registers.

Notation.

Let's call a way of representing an image of arbitrary numbers with the help of some finite set of symbols a number system.

In everyday practice, we use, as a rule, the decimal number system.

Number systems are usually divided into ...

1. Positional.

2. Non-positional.

3. Symbolic.

Symbolic. In these systems, each number is assigned its own symbol. These systems are not widely used due to their natural limitations (alchemy, coded messages) - an uncountable set of symbols that is required to represent all possible numbers. Therefore, we will omit these systems from consideration.

Data representation formats in computer memory. machine codes.

Plan.

1. Data presentation formats in computer memory.

a. Representing Numbers in Fixed-Point Form

b. Representing Numbers in Floating Point Form

2. Machine codes: direct, reverse, additional.

Data representation formats in computer memory.

To represent numbers (data), a certain number of bits are allocated in the computer memory. Unlike from the numbering of the digits of the number of bits in a byte are numbered from left to right, starting from 0. Each byte in the computer's memory has its own serial number, which is called absolute byte addresses. A byte is the basic unit of data storage, it is the smallest addressable unit of information exchange in the main memory of a computer, that is, the minimum unit of information exchange that has an address in the computer's memory.

A sequence of several contiguous bytes forms data field. The number of bytes of a field is called field length, and the address of the leftmost byte of the field is field address. Information processing can be carried out either byte by byte or by data fields (or data format). Data formats show how information is placed in random access memory and computer registers. Data formats are distinguished by length, data type and structure, and each value contained in a byte can be interpreted in different ways:

– encoded representation of an external alphabet character (during data input and output);

- an integer signed or unsigned number (with internal representation of numbers in computer memory);

– part of a command or more complex unit of data, etc.

In computers, there are the following forms of representation of integers: half-word(byte), word(two consecutive bytes, numbered from left to right from 0 to 15), double word(4 bytes).

If numbers are placed in the specified formats, then the weights of their digits increase from right to left.

The computer uses to represent numbers. natural(representing a number with a fixed point) and semi-logarithmic(representation of a floating point number) of the form.

Representing numbers in fixed-point form.

In the number representations used, a “comma” or “decimal point” is a conventional symbol designed to separate the integer and fractional parts of a number. The comma therefore has a precise mathematical meaning, regardless of the number system used, and its position does not in the least change the calculation algorithm or the form of the result.

If the numbers being processed are of the same order of magnitude, you can fix the position of the comma or period (such a representation is called a fixed-point representation). Then, when processing numbers in the machine, there is no 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 as a result.

There are basically 2 ways to fix the decimal point:

1) the point is located to the right of the lowest digit of the number, and we have integers;

2) the point is located to the left of the highest digit of the number, and we have fractional numbers is less than one in absolute value.

Positive integers can be represented directly in binary notation ( binary code). In this form of representation, binary arithmetic is easily implemented on a computer.

If negative numbers are also needed, then the sign of the number can be encoded in a separate bit (usually this is the most significant bit). The most significant digit is signed if it contains 1 , then the number negative, if 0 , then the number positive.

With a sixteen-bit grid, we have:

In general, the range of representation of integers is ( n is the number of digits in the format):

- for unsigned 0 ≤ x ≤ 2n-1(when n=8 from 0 to 255)

- for iconic -2 n -1 ≤ x ≤ +2 n -1 -1(with n=8 from -128 to 127);

A significant disadvantage of this representation method is the limited range of values ​​representation, 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 we get:

Representation of numbers in floating point form.

Real numbers in mathematics are represented by finite or infinite fractions. However, in a computer, numbers are stored in registers and memory cells, which are a sequence of bytes with limited number discharges. Therefore, infinite or very long numbers are truncated to a certain length and appear as approximations in the computer representation.

To represent real numbers, both very small and very large, it is convenient to use the form of writing numbers as a product:

A = ± M n ± p

where n- base of the number system;

M- mantissa;

R is an integer called in order(defines the location of the decimal point in the number).

This way of writing numbers is called number representation. floating point.

Example:-245.62=-0.24565 10 3 , 0.00123=0.123 10 -2 =1.23 10 -3 =12.3 10 -4

Obviously, this representation is not unique.

If the mantissa is between n -1 and 1 (i.e. 1/n £ |M|<1), то представление числа становится однозначным, а такая форма назы­вается normalized.

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

Real numbers are written differently in different types of computers, however, there are several international standard formats that differ in accuracy, but have the same structure. For based on the IEEE-754 standard (defines the representation of single-precision numbers ( float) and double precision ( double)) representation of a real number in a computer uses m + p + 1 bits, distributed as follows: one bit (S) - is used for the sign of the mantissa, p - bits determine the order, m bits determine the absolute value of the mantissa. A single-precision floating-point number requires a thirty-two-bit word. Double-precision numbers require a sixty-four-bit word.

1 p-1 0 m-1 0
S Order Fractional part M

Since the order can be positive or negative, we need to solve the problem of its sign. The exponent value is overrepresented, i.e., instead of the true value of the exponent, a number is stored, called characteristic(or shifted order).

The offset is required to avoid adding another character to the number. The offset order is always a positive number. For single precision, the offset is taken equal to 127, and for double precision - 1023 ( 2p-1-1). The decimal mantissa can have 1:9 digits after the decimal point, but only 1 in the binary mantissa. Therefore, a separate bit in the floating point number is not allocated to store the unit after the binary point. The unit is implied, as is the binary comma. In addition, in floating point format, it is assumed that the mantissa is always greater than 1. That is, the range of values ​​for the mantissa lies in the range from 1 to 2.

Examples:

1) Determine the floating point number contained in four adjacent bytes:

11000001 01001000 00000000 00000000

Let's divide binary representation for sign (1 bit), exponent (8 bits) and mantissa (23 bits):

1 10000010 10010000000000000000000

– A sign bit of 1 indicates that the number is negative.

– The exponent 10000010 in decimal form corresponds to the number 130. Correct the order: subtract the number 127 from 130, we get the number 3.

- To the mantissa, add a hidden unit on the left 1 ,100 1000 0000 0000 0000 0000, move the order from the hidden unit to the right by the resulting order value: 1 100, 1000 0000 0000 0000 0000.

- And finally, let's define the decimal number: 1100.1 2 = 12.5 10

– Finally we have -12.5

2) Determine the floating point number contained in four adjacent bytes:

01000011 00110100 00000000 00000000

– A sign bit of 0 indicates that the number is positive.

- The exponent 10000110 in decimal corresponds to the number 134. Subtracting the number 127 from 134, we get the number 7.

Now let's write the mantissa: 1 ,011 0100 0000 0000 0000 0000

– And finally, let's define a decimal number: 10110100 2 =180 10

Since a certain number of digits are allocated for the mantissa and the order, respectively m and p, then you can estimate the range of numbers that can be represented in a normalized form in a number system with a base n.

If m=23 and p=8 (4 bytes), then the range of numbers represented is from 1.5·10 -45 to 3.4·10 +38 (ensures 7-8 significant digits precision).

If m=52 and p=11 (8 bytes), then the range of numbers represented is from 5.0·10 -324 to 1.7·10 +308 (ensures 15-16 significant digits of precision).

The more digits are allocated for recording the mantissa, the higher the accuracy of the representation of the number. The more digits an order occupies, the wider the range from the smallest non-zero number to the largest number that can be represented on a computer with a given format.

There are fewer bit overflow issues with floating point operations than with fixed point operations. However, floating point operations are more complex, as they require the mantissa to be normalized and denormalized.

Any information is represented in a computer as byte sequence. The bytes themselves do not contain information about how they should be interpreted (numbers / text characters / graphic image). In any case, the information is encoded as a sequence of 0s and 1s, i.e. positive integer binary numbers(the number is written using two digits - 0/1). Their interpretation depends on which program and what action it performs with them at a given moment. If the program contains a sequence of instructions oriented to work with numbers, then the bytes are treated as numbers. If the program assumes an action with text data, then the bytes are interpreted as conditional numeric codes denoting text characters.

I. Number systems

Any number is a multiple of the sum (for example, 168 = 100 + 60 + 8 = 1 10 2 + 6 10 1 + 8 10 0), i.e. number- a sequence of coefficients at powers of 10 => if we have a number d = a 1 a 2 …a n(a 1 a 2 …a n are digits), then d = a 1 10 n-1 + a 2 10 n-2 +…a n 10 0.

Briefly, such amounts are written as follows: n

d = ∑ a i 10 n-i

The number 10 is the base of the decimal number system, if we take another number as the base, then we get a different notation system for numbers, i.e. another number system.

The number system is given by the value of the base and a set of digits. Numbers- special characters used to write numbers. Their number must necessarily be equal to the value of the base.

Any number can be represented in different number systems, these representations will strictly (one-to-one) correspond to each other.

For example, let's define a hexadecimal number system: base = 16 => should be 16 digits (0-15) = 1,2,3,4,5,6,7,8,9,A,B,C,D ,E,F. Here A-F are the numbers 10,11,12,13,14,15. Such designations are used due to the fact that numbers cannot be written using other numbers, otherwise there will be confusion in reading numbers. Let's write down how the decimal number 168 will look like in this number system, keeping in mind the general law of writing the number, and also the fact that here the base is 16, we have: 168 (10) \u003d A 16 1 + 8 16 0 => A8 (16 ).

Arithmetic operations in any number system are performed in the same way as it is done in the decimal number system. Only the size of the base follows.

For example, in octal number system + 15 = 1 8 1 + 5 8 0 => + 13

14 = 1 8 1 + 4 8 0 => = 12

In a computer, all data is represented in the binary system. For example, the number 5 in binary form is written as 101. Similarly, the binary number 1111 corresponds to the decimal number 15: 1111 (2) = 1 2 3 + 1 2 2 + 1 2 1 + 1 2 0


Those. four bits can represent at most 16 decimal numbers (0-15).

The hexadecimal number system is used as a short record when viewing or correcting binary data in the computer's memory. Programs that provide "direct" work of a person with computer memory, when interacting with him, automatically convert the binary representation of data to hexadecimal and vice versa. Any data written in 1 byte is represented by only two hexadecimal digits, the first of which corresponds to the first four bits, and the second digit corresponds to the second four bits.

This form of representation of binary numbers (data), located in the memory of a computer, is a compromise between a person and his concepts of convenience and a computer, where all information is presented only in binary form.

II. Data types and their representations

One byte (8 bits) can represent 256 positive integers (0-255). This type of data is called single byte unsigned integer.

Numbers greater than 255 require more than one byte to represent. The following types are used to work with them:

- two-byte unsigned integers– provide a representation of positive integers (0-65535)

- four-byte unsigned integers- provide a representation of positive integers (0-≈4.2 billion)

The above types assume that the number must only be positive => are called "unsigned". They differ in the amount of memory that is allocated to store the number. Such types are used for numerical coding of text characters, colors, intensity of graphic dots, numbering of elements, etc.

To work with integers, which can be not only positive, but also negative, use types:

- single-byte signed integers

- double-byte signed integers

- four-byte signed integers

They differ in the amount of memory that is allocated to store each number.

The representation of both positive and negative numbers is based on the following principle: the total number of numeric codes possible for a given number of bytes (for example, for a single byte - 256) is divided in half, one half is used to represent positive numbers and zero, the other - negative numbers . Negative numbers are represented as the addition to the total number of numeric codes. For example, for a single-byte number (-1) = 255, (-2) - 254, etc. up to 128, which stands for the number (-128) => one-byte signed integer allows you to work with integers from (-128) to 127, two-byte - from (-32768) to 32767, four-byte - from (≈-2.1 billion. ) to 2.1 billion (2147483648).

Signed numbers are used to represent numeric data with which to perform arithmetic.

When interacting with programs, the following data types:

- whole short uy (SHORT)

- whole regular(INTEGER)

- whole long(LONG INTEGER)

- single precision real(FLOAT/REAL)

- double-precision real(DOUBLEFLOAT/REAL)

- character (string, text)(CHAR)

- logical(LOGIKAL)

A whole short, a whole regular and a whole long– types respectively one-byte signed integer, two-byte signed integer, four-byte signed integer.

In computer science, when writing numbers, not a comma is used as a sign separating the fractional and integer parts, but a period (for example, 68.314). This point fixes the position after which the fractional part. Changing the location of the point leads to a change in the number => this type of notation (notation format) of real numbers is called fixed point format.

A real floating point number consists of 2 parts:

- mantissa

- order

They are separated by a special sign (E,D). The mantissa is real number with a fixed point, the order is given by an integer indicating to what power the number 10 must be raised in order to get the number that is meant when multiplied by the mantissa. For example, 68.314 in this format can be written as 6.8314E+1 = 0.68314E+2 = 683.14E-1, which means 6.8314 10 1 = 0.68314 10 2 = 68.314 10 -1 .

With this type of notation, the location of the point is not fixed, its position in the mantissa is determined by the order value. The mantissa and exponent may have a sign. If the mantissa is modulo<1, причем первая цифра не равна 0, то такой вид записи вещественного числа с плавающей точкой называется normalized(0.68314Е+2).

In a computer, a real number is represented in floating point format in a normalized form. Mantissa and order are located in adjacent bytes, there is no separator (E,D).

Usually a number is distinguished from single and double precision. In the first case, when entering or outputting a number, the mantissa and exponent separator is specified as E. In computer memory, such a number usually occupies 4 bytes. In the second case, as a delimiter - D, in computer memory, a double-precision number usually occupies 8 bytes. This type provides much greater calculation precision than single precision.

Character data composed of individual text characters. Each character is represented in the computer memory by a certain numerical code. For numerical coding of text characters, special coding tables are used (single-byte, double-byte, etc.). This refers to the unsigned integer type used for numeric encoding. Different programs may be based on different tables => a test document created with one program may not necessarily be read with another.

Quantities boolean type take only two values:

- TRUE(true)

- FALSE(False)

Logical operations can be applied to them, the main of which are and(and), or(or), not(negation). And, or – to two logical values ​​(a>c and a = b). Not - to one logical value (not a = b). The result of an expression with logical data (logical expression) is a logical value. The result of the operation and = TRUE only in one case, if both values ​​= TRUE. The result of the operation or = FALSE only in one case, if both values ​​= FALSE. The not operation changes the value of a boolean value.

In mixed expressions, y precedence arithmetic operations, then - at the comparison, lastly - at logical operations. Among them, the highest priority operations not, then - and, after - or.

Files and their storage

Any information object (a separate document, a separate program) stored on a disk and having a name is file. Information about files (their name, size, date and time of creation, location on disk, etc.) is stored in directories. Catalog- a table, each line of which contains information about a file or other directory. Directory = file (except root) of a special kind. When files are written to disk, information about them is automatically written to the directories specified by the user. Conventionally, for brevity, they say: “copy a file from a directory to a directory”, “create a directory in a directory”, “delete a file in a directory”, etc. However, this doesn't actually happen, because there are no directories or files in directories, only information about them.

When creating each disk, a directory is automatically created on it, which is called root. It occupies a certain fixed size space on the disk. Its name consists of 2 characters: drive name followed by a colon.

In the root directory, you can create other directories called subdirectories or directories of the first level of the hierarchy. In turn, directories of the first level of the hierarchy can create directories of the second level, and so on. Thus formed hierarchical (tree-like) file structure of data on disk. User-created directories are files. Each file or directory has a two-part name separated by a dot. Left side - name, right - extension. The extension along with the dot can be omitted. The name can be up to 8 characters (short name) or up to 256 characters (long name). In the extension - no more than 3 characters. It is considered standard to use only Latin letters, numbers and underscores in the name. For working with lists, it is recommended to name files with extensions, and directories without extensions.

If you want to use any file, you must specify in which directory this file is located. This is done by specifying the path (route) to the file along the directory tree.

Route(path) is a list of directories as they are nested (from outer to inner), separated by a backslash character (\ - backslash). When specifying files, the route is indicated before its name, and then after a \ - the name of the file (for example, C:\Windows\win.com - means that the win.com file is located in the Windows directory, which is located in the root directory of drive C). Such a record is called complete. file specification. The short one includes only the file name. Directories and files created by the user are placed in their own place in the disk memory during recording. Files can be written in parts to different places disk. During the recording process, the file is automatically divided into such parts, and each of them is written to the place that is free in this moment. These parts are called clusters. The size of the cluster depends on the amount of disk space, it usually spans several sectors. In connection with this recording principle, the entire disk area is, as it were, divided into such clusters, and they are used to record files. Files are also read in parts of the size of one cluster: the file is assembled from separate parts recorded in different places on the disk. This method of storing files is carried out using the so-called file allocation tablesFAT. It is created on each disk automatically when it is formed and is used to remember where parts of the file are stored. FAT cells are numbered starting from "0" and correspond to parts of disk memory with a size of 1 cluster. Each cell can contain 0 (indicates that the corresponding cluster is free), the number of the next cluster given file or a special numeric code indicating the end of the chain of clusters for the given file. To represent numbers in FAT, unsigned integer data types are used. Depending on the number of bits used to represent each number, there are 16-bit FAT (16-bit), 32-bit FAT (32-bit). As special code, indicating the end of the cluster chain, the maximum number that can be represented in the FAT cell is used. For 16 bits, this number is 65535 (in hexadecimal form - FFFFF). Programs that provide viewing and correction of FAT show this code on the screen in text form(E OF). The directory contains information about the file and, in particular, the serial number of the cluster from which the file begins. This information, together with the information contained in the FAT (links to the following clusters), is used to find and read files.

Computer networks

I.Main Features

Computer network - a set of computers interconnected through information transmission channels that provide users with the means of exchanging information and sharing resources (hardware, software, information).

Types of networks:

- local- home distinguishing feature is that, as a rule, all the computers united by it are connected by a single communication channel. The distance between computers is up to 10 km (when using wired connection), up to 20 km (radio communication channels). Local area networks connect the computers of one or more nearby buildings of the same institution.

- global- they are characterized by a variety of communication channels and the use of satellite channels, allowing to connect communication centers and computers located at a distance of 10-15 thousand km from each other. Usually they have a nodal structure, consist of subnets, each of which includes communication nodes and communication channels. Communication nodes ensure the efficiency of the network, computers, local networks, large computers, etc. are connected to them.

- intranets– combine users working in the same organization. Some use the capabilities of existing local and global networks. Such a network can connect computers located both in the same building and in different places around the world.

There are public computers on the network that provide information or computing services to users. server it can be a computer used for this purpose or a place (in global networks) where you can send a request to perform a service. Such a place can be a server computer, a local area network, a mainframe, and so on.

User computers can work in networks in two modes:

Mode workstation- a computer is used not only to send a request to the server and receive information from it, but also to process this information

Mode terminal - the latter is not performed: information is processed on the server, and only the result of this processing is sent to the user.

The server computer in its capabilities is much superior to workstations and is equipped with a variety of network cards ( adapters) to connect to networks. A set of programs that provide networking - network software. It defines the type of services that can be performed in a given network. Currently common 2 main concepts building such software:

- "file server concept"– based on what network software should provide to many users informational resources in the form of files => a server in such a network is called file, and network software network operating system . Its main part is hosted on a file server, and a small part of it is installed on workstations, called shell. The shell acts as an interface between programs accessing the resource, and file server. Such a server is a repository of files used by all users. In this case, both programs and data files located on the file server are automatically moved to workstation where this data is processed.

- "client-server architecture"- in this case, the network software consists of software systems 2 classes:

- server programs- so called software systems, which ensure the operation of the server

- client programs– software systems that provide user-clients

The operation of systems of these classes is organized as follows: client programs send requests to the server program, the main data processing is performed on the server computer, and only the results of the request are sent to the user's computer.

LANs usually use the concept of the first type with a single file server. In globals, the "client-server architecture" is the main one.

The presentation of information and its transmission over the network is carried out in accordance with standard agreements. The set of such standard conventions is called protocol.

II. Typology local network

Network typology– logical diagram of connection of computers (computers) by communication channels.

Most often used in local networks 3 main typologies:

- monochannel

- ring

- star-shaped

The use of an information transmission channel connecting network nodes at the physical level is determined by a protocol called access method. These access methods are implemented by the corresponding network cards(adapters). Such adapters are installed in each network computer and provide information transmission and reception via communication channels.

Monochannel typology– an open communication channel is used, to which all computers are connected. It is called monochannel-bus(common bus).


Terminator

The terminal is used to connect to open network cables, designed to absorb the transmitted signal. In such a typology, as a rule, an access method with preliminary listening to the channel is used to determine whether it is free.

ethernet(speed - 10 Mbps) - the name of the access method. Access method can be used fast ethernet(speed - 100Mbps)

Tolerance to failures of individual nodes

The main disadvantages of the typology:

Cable break leads to the inoperability of the entire network

Significant reduction bandwidth networks with significant volumes traffic(- information transmitted over the network)

Ring typology


It uses a closed ring consisting of segments as a communication channel. Segments connect special devicesrepeaters(repeaters). The repeater is designed to connect network segments.

The main access method here is Token Ring, a token-passing access method.

There is a central communication node that unites all computers in the network. The Active Center fully manages the computers on the network. The access method is usually also based on the use of a token (eg Arcnet at 2 Mbps). In addition, Ethernet and Fast Ethernet access methods can be implemented.

The main advantages of the typology:

Convenience in terms of managing the interaction of computers

Ease of changing and expanding the network

The main disadvantages of the network:

If the active center fails, the entire network goes down

III. Structure of the global network

Information can be exchanged between networks; to ensure such communication, interconnection tools are used, called bridges, routers and gateways. This is a special computer that has two or more network adapters installed, each of which provides communication with one network. The bridge is used to connect networks with the same type of intra-network communication channels. The router connects networks of the same type, but with different intranet communication channels. Gateways are used to provide communication between networks of various types, to connect networks with various computer systems (for example, a local network - mainframe, a local network - a global network, a specific Personal Computer- global network).

The global network includes communication subnets to which local networks, workstations and user terminals, as well as server computers are connected. The communication subnetwork consists of information transmission channels and communication nodes. Communication nodes are designed for fast transmission of information over the network, selection of the optimal route for information transmission, etc., i.e. ensure the efficiency of the network as a whole. Such a node is either a special hardware device or a specialized computer with the appropriate software.

Servers and users connect to WANs most often through network access service providers − providers.

IV.Main Features of the Global Internet

Each user and server must have a unique address. A message transmitted over the network is supplied with the addresses of the recipient and the sender and, during transmission, is automatically split by the network adapter into fixed-length parts, called packages. In this case, each packet (also automatically) is supplied with the addresses of the sender and recipient. On the receiving computer, the packets are assembled into a single message.

Each server or user computer on the network has 3 level addresses:

- local address- address network adapter. These addresses are assigned by hardware manufacturers and are unique because they are unique. their assignment is centralized. This address is used only within the local network.

- IP address– is a four-byte sequence (4 single-byte unsigned integers) and consists of 2 parts:

The first 2 bytes characterize the network

Second 2 bytes - specific node

This address is assigned by the network administrator regardless of the local address. If the network should work like component Internet, then the network number (first 2 bytes) is assigned on the recommendation of a special organization ICANN. Otherwise, the network number is chosen arbitrarily by the administrator. The host number (second 2 bytes) is assigned by the network administrator (for example, 192.100.2.15). A node can belong to several networks. In this case, it must have several IP addresses => IP address does not characterize separate computer, and one network connection. A message sent over a network is supplied with the IP addresses of the recipient and the sender.

- domain address (Domain name) – it is inconvenient for the user to use IP addresses in the current work => there is a so-called Internet domain name system (DNS). In this system, user-friendly text names (identifiers), called domain names, are given, and the corresponding IP addresses are hidden behind them. The user works with domain names, and the corresponding software, using special DNS servers, automatically converts them into addresses, which supplies transmitted packets. A fully qualified domain name (DNS address) is a series of names separated by a dot. The first on the left is the name of a specific computer, then the domain name of the organization, region, etc., the last on the right is the name of the so-called. root domain. Root domain names indicate on the state(for example, ru - Russia, us - USA, kz - Kazakhstan, etc.) or to belong to a certain type of organization(com - commercial, edu - educational, gov - government, mil - military, net - network, org - organization). Later, other similar root domains were defined (arts - art, culture, firm - business, info - information, nom - individual).

The names of computers that have access to the Internet through a host (for example, a local network server) are separated from the next part in the full name not by a dot, but by the @ ("at") sign. For example, [email protected]

V. Types of services on the Internet

The provision of services on the Internet is built on the basis of the "client-server" model. To connect a computer to the Internet, it is enough to have a telephone line, a provider that has a gateway to the Internet, and modem (mo dulyator- dem odulator) - a special adapter for connecting to the global network via telephone connection. The ISP's computer used by users to surf the Internet is called host. The most well-known services provided by Internet servers include:

- Email (e-mail) - represents the process of sending messages between computers

- file transfer(FTP-system) - designed to send files from special FTP servers to any user, to receive the file, you must specify the full name of the server and the full specification of the file

- view resources(GOPHER-system) – searches for files on GOPHER-servers by content (subject, keyword, phrase etc.)

- teleconferencing– designed to hold discussions and exchange news, allow you to read and send messages to information groups open on various topics. The largest is the teleconferencing system usenet(the user can "subscribe" to any of the available topics, view news, send messages). Another major teleconferencing system is IRC(Internet Relay Chat) (allows group members to chat on real mode time (interactive mode), in this case, the user sees constantly arriving information on the screen and at the same time can place his messages, which immediately appear on the screens of all other group members)

- The World Wide Web www(world wide web) - is an attempt to combine the capabilities of the above tools in one information tool, adding to them the transfer graphic images, sounds, video. The principle is based hypertext(- system information objects with cross-references, the documents contain links to other documents that are related in meaning). Previously used only for text documents, currently a hypertext document is called hypermedia document. Linked objects can be located on remote computers. Hypermedia documents are created using the special language HTML (Hypertext Markup Language) and stored on special servers(www-server, web-server). These documents are often referred to as Web pages or Web sites. The corresponding client programs are called browsers(from English browser) - search system. Majority modern browsers provide access not only to the pages of web servers, but also to other types of services. At the same time, referring to various resources, the so-called. URLs ( uniform resource locator). It has the following format: resource code://request specification. The resource code defines the type of service you need to work with: http - work with web servers, for browsing websites, ftp - ftp system, gopher - gopher system, news - communication with use-net, mailto - e-mail and etc.