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 an address). The largest sequence of bits that a computer can process as a whole is called a machine word. The length of a machine word depends on the word capacity of the processor and can be equal to 16, 32 bits, etc. One byte is enough to encode characters. In this case, 256 characters can be represented (with decimal codes from 0 to 255). The IBM PC character set is most often an extension of the ASCII code (American Standard Code for Information Interchange - the standard American code for information interchange). 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 the 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. Another way to represent integers is two's complement. 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 other names) range from -32768 ( -2 15) to 32767 (2 15 - 1), and 2 bytes are allocated for their storage; type LongInt - in the range from -2 31 to 2 31 - 1 and are placed in 4 bytes; word type - in the range from 0 to 65535 (2 16 - 1) (2 bytes are used), etc. As you can see from the examples, the data can be interpreted as both signed and unsigned numbers. 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. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 The two's complement code of a 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, then its direct code will be 0000000000100101, and if it is a LongInt value, then its direct code will be. For a more compact notation, a hexadecimal code is more often used. The resulting codes can be rewritten as 0025 (16) and 00000025 (16) respectively. An additional code of a negative integer can be obtained by the following algorithm: 1) write down the direct code of the number modulus; 2) invert it (replace ones with zeros, zeros with ones); 3) add one to the inverse code. For example, let's write the additional code of the number (-37), interpreting it as a value of the LongInt type: 1) there is a direct code of 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: 1) subtract the number 1 from the code; 2) invert the code; 3) convert to decimal number system. Write the resulting number with a minus sign. Examples. Let's write down the numbers corresponding to additional codes: a) 0000000000010111. Since zero is written in the high order, the result will be positive. This is the code for the number 23; b) 1111111111000000. The code of a negative number is written here. We execute the algorithm: 1) 1111I11111000000 (2) - 1 (2) = 1111111110111111 (2) ; 2) 0000000001000000; 3) 1000000 (2) = 64 (10) . Answer: -64. A slightly different method is used to represent real numbers in the memory of a personal computer. Consider the representation of floating point values. Any real number can be written in the standard form М10 р, where 1

Personal IBM computer PC allows you to work with the following real types (the range of values ​​is indicated by absolute value): Let's show the transformation of a real number to represent it in the computer's memory using the Double type as an example. As can be seen from the table, the value of this type occupies 8 bytes in memory. The figure shows how the mantissa and order fields are represented here: the mantissa occupies the lower 52 bits. The bar indicates the position of the binary point here. The decimal point must be preceded by a bit of the integer part of the mantissa, but since it is always 1, this bit is not required here and the corresponding bit is not in memory (but it is implied). The exponent value is stored as an offset number to simplify calculations and compare real numbers, i.e. an offset is added to the real value of the order before it is written to memory. The offset is chosen so that minimum value order corresponded to zero. For example, for type Double, the exponent is 11 bits and ranges from 2~1023 to 21023 , so the offset is 1023 (10) = 1111111111 (2) . Finally, bit number 63 indicates the sign of the number. Thus, the following algorithm follows from the foregoing for obtaining a representation of a real number in the computer's memory: 1) convert the modulus of a given number to a binary number system; 2) normalize the binary number, i.e. write in the form M-2 P, where M is the mantissa (its integer part is 1 (2)) and p is the order written in the decimal number system; 3) add an offset to the order and translate the offset order into a binary number system; 4) taking into account the sign of the given number (0 - positive; 1 - negative), write out its representation in the computer memory. Example. Let's write the number code -312.3125. 1) The binary representation of the modulus of this number is 100111000.0101. 2) We have 100111000.0101 = 1.001110000101 2 8 . 3) We get the shifted order 8 + 1023 = 1031. Then we have 1031 (10) = 10000000111 (2) . . 4) Finally

1) First of all, we notice that this is a code of a positive number, since zero is written in bit number 63. Let's get the order of this number: 01111111110 (2) = 1022 (10) ; 1022 - 1023 = -1. 2) The number looks like 1.1100011-2" 1 or 0.11100011. 3) Converting to the decimal number system, we get 0.88671875.

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 the character code establishes the correspondence of letters and other characters to binary combinations.

