When a program runs, its executable binary file is copied into memory. The CPU then repeatedly fetches and executes instructions using a fetch-decode-execute cycle. During fetch, the program counter addresses memory to load an instruction into the instruction register. In decode, the instruction is analyzed to determine the operation. In execute, the specified operation such as an arithmetic, logic, or I/O function is performed. Key components involved are the CPU, memory, and bus that transfers instructions and data.
When a program runs, its executable binary file is copied into memory. The CPU then repeatedly fetches and executes instructions using a fetch-decode-execute cycle. During fetch, the program counter addresses memory to load an instruction into the instruction register. In decode, the instruction is analyzed to determine the operation. In execute, the specified operation such as an arithmetic, logic, or I/O function is performed. Key components involved are the CPU, memory, and bus that transfers instructions and data.
Data When a program is run The executable binary file is copied from the disk drive into memory The CPU repeated fetches an instruction and executes it using the fetch-decode- execute cycle Components of the computer involved in execution Memory: since the instructions and data are stored there The bus: since the instructions and data must be transferred to the CPU The CPU: o The ALU manipulates both instructions and data o The control logic decodes instructions and identifies what should happen during execution o The PC records where the next instruction is in memory The PC is initially set to the starting address of the block of memory o The Instruction Register (IR) holds the current instruction o The Status Register (SR) records the results of the last instruction The Fetch-Decode-Execute Cycle Fetch o The PC is copied to the MAR o A read signal is sent to memory o The instruction is transferred from memory to the MBR o The PC is incremented o The MBR is copied to the IR Several fetch steps may be required to get all the parts of an instruction Decode o Part or all of the instruction in the IR is extracted to determine what is to be done o Part of the instruction may contain Data A memory address to get data from A memory address to put data Execute o The specified operation is performed o Examples Arithmetic operation Logic operation Read or write data from memory Change PC to implement jumps Send data to or from an I/O device Terminate program (by causing an interrupt)