Download Instruction Flow Computer Organisation and more Exercises Computer Science in PDF only on Docsity!
Processor fetch instruction from MEMORY Def: special-purpose register that is used by the processor to hold the address of the next instruction to be executed Increment to 1 once the address is being retrieved Program Counter (PC) Processor fetches instruction from memory location pointed to by PC Instruction loaded into Instruction Register (IR) basic operation cycle of a computer. process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions. Fetch-decode-execute Fetch - read next instruction from memory into CPU ——> MAR ; | Memory Execute - interpret opcode and perform operation Interrupt - save current process state and service the interrupt Indirect -more memory access to fetch operand Control Unit a FETCH How is it done DEFINITION; | 4 main cycle il ene nw Interrupt Address Data Control | F Bus Bus Bus MBR = Memory buffer register MAR = Memory address register | IR = Instruction register Execute PC = Program counter | °. PC contains address of next instruction --> Address moved to MAR Address --> placed on Address bus @ | Control unit requests memory read Result placed on data bus and copied to MBR @ INSTRUCTION FLOW, MBR will then sent to IR @ Control unit increment PC by 1 Def: Mechanism by which other modules (e.g. I/O) may interrupt normal sequence of processing Sc Depends on instruction (in IR) being executed Program (e.g. overflow, division by zero) EXECUTE May include --- Memory read/write ; Input/Output; Register transfers; ALU operations Timer (Generated by internal processor timer & Used in pre-emptive multi-tasking) t 'ypes 1/0 (from I/O controller) CPU Hardware failure e.g. memory parity error Dla |___»] IVlemory PC MAR e ; Memory Control Unit “bmaooPF — | Indirect Interrupt ( [ee MBR |< . oO Data Flow | | Address Data Control Bus Bus Bus [ PCcurrentanp | After fetch, Instruction register (IR) is examined Right most N bits of MBR transferred to MAR If indirect addressing, indirect cycle is performed Control unit requests memory read Result (address of operand) moved to MBR Contents of PC copied to MBR |@ PC-save-address (e.g. stack pointer) loaded to MAR @ PC loaded with address of interrupt handling routine 8 Then, MBR written to memory Interrupt begin