There are three number formats for numbers:

    fixed-point binary;

    binary floating point;

    binary coded decimal (BCD).

In fixed-point binary, numbers can be represented unsigned (codes) or signed. To represent numbers with a sign in modern computers, an additional code is mainly used. This leads to the fact that, as shown earlier, negative numbers for a given length of the bit grid can be represented by one more than positive ones. Although computer operations are performed on binary numbers, they are often written in programming languages, in documentation and displayed on the display screen using more convenient octal, hexadecimal and decimal representations.

In binary coded decimal format, each decimal digit is represented as a 4 bit binary equivalent. There are two main varieties of this format: packed and unpacked. In packed BCD format, a string of decimal digits is stored as a sequence of 4-bit groups. For example, the number 3904 is represented as a binary number 0011 1001 0000 0100. In the unpacked BCD format, each decimal digit is in the lower tetrad of an 8-bit group (byte), and the contents of the higher tetrad are determined by the coding system used in this computer, and in this case insignificant. The same number 3904 in unpacked format will take 4 bytes and look like this:

xxxx0011 xxxx1001 xxxx0000 xxxx0100 .

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. By controlling the settings of the coprocessor, you can change the range and precision of the representation of data of this type ( table 14.1).

Table 14.1.

Data type

Size (bit)

Range

Processing block

Integers without a sign

1 double word

signed integers

1 double word

2147483648...+2147483647

1 quad word

Floating point numbers

real number

double precision

≈(0.18*10 309)

with increased accuracy

≈(0.12*10 4933)

Binary Decimal Numbers

1 byte unpacked

1 byte packed

10 bytes packed

0...(99...99) 18digits

Organization of RAM

OP is the main memory for storing information. It is organized as a one-dimensional array of memory cells with a size of 1 byte. Each of the bytes has a unique 20 bit physical adress in the range from 00000 to FFFFFh (hereinafter, the hexadecimal number system is used to write addresses, the sign of which is the symbol h at the end of the code). Thus, the size of the address space of the OP is 2 20 = 1 MB. Any two contiguous bytes in memory can be treated as a 16-bit word. The low byte of a word has a lower address, and the high byte has a higher address. So the hexadecimal number 1F8Ah, which occupies a word, will be located in the memory in the sequence 8Ah, 1Fh. The address of a word is the address of its least significant byte. Therefore, a 20-bit memory address can be considered both a byte address and a word address.

Commands, bytes and data words can be placed at any address, which saves memory due to its fuller filling. However, to save program execution time, it is advisable to place data words in memory starting from an even address, since the microprocessor transmits such words in one bus cycle. A word with an even address is said to be word-aligned. Unaligned data words with an odd address are allowed, but they require two bus cycles to transfer, which reduces the performance of the computer. Note that the required number of data word read cycles is automatically initiated by the microprocessor. It should be kept in mind that during operations on the stack, the data words must be aligned and the stack pointer initialized to an even address, since only data words are involved in such operations.

The instruction stream is divided into bytes when the instruction queue inside the microprocessor fills up. Therefore, instruction alignment has little to no effect on performance and is not used.

The address space of the OP is divided into segments. A segment consists of adjacent RAM cells and is an independent and separately addressable memory unit, which in the basic architecture of a personal computer has a fixed capacity of 2 16 = 64K bytes. Each segment is assigned a start (base) address, which is the address of the first byte of the segment in the address field of the OP. The value of the physical address of the cell is the sum of the address of the segment and the offset of the memory cell relative to the beginning of the segment (intra-segment offset). 16-bit words are used to store the segment address and offset values.

To obtain a 20-bit physical address, the microprocessor automatically performs the following operations. The value of the base address of the segment is multiplied by 16 (shifted 4 bits to the left) and added to the offset value in the segment ( rice. 14.3). The result is a 20-bit physical address value. When summing, a carry from the most significant bit may occur, which is ignored. This leads to the fact that the OP turns out to be organized according to the ring principle. The cell with the maximum address FFFFFh is followed by the cell with the address 00000h.

