Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
unit 3.doc
Скачиваний:
16
Добавлен:
03.05.2015
Размер:
69.12 Кб
Скачать

6. Read the text and find the answers to the following questions:

1. What steps are involved in the operation of most CPUs?

2. What is the function of a program counter in the fetch step?

3. How is the instruction decoded?

4. What is the role of the control unit on the CPU operation?

5. What happens in the execute step?

6. What arithmetic and logic operations can an ALU perform?

7. Where are the results of the execute step written to?

Cpu Operation

The fundamental operation of most CPUs, regardless of the physical form they take, is to execute a sequence of stored instructions called a program. The program is represented by a series of numbers that are kept in some kind of computer memory. There are four steps that nearly all von Neumann CPUs use in their operation: fetch, decode, execute, and writeback.

The first step, fetch, involves retrieving an instruction (which is represented by a number of sequence of numbers) from program memory. In a CPU instructions and data are temporarily stored in registers. The location in program memory is determined by a special register called a program counter. The program counter keeps track of which location in memory the next instruction is to be read from.* After an instruction is fetched, the program counter changes – usually increasing a small amount – so that it contains the location of the instruction to be executed next.*

In the decode step, each instruction is interpreted by a decoder, which determines what the instruction will do. The control unit decodes the instruction and turns it into a series of control signals that operate the other parts of the computer. Control systems in advanced computers may change the order of some instructions so as to improve performance.*

After the fetch and decode steps, the execute step is performed. It means the CPU executes the instruction. During this step, various portions of the CPU are connected to perform the desired operation. If, for instance, an addition operation was requested, an arithmetic logic unit (ALU) will be connected to a set of inputs and a set of outputs. The inputs provide the numbers to be added, and the outputs will contain the final sum.* The set of arithmetic operations that a particular ALU supports may be limited to adding and subtracting or might include multiplying or dividing, trigonometry functions (sine, cosine, etc) and square roots. Some can only operate on whole numbers (integers) while others use floating point to represent real numbers - though with limited precision.* Logic operations involve Boolean logic: AND, OR, XOR and NOT.

The final step, writeback, simply “writes back” the results of the execute step to some form of memory. Very often the results are written to some internal CPU register for quick access by subsequent instructions. In other cases results may be written to slower, but cheaper and larger, main memory.

The entire sequence of steps is called an instruction cycle.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]