Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
информатика UMKD_Angl.doc
Скачиваний:
1
Добавлен:
01.07.2025
Размер:
1.98 Mб
Скачать

Input-output devices.

The input-output device – a component of standard architecture of the Computer giving the computer interaction opportunity with the outside world and, in particular, with users and other computers.

The computer communicates with the outside world by means of peripherals. Only thanks to peripherals people can cooperate with the computer, and also with all devices connected to it. Any connected peripheral during every moment of time can be occupied with performance of the work charged to it or to stay waiting for a new task. Influence of speed of operation of peripherals on overall performance with the computer isn't less than speed of operation of its central processor. Speed of operation of external devices doesn't depend on speed of the processor.

The input equipment will transform information to a form clear to the car then the computer can process and remember it. The output equipment transfers information from machine representation to images, clear to the person. On drawing 4.6 classification of the input equipment is given.

Fig 4.2 – Classification of the input equipment

Output equipment.

Deduced information can be displayed in a graphic form, monitors, printers or plotter. Information can be reproduced also in the form of sounds by means of acoustic columns or headphones, it is registered in the form of tactile feelings in technology of virtual reality, it extends in the form of operating signals of the device of automatic equipment, it is transferred in the form of electric signals on a network.

The monitor (display) is the main output equipment of graphic information. The monitor – the device of visual representation of data. This main output equipment, but not only thing.

To receiving copies of the image on paper apply printers which are classified:

  • on a way of obtaining the image: warranty, matrix, jet, laser and thermal;

  • on a way of formation of the image: consecutive, lower case, page;

  • on a way of the press: shock, unaccented;

  • on chromaticity: black-and-white, color.

Plotter (graph plotter) is a device for display of vector images on paper, a tracing-paper, a film and other similar materials. Plotters are supplied with replaceable writing knots which can move along paper in the longitudinal and cross-section directions. Color feathers or knifes can be inserted into writing knot for paper. Graph plotters can be tiny, and can be so big that it is possible to draw a body of the car or a plane detail full-scale on them.

Review of modern hardware.

Hardware (a slang «iron») – electronic and/or mechanical parts of the computer, excepting its software and data (information which it stores and processes).

Hardware – a complex of the electronic, electric and mechanical devices which are a part of system or a network. The hardware includes:

1. computers and logic units;

2. external devices and diagnostic equipment;

3. power equipment, batteries and accumulators.

So far in the world hundreds and thousands various models of computers are developed. These models differ from each other the device in the ways of coding of information, sets of possible actions on data processing, volume of remembered information and speed of its processing. Let's consider the schemes most widespread now – classification by generations (topic 3) corresponding to historical development of computer facilities, and classification by application.

Size – big computer, minicomputer, micro computer and personal computer (mass, business, entertaining and workstations), fig. 4.3. On specialization level – universal, specialized. On standard sizes – desktop, portable, pocket. On compatibility – an equipment room, compatibility at OS level, program compatibility, compatibility at level of data

The architecture is most the general principles of creation of the computer, realizing programmed control by work and interaction of its main functional knots.

Openness of architecture is a property easy to choose structure of external devices for the computer, i.e. to configure it depending on a circle of solved tasks.

Base configuration of the personal computer.

The configuration is a structure of the equipment. The configuration of modern personal computers can be changed flexibly as required. Into structure of a base configuration enter: system block, monitor, keyboard, and mouse

Fig 4.3 – computers classification

Control questions:

1. What is «von Neumann's principle»?

2. What do actuation devices represent?

3. What are the blocks of Computers?

4. What is the arithmetic and logic unit (ALU)?

5. What are the control units?

6. What information does the team contain?

7. What teams are there?

8. How are the main devices of Computers connected?

9. What functions are carried out by memory?

10. What functions are carried out by the processor?

11. What are the interruptions?

12. What interruptions are there?

13. What is the memory of the computer?

14. What is the input equipment?

15. What is the output equipment?

16. What does the hierarchy of memory represent?

17. What is the cache memory?