Rice. 14.3. Scheme for obtaining a physical address

Segments are not physically tied to a specific RAM address, and each memory cell can belong to several segments at the same time, since the base address of a segment can be determined by any 16-bit value. The segments may be adjacent, non-overlapping, partially or completely overlapping. However, according to the physical address calculation algorithm, the starting addresses of the segments are always a multiple of 16.

Logical and arithmetic foundations and principles of computer operation

Literature: print version

Course textbooks

    Gurov V.V., Chukanov V.O. Fundamentals of the theory and organization of computers

    Varfolomeev V.A., Letsky E.K., Shamrov M.I., Yakovlev V.V. IBM eServer zSeries architecture and technology Internet University of Information Technologies - INTUIT.ru, 2005

    Bogdanov A.V., Korkhov V.V., Mareev V.V., Stankova E.N. Architectures and topologies of multiprocessor computing systems Internet University of Information Technologies - INTUIT.ru, 2004

    Novikov Yu.V., Skorobogatov P.K. Fundamentals of microprocessor technology Internet University of Information Technologies - INTUIT.ru, 2006

Bibliography

    Avanesyan G.R., Levshin V.P. Integrated circuits TTL, TTLSH: Handbook M.: Mashinostroenie, 1993

    Atovmyan I.O. Computing architecture M.: MEPhI, 2002

    Borkovsky A. English-Russian Dictionary of Programming and Informatics (with interpretations) M.: Russian language, 1990

    Brodin V.B., Shagurin I.I. Microprocessor i486.Architecture, programming, interface M.: DIALOGUE-MEPhI, 1993

    Gurov V.V. Synthesis of combinational circuits in examples M.: MEPhI, 2001

    Gurov V.V., Lensky O.D., Soloviev G.N., Chukanov V.O. Architecture, structure and organization of the computing process in computers such as IBM PC M.: MEPhI, 2002. Ed. G.N. Solovyov

    Kagan B.M. Electronic computers and systems Moscow: Energoatomizdat, 1991

    Kazarinov Yu.M., Nomokonov V.N., Podkletnov G.S. and etc. Microprocessor kit K1810: Structure, programming, application M.: Higher school, 1990. Ed. Yu.M. Kazarinova

    Korneev V.V., Kiselev A.V. Modern microprocessors M.: Knowledge, 1998

    Liu Yu-zheng, Gibson G. Microprocessors of the 8086/8088 family M.: Radio and communication, 1987

    Mayorov S.A., Novikov G.I. The structure of electronic computers L .: Mashinostroenie, Leningrad department, 1979

    Nikitin V.D., Solovyov G.N. Operating systems M.: Mir, 1989

    Saveliev A.Ya. Applied Theory of Digital Automata Moscow: Higher School, 1987

    GOST 15133-77. Semiconductor devices, terms and definitions

    GOST 17021-75. Microelectronics, terms and definitions

Logical and arithmetic foundations and principles of computer operation

Subject index: print version

PER PAGE I BUT B AT D W And To L M H O P R FROM T At F C H W E

Neumann machine

10 (1 ),

Turing machine

10 (1 ),

2 (1 , 2 , 3 , 4 ),

In addition to ordinary algebra, there is a special one, the foundations of which were laid by the 19th-century English mathematician J. Boole. This algebra deals with the so-called propositional calculus.

Its peculiarity is its applicability for describing the operation of so-called discrete devices, which include a whole class of automation and computer technology devices.

In this case, algebra itself acts as a device model. This means that the operation of an arbitrary device of the specified type can only be described in some respect using the constructions of this algebra. The actual real device does not physically work as described by the algebra of logic. However, the application of the provisions of this theory allows us to make a number of practical generalizations.

... lecture 2, page 1 »

12 (1 ), 14 (1 , 2 ),

argument

2 (1 , 2 , 3 ),

performance

1 (1 , 2 ),

The performance is characterized by the signal propagation delay introduced by one elementary element (conjunctor, disjunctor, etc.). ... lecture 1, page 1 »

address decoder

12 (1 ),

Veitch diagram

4 (3 , 4 ),

