Instruction execution can be divided into five phases. These are Phase-I: INSTRUCTION FETCH (IF) II: INSTRUCTION DECODE & OPERAND FETCH (ID) III: EXECUTION (EX) V: MEMORY OPERATION (MEM) V: WRITE BACK (WB) - Regards, Subhradip Das
The two-phase process for executing instructions on a typical CPU involves a fetch step and an execute step. Fetch is where the instruction is loaded from memory and execute is where the actions detailed in the instruction are carried out.
Fetch execution refers to the process in computer architecture where the instruction fetch stage retrieves an instruction from memory to be executed by the CPU. This is typically the first step in the instruction cycle, where the program counter identifies the memory address of the next instruction to be fetched. Once fetched, the instruction is decoded and then executed, enabling the CPU to perform tasks as dictated by the program. Efficient fetch execution is crucial for overall system performance, as it impacts how quickly instructions can be processed.
In Harvard architecture, the program memory space is distinct from data memory space. Such architecture requiring two connections. It can perform instruction fetch ( from program memory ) and data memory fetch simultaneously , by adopting a pipelined instruction execution approach, as shown below. A typical instruction execution consists of performing Fetch instruction, Decode instruction, Fetch operands, execution operation , store results. Then, by adopting a pipelined approach, which is possible in Harvard architecture, it is evident that the instruction throughput increases by overlapping. It is simple to imagine that in the above case, if all the above states are executed "one after the other" , the execution time of the instruction will be longer than when it is pipelined.
In Harvard architecture, the program memory space is distinct from data memory space. Such architecture requiring two connections. It can perform instruction fetch ( from program memory ) and data memory fetch simultaneously , by adopting a pipelined instruction execution approach, as shown below. A typical instruction execution consists of performing Fetch instruction, Decode instruction, Fetch operands, execution operation , store results. Then, by adopting a pipelined approach, which is possible in Harvard architecture, it is evident that the instruction throughput increases by overlapping. It is simple to imagine that in the above case, if all the above states are executed "one after the other" , the execution time of the instruction will be longer than when it is pipelined.
Summary − So this instruction XCHG requires 1-Byte, 4-Machine Cycles (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.
In the 8085 microprocessor, the opcode fetch machine cycle is not sufficient on its own for executing the MOV MA instruction. While the opcode fetch cycle is responsible for retrieving the instruction from memory, additional machine cycles are required to perform the data transfer or execution of the instruction. Specifically, the MOV MA instruction involves both an opcode fetch cycle and a memory access cycle to complete the operation. Therefore, multiple machine cycles are necessary for executing this instruction effectively.
three
The possible states that define an instruction execution are as follows: Instruction address calculation - Determine the address of the next instruction to be executed. Instruction fetch - Read instruction from its memory location into the processor. Instruction operation decoding - Analyze instruction to determine type of operation to be performed and operand to be used. Operand address calculation - If the operation involves reference to an operand in memory or available via I/O, then determine the address of the operand. Operand fetch - Fetch the operand from memory or read it in from I/O. Data operation - Perform the operation indicated in the instruction. Operand store - Write the result into memory or out to I/O.
There are three fetch cycles in a three byte instruction. The first one is four clock cycles long, while the other two are three clock cycles long. Depending on what the instruction does, there will then be more read/write cycles.
The next step of CPU instruction typically involves the execution phase, where the CPU carries out the operation defined by the instruction. This follows the instruction fetch and decode stages, where the instruction is retrieved from memory and translated into a form the CPU can understand. During execution, the CPU performs arithmetic, logic, or control operations, often interacting with registers and memory to process data. After execution, the CPU will move to the next instruction in sequence, continuing the cycle.
8086 has two blocks Bus Interfacing Unit(BIU) and Execution Unit(EU).The BIU performs all bus operations such as instruction fetching, reading and writing operands for memory and calculating the addresses of the memory operands. The instruction bytes are transferred to the instruction queue.EU executes instructions from the instruction system byte queue.Both units operate asynchronously to give the 8086 an overlapping instruction fetch and execution mechanism which is called as Pipelining. This results in efficient use of the system bus and system performance.BIU contains Instruction queue, Segment registers, Instruction pointer, Address adder.EU contains Control circuitry, Instruction decoder, ALU, Pointer and Index register,Flag register.