18. What does the principle of placement of blocks in a cache memory define?

19. How is the main memory organized?

20. What are the principles of the organization of virtual memory?

Topic 5. Algorithmic solution of tasks, analysis of algorithmic complexity.

Strategy of the solution of tasks. Algorithms and search of decisions. Concept and properties of algorithms. Strategy of realization of algorithms. Structures of data: primitive types, massifs, lines. Block diagrams as graphic realization of algorithms. Main computing algorithms: final machine guns, Turing machine, it is easy also difficult solvable tasks. Analysis of algorithms: standard classes of complexity, an expense on memory size and time.

Strategy of the solution of tasks.

The theory of algorithms – a science studying the general properties and regularities of algorithms and various formal models of their representation. The formal proof of algorithmic insolvability of tasks, the asymptotic analysis of complexity of algorithms, classification of algorithms belong to tasks of the theory of algorithms according to complexity classes, development of criteria of a comparative assessment of quality of algorithms, etc.

Emergence of the theory of algorithms

Development of an algorithm theory begins the K. Gödel of theorems of incompleteness of the formal systems including arithmetic’s with the proof, first of which was proved in 1931. The assumption which has arisen in connection with these theorems of impossibility of algorithmic permission of many mathematical problems (in particular, a deducibility problem in predicate calculus) caused of standardization of concept of algorithm. The first standardized options of this concept were developed in the thirties the XX century in A.Turing, A.Church and Post’s operations. The Turing machine offered by them, the machine of the Post and Church lambda-calculus appeared the equivalent each other. Being based on Godel, S. Kleene operations entered concept of the recursive function, also appeared the equivalent above-mentioned.

One of the most successful standardized options of algorithm is the entered A.A.Markov concept of normal algorithm. It was developed ten years after Turing operations, the Post, Church and Kleene in connection with the proof of algorithmic insolubility of a row of algebraic problems.

It is necessary to mark also considerable contribution to an algorithm theory made by D.Knuth, A. Akho and J. Ullman. One of the best operations on this subject is the book «Algorithms: creation and analysis» Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein.

The current state of an algorithm theory

Now the algorithm theory develops, mainly, in three directions.

1. The classical algorithm theory studies problems of a statement of tasks in terms of the formal languages, enters concept of the task of permission, carries out classification of tasks by complexity classes (to P, NP, etc.).

2. The theory of the asymptotic analysis of algorithms considers methods of receiving asymptotic estimates of a resource contentor runtime of algorithms, in particular, for the recursive algorithms. The asymptotic analysis allows evaluating growth of need of algorithm in resources (for example, runtime) with increase in volume of input data.

3. The theory of the practical analysis of computing algorithms solves problems of receiving an explicit function of labor input, the interval analysis of functions, search of practical criteria of quality of algorithms, development of a technique of a choice of rational algorithms.

Algorithms and search of decisions. Concept and properties of algorithms.

In today's society the word «algorithm» is so widespread that to the majority intuitively it is clear. We understand any sequence of steps as it for achievement of this or that purpose. However for a theoretical science concept of «algorithm» rather difficult.

It is considered that uniquely identifying of algorithm isn't present, though generally different sources give very much the close determination.

So, in widespread determination of algorithm (within school course of informatics) it is possible to select the following components:

The algorithm is a finite sequence of instructions in language clear to the performer, setting process of the solution of tasks of a certain type and the leader to receiving the result which is single-digit defined by legal basic data.

In the last point of determination it is said that the result of execution of algorithm directly depends on basic data. I.e. the same algorithm in case of different basic data will yield different results. On the other hand, if to the same algorithm to transfer several times the same data, it shall give out as much time the same result.

The word «algorithm» occurs on behalf of a scientific IX century Mukhkhamed Ben Al-Horezmi («al-horezmi» –«algorithm») which described rules of execution of arithmetical actions in decimal numeration. The word «algorithm» then also began to designate these rules of computation. However eventually the concept of algorithm changed and in the XX century began to understand as it any sequence of actions leading to the solution of an objective.

