Lecture Instruction Cycle
Lecture Instruction Cycle
Instruction Cycle
To execute an instruction, microprocessor has to perform various operations such as memory Read/Write,
I/O Read/Write, and sometimes also request acknowledge.
2
Microprocessor: 8085A
Instruction Cycle
All these operations are performed during execution of a instruction within a given time interval, which is
provided by the clock of the system.
With reference to the mentioned operations (fetch, decode, and execute) certain terms can be defined.
Instruction Cycle
3
Microprocessor: 8085A
Instruction Cycle
1. Instruction Cycle: Time required for completing the execution of an instruction is known as instruction
cycle. The 8085 instruction cycle consists of one to six machines cycles or operations.
2. Machine Cycle: It is the time required for completing a single operation. This operation can be accessing
memory for read/write operation or accessing I/O device. There can be 3 to 6 clock periods or T-states in a
machine cycle.
3. T-states or Clock Cycles: T-state is equivalent to one clock period. One clock period, i.e. the period
between two negative going transitions of that clock is called T-state. It is the time in which only a
subdivision of the operation can be performed. Hence, each machine cycle contains a number clock cycles
or T-states.
4
Microprocessor: 8085A
Instruction Cycle
Timing Diagrams
A timing diagram of an instruction is a graphical representation of the time taken by the μP to fetch,
decode, and execute an instruction.
The size of instruction and frequency of μP decides the total amount of time taken to execute an
instruction.
5
Microprocessor: 8085A
Instruction Cycle
6
Microprocessor: 8085A
Instruction Cycle
The number of machine cycles required to execute the instruction depends on the particular instruction.
Some of the instructions require no additional machine cycles after the instruction fetch is complete. Such
instruction have only one machine cycle in instruction cycle.
Other instructions may requires additional machine cycles to write or read data to or from memory or I/O
devices.
Hence, the total number of machine cycles required varies from one to five.
7
Two status signals (S1 and S0) along with IO/M signal output
Microprocessor: 8085A identify the type of the machine cycle being executed by the
8085.
These signals are issued (or become valid) at the beginning of
the machine cycle and remain stable throughout the machine
Instruction Cycle
cycle.
8
Microprocessor: 8085A
Instruction Cycle
9
Microprocessor: 8085A
Instruction Cycle OFMC
MC-1 MC-2
1. Opcode Fetch Machine Cycle (OFMC)
In the beginning of state T1, the 8085 puts a low on
the IO/M line of system bus indicating a memory
operation.
10
Microprocessor: 8085A
Instruction Cycle OFMC
MC-1 MC-2
1. Opcode Fetch Machine Cycle (OFMC)
The higher order 8-bits of the address appear on the
address bus A8-A15 remains constants until the end of
the state T3. During T4 state the data on the address
bus is unspecified.
11
Microprocessor: 8085A
Instruction Cycle OFMC
MC-1 MC-2
1. Opcode Fetch Machine Cycle (OFMC)
During state T2, after the RD signal is made low, the
external decoding circuit decodes the address put on
the address bus during T1 state.
12
Microprocessor: 8085A
Instruction Cycle OFMC
MC-1 MC-2
1. Opcode Fetch Machine Cycle (OFMC)
The accessed memory should be fast enough to
output its data before RD goes high.
Slower memories can gain more time by pulling the
READY signal of 8085 LOW.
This will introduce an integral number of TWAIT states
between T2 and T3 as long as READY is low.
On the rising edge of the RD control signal in T 3 state,
the opcode obtained from the memory is transferred
to the microprocessor instruction register.
13
Microprocessor: 8085A
Instruction Cycle OFMC
MC-1 MC-2
1. Opcode Fetch Machine Cycle (OFMC)
14
Microprocessor: 8085A
Instruction Cycle
16
Microprocessor: 8085A
Instruction Cycle
17
Microprocessor: 8085A
Instruction Cycle
18
Microprocessor: 8085A
Instruction Cycle
19
Microprocessor: 8085A
Instruction Cycle
20
Microprocessor: 8085A
Instruction Cycle
Example
Two machine codes-0011 1110H (3EH) and 0011 0010H (32H) are stored in memory locations 2000H and
2001H, respectively, as shown below. The first machine cycle (3EH) represents the opcode to load a data
byte in the accumulator, and the second code (32H) represents the data byte to be loaded in the
accumulator. Illustrate the bus timings as these machine codes are executed. Calculate the time required to
execute the Opcode and memory read cycles and the entire instruction cycle if the clock frequency is 2
MHz.
21
Thank You
22