For executing an instruction, a microprocessor fetches the instruction and executes it. The time taken for the execution of an instruction is known as Instruction Cycle. An instruction cycle is consists of a Fetch Cycle and Execute Cycle. The execution of any 8085 program consists of a sequence of READ and WRITE operations. Of which each transfer a byte of data between the 8085 A and a particular I/O device address or memory address.
These READ and WRITE operations are the only communication between the processor and the other components, and the other components, and are all that is necessary to execute any instruction or program.
Each READ or WRITE operations of the 8085 is referred to as Machine Cycle. An 8085 instruction’s execution consists of a number of machine cycles. These cycles vary from one to five (M1 to M5) depending on the instruction. Each machine cycle contains a number of clock cycles (also referred to as T-states). The first machine cycle will be executed by four or six clock periods. The machine cycles that follow will have three clock periods or T-state. The 8085 machine cycle has been shown in figure below.
OPCODE FETCH AND READ MACHINE CYCLE
Machine Cycle is the sequence of steps in performing the various operation like opcode fetch, memory read, memory writes I/O Read, I/O Write etc.
T-state may be defined as the time taken by the clock to complete one period. To perform a particular task by a programmer on a computer. A programmer writes a set of instructions called a Program and data are stored in the memory. The microprocessor fetches one instruction from memory at a time and executes it. It fetches and executes all the instructions of the program from the memory one by one to produce the final results.
Instruction cycle can be defined as the time taken to complete an instruction. We can also say that an instruction cycle is defined as the sequence of operations that are required by the CPU to fetch an instruction and data from the memory and to execute it. The instruction cycleconsists of a fetch cycle and a execute cycle. In a CPU fetches the opcode (the machine code of an instruction) from the memory.
The sequence of operations which are required to fetch an opcode from the memory constitute a fetch cycle. The necessary steps which are required to get data from the memory and to perform the operation specified by an instruction constitute an execute cycle.
Instruction Cycle = Fetch Cycle + Execute Cycle
Instruction may be one byte, two byte or three byte long. The first byte of any type of instruction is the opcode (machine code of the instruction). The second or third byte of an instruction may be the data or the address.
The PC keep the address of the next instruction byte to be executed. In the beginning of a fetch operation, the contents of the program counter which is the address of the memory location where opcode of the instruction is stored is sent to the memory. The memory places opcode of the instruction on the data bus so as to transfer it to the CPU. This is called the Fetch Operation.
Write operation: In the write operation, data are sent from the CPU to the memory or to an output device. So execute operation may also consists of one or more read or write evelcs. Figure shows the in cycle and it contains fetch cycle and execute cycle.