disjunction

2 (3 , 4 ),

This compound statement is true if at least one of the statements in it is true. ... lecture 2, page 4 »

Memory device

10 (2 ),

A storage device, or memory, is a collection of cells designed to store some code. Each of the cells is assigned its own number, called the address ... lecture 10, page 2 »

implicant matrix

4 (2 ),

An implicant matrix is ​​compiled, the columns of which are called unit constituents, and the rows are called simple implicants. ... lecture 4, page 2 »

inversion

2 (3 ),

inverter

13 (1 ),

Quine McCluskey

4 (2 ),

command coding

11 (1 , 2 ),

conjunction

2 (3 , 4 ),

A conjunction function is true if both statements are true at the same time. ... lecture 2, page 4 »

indirect addressing

11 (2 ),

mantissa

7 (2 ),

Turing machine

10 (1 ),

machine infinity

9 (3 ),

microprocessor

14 (1 , 2 ),

minimization

3 (2 , 3 ),

When minimizing the FAL, they strive to obtain a form in which there will be fewer letters than in the original one. In relation to DNF, this form is called abbreviated (Sok. DNF).

The meaning of building Sok. DNF lies in the fact that it includes such elementary products that cover more than one unit with their units original function, but a few.

... lecture 3, page 2 »

incompletely defined function

5 (1 ),

An incompletely defined function is such a switching function, the values ​​of which on some sets of arguments can be arbitrary (ie equal to "0" or "1"). ... lecture 5, page 1 »

return code

7 (5 ),

The reverse is the code for which "0" is written in the sign bit of a positive number, the module of the number is written in the digital ones, and one is written in the sign bit for the negative one, and the inverted bits of the original number are written in the digital ones. ... lecture 7, page 5 »

homogeneity

6 (1 ),

12 (1 ),

relative addressing

11 (2 ),

6 (2 , 3 , 4 ),

personal computer

14 (1 , 2 ),

packing density

1 (1 ),

An important indicator is the packing density, the number of units of elements per 1 cm 3. ... lecture 1, page 1 »

7 (2 ),

direct addressing

11 (2 ),

direct code

7 (4 , 5 ),

6 (1 , 2 , 3 ),

address register

12 (1 ),

instruction register

12 (1 ),

register memory

14 (1 ),

divisor shift

9 (1 ),

3 (1 , 2 , 3 ),

14 (1 , 2 ),

2 (1 , 2 ),

notation

6 (1 , 2 , 3 , 4 ),

Let's call a way of representing an image of arbitrary numbers with the help of some finite set of symbols a number system. ... lecture 6, page 1 »

addressing method

11 (2 ),

adder

13 (2 ),

program counter

12 (1 ),

accuracy

7 (1 , 2 ),

control signal

12 (1 ),

physical adress

14 (2 ),

fixed point

7 (1 , 2 , 4 ),

2 (1 , 2 , 3 , 4 ),

floating point number

14 (2 ),

Schaeffer stroke

5 (3 ),

Neumann element

10 (1 ),

The Neumann element (EN) is a device that, at each cycle, is in one of the finite number of states r i R that form its alphabet... lecture 10, page 1 »

PER PAGE I BUT B AT D W And To L M H O P R FROM T At F C H W E

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 with an absolute value less than one.

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 system calculus - 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

Divide the binary representation into 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 a 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. Result operations 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 operation not has the highest priority, 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 path is indicated before its name, and then after \ - the name of the file (for example, C:\Windows\win.com - means that the win.com file is located in 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- the main 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, which allow connecting 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 different types, to connect networks with different computer systems(for example, local network - mainframe, local network - global network, 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 members of the group)

- 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.

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 optical disc this corresponds to the presence or absence of a recess. 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 used is a byte consisting of 8 bits => each byte can take 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 with them 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 of the decimal number system. 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 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 magnitude 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 can represent 16 decimal numbers (from 0 to 15). The hexadecimal number system is used as a shorthand for viewing or modifying binary data. Programs , which ensure the "direct" work of a person with data stored in the computer's memory, when interacting with a person, they automatically convert binary representation 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.