At first determination of concept of algorithm was a mathematics problem, however eventually the algorithm theory began to develop at the expense of influence of opening not only in mathematician, but also in informatics. Now the algorithm is one of the principal concepts of informatics.

Strategy of realization of algorithms.

The algorithm of any complexity can be provided by a combination of three basic structures:

• Composition or followings;

• branching (alternative, if – that – differently);

• Iteration or a cycle (with a precondition, with a post condition, with a finite number of repetitions).

Characteristic of these structures is existence at them one input and one output.

First basic structure. The basic structure «composition or following» means that some operators shall be executed sequentially one after another and only once for runtime of this program. Set of the connected units of structures of «following» is called as the linear computing algorithm.

The operator is understood as the formal record of the instruction for execution of some sequence of actions.

Second basic structure. The second basic structure is «the alternative or branching». This structure provides, depending on result of check of a condition (it is true or lie), the choice of one of alternate ways of operation of algorithm, and each of ways carries to the general output.

Possible ways of execution of algorithm mark with the appropriate labels: truth/lie, yes/no, 1/0.

In that specific case it can appear that for one of the selected ways of actions it is not necessary to undertake. Such structure received the name «bypass» or structure «if».

The algorithm which composition includes basic structure «alternative or branching» is called as branching.

If in algorithm there are three and more directions of branching, it is possible to provide it in the form of set of several basic structures «if – that – differently». Such variety of structure «ramifying often» calls «multiple selections».

Third basic structure. Third basic structure «cycle». The cycle provides repeated execution or, in other words, cyclical operation of operators.

Distinguish three varieties of this structure:

•«a cycle – while»

•«a cycle – to».

• finite number of repetitions.

Group of the operators repeating in a cycle, are called as a cycle body. The main difference of structure «a cycle – while» from structure «a cycle – to» is that in the first structure operators of a cycle body depending on a condition cannot be executed absolutely whereas in structure «a cycle – to» the loop body will be executed at least once. It is possible to note that in structure «a cycle – while» check of execution of a condition is carried out before execution of operators of a cycle body, and in structure «a cycle – to» – after cycle body passing.

Cycles can contain in themselves other cycles. Such structures are called as nested cycle. The algorithms incorporating basic structure «cycle» are called as cyclical.

The considered basic structures are recommended to apply to observance of a structural campaign to algorithm elaboration. Real algorithms represent set of all considered basic structures. The cycle with the given number of repetitions (a calculating cycle) – designates repetition of some actions the specified number of times.

Properties of algorithm

Discretization (in this case, a divided on a part) and orderliness. The algorithm shall consist of separate actions which are executed sequentially one after another.

Determinacy (single-digit determinacy). Repeated application of one algorithm to the same set of basic data always yields the same result.

Formality. The algorithm shall not allow ambiguity of interpretation of actions for the performer.

Productivity and extremity. Operation of algorithm shall come to the end for a certain number of steps, thus the task shall be decided.

Mass character. A certain algorithm shall be applicable to all same tasks.

Develop can invent algorithms with only reasonable beings (for example, the person). And here it is formal (without thinking and without evaluating) to execute, any machines (for example, computers, household appliances). The matter is that the person is released from routine activities which often can take a lot of time, and guarantees it with machines.

However machines not people: instruments understand only limited number of commands and can process these (objects) of not all types. From this it follows that the developer of algorithm finally shall describe algorithm in admissible commands of a certain performer (that machine to which algorithm execution will be entrusted). Set of commands which this performer can execute, is called as an instruction set of the performer. Objects (this) over which the performer can execute actions, create the environment of the performer.

Programming language – means of record of algorithms for computers

Universal performers are the computer. With its help it is possible to execute various algorithms by types: to do mathematical computation, to process text data, to change a graphics, etc. In any sense the computer can do a lot of things, as the person, and some things much quicker. However the person and the computer «talk» in absolutely different languages: one – on natural (Russian, English, etc.), and another – in the formal (machine) language.

