Fetch decode Execute Flashcards
Memorize what happens in each of the stages (4 cards)
What happens in the fetch stage of the cycle
1.Program Counter (PC): The PC holds the memory address of the next instruction to be executed.
2.Memory Address Register (MAR): The contents of the PC (the address of the instruction) are copied to the MAR.
3.Address Bus: The address in the MAR is placed on the address bus, which sends the address to the memory location where the instruction is stored.
4.Data Bus: The instruction (data) at that memory location is read and placed on the data bus.
5.Memory Data Register (MDR): The instruction from the data bus is copied into the MDR.
6.Control Unit (CU): The CU then takes the instruction from the MDR and prepares it for decoding and execution.
What happens in the decode stage of the cycle
- Obtain the instruction:
The CPU receives the instruction from the Current Instruction Register (CIR), which holds the instruction fetched from memory. - Identify the opcode:
The CPU determines the type of operation (e.g., add, subtract, move) by analyzing the opcode part of the instruction. - Identify operands:
The CPU identifies the operands, which are the data or memory locations the instruction will operate on. - Interpret the instruction:
The CPU interprets the instruction based on the opcode and operands, determining what actions need to be taken. - Prepare for execution:
The CPU prepares for the execution stage by setting up the necessary registers, memory addresses, and control signals.
What happens in the execute stage of the cycle
The CPU receives the decoded instruction and performs the necessary operations, for example if it is mathematical, it uses the ALU, if instruction requires reading/writing data in memory, it uses the memory acess register
Describe the role of the cache memory in the computer
It is a high speed memory that aids in the controlling of instructions, and the movement of data around the computer.