Сделай Сам Свою Работу на 5

TEXT A. THE BASIC PRINCIPLES OF PROGRAMMING





 

1. Introduction. The purpose of this chapter is to introduce the student to the fundamental principles of coding and programming. These principles are connected with the stages of programming, the flow-charting, using the subroutines and the computer manual, etc. In order to leave students free to concentrate on these principles, the four-address format, with a minimum of instruction types, is utilized. However, it should be pointed out that the four-address format is used in this chapter for pedagogical reasons only. In practice commercially available computers use only three-, two-, or one-address formats, the latter perhaps being the most common.

2. The Terms ‘Coding’ and ‘Programming’ are often used as synonyms. However, ‘a code’ is more specifically a short list of instructions that direct the computer to perform only a part of the entire calculations, whereas the term ‘program’ refers to the complete list of instructions used for the problem. Hence the term ‘programming’ usually includes the over-all planning of the use of the computer for a particular problem as well as the writing of the instruction lists, or codes, whereas ‘coding’ is usually limited in meaning to the writing of the instruction lists. Sometimes a code is called a routine.

3. Stages in Programming. There are five stages in programming. First the computations to be performed must-be clearly and precisely defined. The over-all plan of the computations is diagrammed by means of so-called flow chart. The second stage is the actual coding. It is often best to write a code in terms of a symbolic language first, for then changes are easily made. Numbers are assigned to the symbols, and the final code is prepared. In the third stage some procedure is used to get the code into the memory of the computer. The fourth stage consists of debugging the code, i.e., detecting and correcting any errors. The fifth and final stage involves running the code on the computer and tabulating the results. In fact, it is well know that a single error in one instruction invalidates the entire code. Hence, programming is a technique requiring attention to details without loosing sight of the over-all plan.



4. Instruction Format. Some bits of the instruction are set aside for the operation code designation – i.e., they tell the instruction is ‘add’, ‘multiply’, ‘divide’, etc. The rest of the bits usually define the four addresses. For the more usual operations that involve two operands, such as addition, multiplication, etc., two of the addresses are the addresses of operands. The third address tells where the result is to be put; the fourth address tells where to obtain the next instruction. So, the instruction format is the way in which the different digits are allocated to represent specific functions.

5. Octal Shorthand. The first important detail of coding is the fact that the actual bits in an instruction are not written out in the binary code; rather, some shorthand is written instead, i.e., the octal equivalent would be written out. In other words, two octal numbers represent the instruction, and each address would be represented by three octal numbers. Thus, if 101 011 is the binary code for the command ‘add’ then the instruction that says, “Add the contents of address 011 010 110 to the contents of address 011 100 101, put the result into address 011 110 100, and take the next instruction from address 100 000 001,“ is written in octal notation as: operation – 53, the first operand address – 326, the second operand address – 345, the third address – 364, and the fifth address – 401. In such cases it evidently facilitates matters to call addresses in the memory by their octal numbers. Also, numerical quantities will be written on the code sheet in octal (i.e., they will have to be converted from decimal to octal before being written on the code sheet).



6. The Computer Manual. For the computer we must have a computer manual that gives the operation codes of different instructions and also defines precisely the meaning of the addresses for each instruction type. The coding manual must always be at the coder’s side. Two further observations must be reemphasized: first , when a word is called into the arithmetic/logic unit from the memory, it is not erased from its memory address, but remains there also; second, when a word is put into a memory address, it replaces the previous contents of this address, i.e., it erases what had been there.

 

Notes

1. in order to leave students free to concentrate on these principles – чтобы дать возможность студентам сосредоточиться на этих принципах

2. without loosing sight of – не теряя из виду

3. are set aside for the operation code designation – откладываются для обозначения кода операции

4. it evidently facilitates matters – это, очевидно, облегчает дело (ситуацию)

5. must always be at the coder’s side – должен всегда быть у программиста под рукой