Having developed algorithm, the person shall «explain» it to the computer somehow. For these purposes programming languages serve, and result of record of algorithm on them is the program.

Now the programming language is rather a certain intermediary between the person and the computer. The program written in a programming language, in a consequence is translated to a machine language by the translator.

The study of algorithms has the big practical significance. It is connected to that creation of algorithm assumes the detailed description of each step of the solution of the task, and finally the step of algorithm can be rather simple for execution by its computer. So tasks for which it is possible to work out algorithm of their decision, can be automated, i.e. are shifted «on shoulders» machines.

However it is necessary to remember always, what not all tasks have the algorithmic decision.

Thus for those tasks which after all have the algorithmic decision, different algorithms can be developed. But only one will be the most likely effective.

Structures of data: primitive types, massifs, lines. Block diagrams as graphic realization of algorithms.

On case of the block and circuit description the algorithm is figured by the geometrical figures (units) connected on control of lines (the flow directions) with arrows. In units the sequence of actions registers.

This method in comparison with other methods of record of algorithm has a row of advantages. It is most evident: each operation of calculating process is figured by separate geometrical figure. Besides, the graphics image of algorithm demonstrates ramifying of solutions of the task depending on different conditions, repetition of separate stages of calculating process and other details.

Design of programs shall correspond to certain requirements.

Operations of data handling and information media are figured on the diagram by the appropriate units. The most part of units on creation is conditional inscribed in a rectangle with the sides a and b. The minimum value and is equal 10 mm, the increase and is made on the number multiple of 5 mm. B=1,5 size of mm. For separate units the ratio between a and b, equal 1:2 is allowed. Within one diagram it is recommended to figure units of the identical sizes. All units are numbered. Types and assignment of main units are given in table 5.1.

The lines connecting units and specifying sequence of communications in between, shall be carried out parallel to frame lines. The arrow at the end of the line cannot be put, if the line is directed from left to right or from top to down. The unit can include some lines, which are the unit can be the successor of any number of units. Only one line can quit the unit (except logical). The logic block can have one of two units, and of it as continuation there are two lines. If on the diagram merge of lines takes place, the place of intersection is selected with a point. In a case when one line approaches to another and their merge is explicitly expressed, the point can be not put. The diagram of algorithm should be executed as a unit, however it is in case of need allowed to tear off the lines connecting units.

If in case of a line breakaway continuation of the diagram is on the same leaf, on one and other end of the line the special character a connector – a circle in diameter of 0,5 mm is figured. In conjugate circles the same identifier is specified. As the identifier the sequence number of the unit to which the connecting line is directed is, as a rule, used. If the diagram occupies more than one leaf, in case of a rupture of the line instead of a circle the inter page connector is used. In each connector the address – from where and where the connecting line is directed is specified. The address registers in two lines: in the first leaf number, in the second – sequence number of the unit is specified.

Table 5.1 – Table of main units:

1.process

Группа 381

2.predetermined

process

(subprogram)

Группа 368

Группа 363

3. flowlines

Группа 351

4. beginning - end

Группа 341

5. condition

6. input-output

Группа 327

7. modification

Группа 313

8. comments

Группа 298

9. inside - page

Группа 292

10. inter page connector

Группа 279

Analysis of algorithms

It is possible to carry the following to the main methods of the description of algorithms:

• Verbal and formular (in a natural language);

• Structural or block and circuit;

• With use of special algorithmic languages;

• By means of graphs diagrams;

• By means of Petri nets.

Before compilation of programs verbal and formular and block and circuit methods more often are used. Sometimes before compilation of programs on low-level languages of programming such as Assembler language algorithm of the program write, using constructions of some high degreed programming language. It is convenient to use the program description of algorithms of functioning of difficult program systems. So, for the description of principles of functioning of OS the Algol-like high-level language of programming was used.

In case of a verbal and formular method the algorithm registers in the form of the text with formulas on the points defining sequence of actions. Let, for example, it is necessary to find value of the following expression: у=2а-(х+6).

The algorithm of the solution of this task can be written by a verbal and formular method in the following look:

