Instruction Execution
Types of Instructions
- processor-memory: the instruction transfers data from memory to the processor
or from the processor to memory
- processor-I/O: the instruction transfers data from an I/O device to the
processor or from the processor to an I/O device
- data processing: the instruction performs an arithmetic or logic operation
- control: the instruction changes the flow of control in the program
Memory Access
The following steps are required to access main memory:
- The memory address of the data to be read or written is loaded
into the MAR.
- If the memory operation is a write, the data to be written is loaded
into the MBR.
- A signal is sent to the memory to read or write.
- If the memory operation is a read, the data read is put in the MBR.
Steps in Instruction Execution
- instruction fetch
- MAR <- PC
- send read signal to memory
- MBR <- data from memory
- IR <- MBR
- decode operation: circuits in control unit analyze instruction to
determine the operation and what operands are needed
- calculate address of next instruction: PC <- PC + (size of current
instruction)
- calculate address of operand: if operand requires memory access or I/O,
determine the address of the operand
- fetch operand
- MAR <- address of operand --OR-- I/O AR <- address of operand
- send read signal to memory or input device
- MBR <- data from memory --OR-- I/O BR <- data from input device
- execute (arithmetic or logic operation)
- store operand
- MAR <- address to store operand --OR-- I/O AR <- address to store operand
- MBR <- --OR-- I/O BR <- data from input device
- send write signal to memory or output device
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2009