Exercises

 

V. Find the Russian equivalents to the following English words and word combinations:

1. then; 2. thus; 3.hence; 4. however; 5. whereas; 6. perhaps; 7. also; 8. sometimes; 9. there; 10. in other words; 11. moreover; 12. instead; 13. the current chapter; 14. in fact; 15. specifically; 16. often; 17. in addition to; 18. easily; 19. clearly; 20. precisely

1. точно; 2. легко; 3. ясно; 4. вместо чего-либо; 5. кроме того; 6. вероятно; 7. также; 8. следовательно; 9. однако; 10. затем; 11. таким образом; 12. иногда; 13. там; 13. там; 14. более того; 15. другими словами; 16. в действительности; 17. частично; 18. данная (текущая) глава; 19. тогда как; 20. специфично, специально, конкретно

 

VI. Memorize the following definitions:

1. A program is a set of instructions composed for solving a given problem by a computer. 2. A code is the representation of data or instruction in the symbolic form. 3. A procedure is the sequence of steps required to solve a problem. 4. Programming is the process by which a set of instructions is produced for a computer to make it perform specified activity.

 

VII. Answer the following questions:

1. What is a code? 2. What is program? 3. What does the term ‘programming’ include? 4. How many stage are there in programming? 5. Which are the stages in programming? 6. What does programming require? 7. What will happen if there is a single error in one instruction? 8. What does the computer manual give and define? 9. When does a word erase the previous contents of the memory address? 10. When is a word not erased from its memory addresses? 11. What are some bits of the instruction set aside for? 12. What is an instruction format? 13. Why are the octal code often used instead of the binary code?



 

VIII. Read Text B and write a brief summary of it:

 

TEXT B. PROGRAMMING

 

The word ‘program’ has come into use to refer to the sequence of instructions which a computer is an exact (точный) sequence of instructions that is uses to solve a problem. It usually consists of subroutines or subprograms which are portions of it.

Programming for automatic computer requires a good deal of knowledge, common sense, and training. Specially, programming requires: (1) understanding the operations of a business or the steps of a scientific calculation; (2) understanding the best way for having a computer carry out these operations and steps; (3) arriving at a good sequence of commands for the computer to solve the problem; and (4) adequately translating these commands into the computer language.

Programming for the computers has several forms. One form is the construction of compiling programs or compilers – which use the computer to take subprograms out of a library and link (соединять) them together appropriately (соответственно) so as to solve a new problem. A second form is the construction of programs called interpreters (интерпретатор) which accept instructions in certain (определенный) standard words and translate these words into a machine language, so that the machine “knows” what the words “mean”. A third form is the development of common (обычный) languages for automatic programming for problems, so that any problem when expressed in such (такой) a language can be given to any automatic computer, and the computer will translate the common language into its own (собственный) instruction code, and then solve the problem.

 

Notes

1. a good deal of – много

2. common sense – здравый смысл

 

LESSON SEVEN

 

Grammar. Revision of Modal Verbs.

Text A. The Basic Principles of Programming (continued).

Text B. Kinds of Programs.

 

Exercises

 

I. Read the international words and guess their meaning:

to conserve; permanent, constant; location; diagram; code; symbol; function; alternative; line; term; symbolism; specific;

actual; specially; subroutine; initial; characteristic; coder; result; to illustrate; programmer; catalogue; to consult

 

II. Read and translate the following sentences paying attention to the meaning of the words and word combinations given below:

a) to be late - опаздывать

later than - позже чем

in the late 60s - в конце 60-х годов

the latest-самый последний

the former ..., the latter ... - первый (из упомянутых) ..., последний (из упомянутых)

1. Our professor is never late for his lectures. 2. This program was made later than it was planned. 3. In the late 60s the second generation of computers appeared and began to operate. 4. The latest achievements of up-to-date (современный) computing technique are applied in our computing centre. 5. The CPU consists of two parts: the control unit and the arithmetic/logic unit; the former receives and interprets instructions and generates control signals, the latter performs real computations.