1. To enter values a and x.

2. To add x and 6.

3. To multiplicate a on 2.

4. To subtract from 2а the sum(х+6).

5. To output y as result of expression evaluation.

The flowchart shall contain all ramifying, cycles and appeals to the subprograms, containing in the program.

Main computing algorithms: finite state machines, the Turing machines, it is easy also difficult solvable tasks.

The Turing machine (MT) – the abstract performer (the abstract computer). It was offered by Alan Turing in 1936 for formalization of concept of algorithm.

The Turing machine is extension of the finite state machine and, according to Church thesis – Turing, is capable to imitate all other performers (by means of the job of rules of transition), somehow implementing process of step by step computation in which each step of computation is rather elementary.

Turing machine device

The composition of the Turing machine includes the tape infinite in both sides (the Turing machines which have some infinite tapes are possible), partitioned into cells, and the control device, capable to be in one of a set of statuses. The number of possible statuses of the control device is finite and precisely set.

The control device can move to the left and to the right on a tape, to read and write in tape cells characters of some finite alphabet. The special empty character filling all cells of a tape, except those from them (finite number) on which input data are written is selected.

The control device works according to rules of transition which represent the algorithm implemented by this Turing machine. Each rule of transition orders to the machine, depending on a current status and the character watched in the current cell, to write in this cell the new character, to pass to a new status and to move on one cell to the left or to the right. Some statuses of the Turing machine can be marked as terminal, and transition to any of them means the operation end, an algorithm stop.

The Turing machine is called as determined if to each combination of a status and the tape character in the table there corresponds no more than one rule. If there is pair «the tape character – a status» for which there are 2 and more commands, such Turing machine is called as nondeterministic.

Turing machine description

