Opcode fetch timing
The opcode fetch is the first step in executing any instruction in the Intel 8085 microprocessor. It involves a sequence of precisely defined operations coordinated by clock cycles, also known as T-states. A detailed description of the opcode fetch process follows:
T1 state
Address output
The 16-bit address from the program counter (PC) is driven onto the address bus. The upper 8 bits (A8 — A15) are directly available on dedicated address lines, while the lower 8 bits (A0 — A7) are multiplexed with the data bus on pins AD0 — AD7.
ALE signal
The Address Latch Enable (ALE) signal goes high. This high ALE level is crucial because it enables an external latch (for example, a 74LS373). The latch captures the lower 8 bits of the address present on lines AD0 — AD7. Once latched, this lower 8-bit address can be combined with the upper 8-bit address to form the complete 16-bit memory address.
T2 state
ALE transition
At the beginning of the T2 state, the ALE signal goes low. This means that latching of the lower 8-bit address is complete, and lines AD0 — AD7 are now available for other functions.
Activation of the memory read signal
The memory read control signal (RD) is activated (goes low). This low signal serves as a command to the memory device. It tells the memory to fetch the opcode stored at the memory location specified by the 16-bit address on the address bus and to place it on the data bus (AD0 — AD7).
T3 state
Opcode read
The RD signal remains low during the T3 state. The microprocessor reads the opcode from the data bus (AD0 - AD7) and transfers it to the instruction register (IR). This opcode contains information about the operation that the microprocessor must perform.
Possibility of entering wait states
In some cases, if the memory is slow and cannot supply the opcode in time, a wait state (Tw) may be inserted between T2 and T3. The microprocessor waits for the memory to become ready by monitoring the READY signal. When the READY signal goes high, indicating that the memory has placed the opcode on the data bus, the microprocessor continues with the normal T3 operation.
T4 state
Opcode decoding
After the opcode has been successfully read into the instruction register in the T3 state, the T4 state is used to decode the opcode. The microprocessor control unit analyses the opcode to determine the instruction type and the sequence of operations that must be carried out to execute the instruction.
PC increment
After the opcode is decoded, the program counter (PC) is incremented by 1. This ensures that the PC now points to the next instruction in memory, preparing the microprocessor for the next opcode fetch cycle.
Conclusion
Thus, the opcode fetch in the 8085 microprocessor is a carefully organized process that ensures instructions are fetched and decoded correctly from memory, allowing programs to run smoothly.