b) to set - ставить; помещать; устанавливать

to set aside - откладывать

to set up - основывать, учреждать

a set - набор; комплект; множество; прибор

a set of - ряд

to preset - заранее помещать

1. The conditional code is set as a result of all logical comparing, connecting, testing, and editing operations. 2. The Institute of Automatics and Engineering Cybernetics of the Russian Academy of Sciences was set up in the late 1930s. 3. All logical operations other than editing are the part of the standard instruction set. 4. The set of logical operations include moving, comparing, bit connecting, bit testing, translating, editing. 5. A set of instructions is provided for the logical operation of processing data. 6. Several bits of an in­struction are set aside to designate (определять) the operation code. 7. The address of a jump instruction must be preset before making a block diagram.

c) case - ящик; коробка; корпус; случай

in any case - во всяком случае

this is the case - дело обстоит так this is not the case - это не так

1. These are cases for packing all the units of the computer ES-1045. 2. In this case the bits would be divided into 14 groups of 3 bits each. 3. This is some kind of synchronization of the pulses in a computer, and in most computers this is the case: all pulses are synchronized with respect to each other. 4. In each case, the operation is suppressed; therefore the condition code and data in storage and registers remain unchanged. 5. In any case registers store information in the memory. 6. The word which comes from the arithmetic unit back to the memory is not erased, but this is not the case with a new word as the previous one in the memory is always erased.

d) yet - (пока) еще; однако, но; хотя

1. In cases where we must write instructions involving addresses of constants that have not yet been specially assigned, we usually use the symbolic coding. 2. Yet the data for processing information appeared to be more important than the data for storing information in this case. 3. The program must be debugged if the errors have not yet been corrected. 4. Yet in practice, programmers desire the computer to take alternative ways of acting.

e) once - однажды, (один) раз; как только

1. A subroutine may be used many times during the computation of a program but is written only once in the whole program. 2. Once the execution of a command has been initialed, the indication of the neon bulb can be seen on the control panel. 3. Once set, the condition code remains unchanged until modified by an instruction that reflects a different condition code.

 

III. Pronounce the following words correctly:

temporaries n pi рабочие ячейки памяти particularly adv особенно proceed v продолжать (делать что-л.)
conserve v сохранять; консервировать occasionally adv случайно;
point n точка нерегулярно; вдруг
share v распределять; делить(ся) jump п переход; v переходить
visualize v мысленно представлять себе locate v размещать; помещать; располагать
interrelationship n взаимосвязь; взаимозависимость detour n уход; обход; удаление entrance n вход (в подпрограмму)
various а различный, разный; разнообразный exit n выход; выходной канал condition nусловие; состо­яние; режим;
essentially adv по существу ситуация
decision n решение value nвеличина; значение; оценка
associate vсоединять; связы­вать; объединять consider v считать; полагать; рассматривать
alternative nальтернатива; вариант; выбор варианта depend v(on, upon) зависеть от find v находить
eeliminate vустранять; исключать, заменять quite adv совсем; полностью, очень indicate vуказывать; показывать
description nописание; характеристика profitable а выгодный
statement nутверждение; оператор (в алгоритмических языках)  

 

IV. Memorize the following word combinations:

intermediate stages – промежуточные этапы

various alternatives - различные альтернативы

memory space - объем памяти, пространство памяти

point of view-точка зрения

permanent numbers - постоянные числа

temporary numbers - временные числа

specific instructions - специальные (конкретные) команды

crossing lines - линии пересечения

at a later time - в более позднее время, позже

jump (branch) instructions - команды перехода

a function calculation - вычисление функций

for instance = for example - например

 

 








Не нашли, что искали? Воспользуйтесь поиском по сайту:



©2015 - 2024 stydopedia.ru Все материалы защищены законодательством РФ.