The specific Turing machine is set by listing of set members of letters of the alphabet of A, a set of statuses of Q and rule set on which the machine works. They look like: qiaj→qi1aj1dk ((if the head is in qi status, and in a surveyed cell the letter qi, s written, the head passes to aj, status, in a cell instead of qi1, in to aj written aj1, registers, the head does movement of dk, which has three options: on a cell to the left (L), on a cell to the right (R) to remain on a place (N). For each possible configurations<qi, aj>available exactly one rule. Rules aren't present only for a final status, having got in which machine stops. Besides, it is necessary to specify finite and initial statuses, an initial configuration on a tape and layout of a head of the machine.

Analysis of algorithms: standard classes of complexity, an expense on memory size and time.

In informatics, the theory of complexity of computation is the section of the theory of the computation, studying the working costs, a computing problem required for the decision. Cost is normally measured by the abstract concepts of time and the space, called computing resources. Time is defined by quantity of the trivial steps necessary for a solution whereas the space is defined by memory size or places on the data medium. Thus, in this area attempt to answer the central question of algorithm elaboration is undertaken: «how time of execution and volume of busy memory depending on the size (input and output) will change?».

In particular, the theory of complexity of computation defines NP complete tasks which the nondeterministic Turing machine can decide for polynomial time whereas for the determined Turing machine the polynomial algorithm is unknown.

Types of difficulties.

The number of the elementary operations expended by algorithm for the solution of a specific copy of the task depends not only on the size of input data, but also from data. For example, the number of operations of algorithm of sorting by insertions is much less if input data are already sorted. To avoid similar difficulties, consider concept of time complexity of algorithm at worst.

Time complexity of algorithm (at worst) is a function of the size of input and output data, equal to the maximum quantity of the elementary operations made by algorithm for the solution of a copy of the task of the specified size. In many tasks the size of an output doesn't exceed or is proportional to the size of an input – in this case it is possible to consider time complexity as function of the size of only input data.

Spatial complexity.

Spatial complexity of algorithm (at worst) is a function of the size of input and output data, equal to the maximum quantity of the expended memory expended by algorithm for the solution of a copy of the task of the specified size. In many tasks the size of an output doesn't exceed or is proportional to the size of an input – in this case it is possible to consider spatial complexity as function of the size of only input data.

Asymptotic complexity.

In spite of the fact that function of time complexity of algorithm in certain cases can be defined precisely, in most cases look for its exact value senselessly. The matter is that, first, exact value of time complexity depends on determination of elementary operations (for example, it is possible to measure complexity in number of arithmetical operations or operations on the Turing machine), and secondly, in case of increase in the size of input data a contribution of constant multipliers and items of the lower orders, figuring in expression for exact time of operation, becomes the extremely insignificant.

Asymptotic complexity – consideration of entrance data of the big size and assessment of an order of growth of operating time of algorithm. Usually the algorithm with smaller asymptotic complexity is more effective for all entrance data, except for only, probably, data of the small size.

Criteria of an assessment of complexity.

If the created program is used only a few time, then cost of writing and debugging of the program will dominate in a total cost of the program. In this case it is necessary to prefer algorithm, the simplest for implementation.

If the program works only with «small» input data, the level of growth of runtime will be had by smaller value, than a constant which is present at a formula of runtime. At the same time and the concept «smallness» of input data depends on exact time of execution of competing algorithms. There are algorithms, such as algorithm of integer multiplication; asymptotically the most effective but which never use in practice even for big tasks as their constants of proportionality considerably exceeds similar constants of other, simpler and less «effective» algorithms.

Effective, but difficult algorithms can be unwanted if ready programs will be supported by the persons who are not participating in writing of these programs.

Some examples when effective algorithms require such large volumes of machine memory (without possibility of use of slower external means of storage) are known that this factor nullifies advantage of «efficiency» of algorithm.

In numerical algorithms accuracy and stability of algorithms are at least important, than their temporal efficiency.

Complexity classes.

The class P contains all those problems which decision is considered «fast», that are polynomial depending on the size of an input. Sorting, search in a set; clearing up of connectivity of graphs and many other here belongs.

The class NP contains tasks which the nondeterministic Turing machine in a status to decide for a polynomial amount of time. It is necessary to note that the nondeterministic Turing machine is only the abstract model while the modern computers correspond the determined Turing machine with limited memory. Thus, the class NP includes a class P, and also some problems for which decision the algorithms which are exponentially depending on the size of an input (i.e. ineffective for big inputs are known only). Many well-known problems enter into the class NP, such as the task of the direct-sales representative, the task of feasibility of Boolean formulas, factorization, etc.

Examples.

If at increase in the size of the entrance massif in 2 times the number of iterations of algorithm on its processing возрастёт in 4 times, is square-law dependence.

It is possible to receive this function and experimentally – it is necessary to measure simply algorithm operating time on various volumes of entrance data and to construct the schedule.

It can appear that the algorithm with bigger labor input will be more effective on small volumes of data as factors at its calculation usually fall and the limiting assessment is considered at n →∞. Therefore to you, probably, it will be more interesting to measure real productivity and to receive graphic dependence experimentally.

Control questions:

1. Who entered for the first time concept algorithm?

2. What methods and methods are for implementation of algorithms?

3. What main algorithms exist?

4. What difference of algorithmic language and programming languages?

5. Specify computing algorithms?

6. Tell about the Turing machine?

7. What is the flowchart?

8. List the main properties of algorithm

9. What complexity classes of algorithms exist? Give their characteristic

10. What types of complexity of algorithms exist? Give their characteristic

Topic 6. Acquaintance to programming languages. Review of programming languages: history of programming languages. Main designs of programming: bases of syntax and semantics of a higher-level programming language. Variables, expressions and giving, the elementary input-output, operators of branching and iterative operators. Programming paradigms. Procedural programming. Concepts of modular and structural programming. Object-oriented programming.

Review of programming languages: history of programming languages.

Information technologies occupy more and more significant role in human society. They got into all fields of activity. For service of public requirements for automation of work, data storage, communication, etc. programming languages develop. If earlier programming languages were used only for creation of programs for automation of computing processes, today they are used for the solution of more various tasks.

Studying of history of programming languages, their variety and features allows the programmer to make a right choice at a language choice for the solution of a certain task.

All variety of programming languages divides into various classes depending on tasks solved by them. It was noticed that in development the programming languages entering into one class, approach among themselves. Though a variety of classes increases, since the sphere of the tasks solved by means of computer technologies increases.

It is necessary to note also and development of programming languages towards the specification when certain languages are most suitable for the solution of a narrow class of tasks.

One more feature is leaving from obvious formalization. If the first languages differed strongly pronounced formality, with the advent of object-oriented and logic approaches the formality ceased to be so obvious (though it certainly is). It can lead to increase in semantic (semantic) mistakes when the program does not that the programmer planned. Let's add to it the fact of progressing of a robotics, it is a little imagination, and it is possible to represent already as the artificial intelligence leaves from under mankind control.

If to trace an evolutionary way of development of programming languages, it is possible to note analogy to development of the live world. When at first there were only simple organisms (and programming languages), and then appeared more difficult. And both there and there it is possible to mark the following:

Low-level languages and the elementary organisms didn't lose the value and till today. For example, bacteria are pioneers when mastering new habitats. And language the assembler is the irreplaceable tool in case of return of direct commands to the processor and support of high performance of computation.

Both the high-organized organisms, and languages of high and ultrahigh levels are very various and specific. For example, the mammals, thus each animal are very diversiform is rigidly adjusted for specific conditions of the environment. Languages of ultrahigh level are diversiform also, and each of them well solves only certain class of tasks.

In the live world one animal who learned to be rather independent of environmental conditions was selected only is a person. Therefore the question is logical: «Whether there will be programming languages which can optimum solve any problem, and at a bit different level, than languages existing today? ». Probably, the response on it a question lies within study of machine intelligence and so-called CASE systems. The robot, the production machine or a household appliance is controlled the person. Thus the person isn't necessary at the instrument and doesn't give it a command one for another, and definitely writes their sequence in memory of the machine. The sequence of commands defining activities of the computer in the given conditions represents the program. Compilation of similar programs is a programming – widespread today a human activity.

Programming languages

Прямая соединительная линия 400

nonprocedural

procedural

Прямая соединительная линия 394 Прямая соединительная линия 396

highlevel

lowlevel

objective

declarative

Fig 5.1 – Classification of languages

The program is a plan of activities of the performer (for example, the computer) according to the solution of a certain type of tasks. To make the plan, are important logical and other forms of thinking, knowledge of conditions of execution of the program and possibilities of the performer, preguessing of possible errors, and also ability to write the program on clear to the performer language – a specific programming language. It also is the main knowledge, skills of the programmer.

Actually computers (computers) can execute only the elementary commands, like addition of the whole values, changeover of zero by unit, unit relocation from one cell in another, etc. But these computers make operations with such speed which to us, people, and didn't dream and in it their principal advantage.

All programs, in fact, process data. Thus the concept of data can be treated very widely. However all of them for the modern computers are encoded by a certain set of zero and units. In the machine of the program work with such bit data, but the modern programmer cannot see such «meanness» and operate with customary concepts for the person: numbers, in the lines, objects, etc.

Often, exactly the programs set on the computer define its assignment. Designer features can leave on the second plan.

Machines from the point of view of their possibilities of data handling are universal (work with 0 and 1), and the person writes commands in a programming language which satisfies it to possibilities more. Therefore, there shall be the intermediate program for conversion of commands from a programming language on language of machines. And such programs exist in the form of so-called compilers and interpreters. They are very various, since there is a set of programming languages, each of which has the compiler or the interpreter. In other words computers are «told» almost always in one language, and by programmers – in different languages. The program made in algorithmic language, can't be directly executed by a computer.

Translators of programming languages happen two types: interpreters and compilers. The interpreter – is the program which provides serial «translation» of instructions of the program on a machine language with their simultaneous execution. Advantage of interpreters is convenience of debugging of the program (search of errors in it) since its «step by step» execution is possible, and a shortcoming – rather small speed of execution.

The compiler operates differently; it transfers all text of the program to a machine language and saves it in an executable file (normally with extension.ехе). Then this file already ready to execution written on a machine language, it is possible to launch on execution repeatedly. Advantage of compilers is the high speed of execution of the program, and a shortcoming – labor input of debugging since step by step execution of the program is impossible.

The modern programming systems and, including Visual Basic, allow to work as in an interpreter mode, and the compiler.

It is possible to explain variety of programming languages diversity of spheres of human activities, historical development of computer technologies and the competition of developers of programming systems, and also some other factors.

Now programming became a widespread human activity.

Short history of programming languages

Machine instructions

The real programming in the modern understanding began with the moment of creation of the first electronic computer.

The first computers allowed executing programs on a machine language which is the single language, to clear computers. It is implemented is hardware: each command is executed by some electronic device.

Machine instructions are written in the binary code. The logician of operation of similar programs is very difficult for understanding because of that, the program represents a continuous set of zero and units. For example, any groups designated numbers, others – operations over them.

To read and understand, as the program written in binary codes works, it was very difficult, finding and correcting in it a mistake.

Mnemocodes

Therefore for simplification of the operation programmers invented mnemocodes (from Greek mnemon – to remember) – letter symbols of machine binary instructions which it is simpler to remember, than sequences of zero and units.

For operation simplification with storage cells began to use concept of a variable.

Variable – in programming this letter symbol of area of memory in which some value is stored.

For transfer of mnemocodes to machine instructions and names of variables in cell addresses of memory the special program – the translator was used.

Languages of mnemocodes received the name of assemblers.

Structured programming

Gradually programmers came to a conclusion that all computation is reduced to such elementary actions, as data entry, data output, execution of different operations over data, a choice of a branch of execution of the program on the basis of the accepted decision, repetition of group of operations.

There were the languages based on these basic operations which began to call structural or languages of the high level.

The modern programming

Now exist a set of programming languages: as enough the universal and very specific. Many programmers tried and try to invent the language possessing these or those advantages. It is possible to separate only conditional languages by certain criteria. For example, as solved tasks (language of system or application-oriented assignment), on a level of orientation to the solution of a narrow circle of tasks (problem-oriented or the universal).

Main constructions of programming: bases of syntax and semantics of a high-level language of programming.

As well as normal languages, at programming languages have syntax. The language syntax (programming) is a rule set which define, what strings are read by admissible expressions (programs) in language. Syntax is set by means of the formal notation. The most widespread formal notation of syntax is Bekus-Naur's (RBNF) expanded form. In RBNF we shall begin with object of the most top level, from the program, and applying rules of decomposition of objects, yet we will not reach level of the separate character. For example, in language about syntax:

Declaration - a variable:: = qualifier type identifier {, identifier };

It is read so: variable declaration represents a type qualifier which the identifier (a variable name) and optional sequence of the identifiers separated by a comma follows; the semicolon at the end is put.

Semantics is a sense of an expression (program) in (programming) language. Formalization of semantics of programming languages gives an additional priority – there is a possibility to prove correctness of the program. In fact, execution of the program can be formalized by means of axioms which describe how the operator will transform the status, satisfying to the statement on an input, to a status which satisfies to the statement on an output.

Data. In case of the first acquaintance to programming languages normally attention with concentration on operators and commands. Only after study of operators and their use, we address to data. In the modern languages operators are read by means of data manipulation which is used for representation of some object. Central programming concept:

Type – this set of values and set of operations over these values. Determination of type depends on language. Let's give some determination in case of discussion of data.

Value. The elementary indefinite concept.

Literal. The specific value given in the program «literally», in the form of a string. For example: 154, FALSE, «programming».

Representation. The value provided in the computer by specific bit string. For example: character value 'x', can be provided in the line from eight bits 01 11 10 00

Variable. The name, appropriated storage cells or to cells which can contain value representation of specific type. Value can change in the course of a program runtime

Constant. The constant is a name, appropriated storage cells or to cells which can contain value representation of specific type. Value can't be changed in program runtime.

Object. The object is a variable or a constant.