Docsity

state transition diagram, Lecture notes of Microprocessors

Partial preview of the text

Download state transition diagram and more Lecture notes Microprocessors in PDF only on Docsity!

State Transition

Diagram

What is State Transition Diagram?

 (^) The state transition diagram represents the microprocessor’s internal operations, which consists of circle to represent the states and directed line segments to represent transitions between the states.  (^) A 8085 microprocessor generally have 10 states i.e. T 1, T 2 ,^ T 3 ,^ T 4 , T 5 ,T 6 ,TWAIT, TRESET, THALT, and THOLD.  (^) T 1 to T 6 represents the 6 clock cycles of the processor, as usually a machine cycle consists of 3 to 6 T-states and rest of the states are the different states achieved by the microprocessor dues to various control signals, e.g. on receiving RESET signal processor in the TRESET state and similarly on receiving HOLD signal it is in the THOLD state.  (^) The next state in the state transition diagram is decided by many of the control signals i.e. INTERRUPT SIGNALS, HOLD, RESETIN , HALT, READY.

T

HALT

state

 (^) Whenever the HLT instruction executes, the 8085 enters into the T HALT state.  (^) When the current fetched instruction is HLT, then in T 4 state the control unit decodes the opcode of HLT and set an internal HALT flip-flop of microprocessor. After T 4 the microprocessor enters into the T 1 state of the next machine cycle.  (^) After entering into the T 1 cycle of next machine cycle, microprocessor always checks the HALT flip-flip, which might be set in the pervious clock cycle.  (^) If it is found set then, instead of entering into the T 2 microprocessor enters into the THALT state otherwise in the T 2.  (^) Thus 5 T- states , T 1 , T2, T3, T 4 of the current machine cycle and T 1 of the next machine cycle, are required to reach the THALT state.

T

HALT

state

 (^) In the HALT state, the address and address/data buses along with RD, WR , IO/ M are placed in their high independence states (floated).  (^) There are only three ways to exit from a THALT state.

  1. A low an RESETIN input of the 8085 resets the entire system and, comes out of THALT state and enters into TRESET state and remains their as long as RESETIN is active.
  2. The second way to get out of the THALT state is to make the HOLD signal input high. The processor then enters into the THOLD state, but when the HOLD pin goes low again, the CPU returns to the THALT state.
  3. The third method of coming out of a THALT state is when an interrupt signal is active. This method works only if interrupts were enabled with an enable interrupt (IE) instruction in the program before HALT instruction is executed. Whenever interrupt comes microprocessor leaves the THALT state and start executing the ISR.

T

WAIT

State

 (^) Sometimes μΡ is used with memories or I/O devices which have longer Ρ is used with memories or I/O devices which have longer access time. To accommodate long access time, the 8085A has a state called the TWAIT state.  (^) If the μΡ is used with memories or I/O devices which have longer Ρ doesn't enter into T HALT state, then it proceeds into the T 2 state of the machine cycle. Here it cheeks the READY pin.  (^) If READY pin is low, means I/O devices or memory are not ready, so processor has to wait, then the μΡ is used with memories or I/O devices which have longer Ρ goes to the TWAIT state and remains there until READY pin goes high. If READY line is high then the μΡ is used with memories or I/O devices which have longer Ρ enters into the T 3 state.  (^) When the READY signal becomes logic ‘1’ the μΡ is used with memories or I/O devices which have longer Ρ comes out of T WAIT state and enters into T 3 state and the current machine cycle continues, TWAIT states continues to be inserted as long as READY is low.

State Transition Diagram of T

WAIT

state

HOLD State T

HOLD

 (^) HOLD signal is asynchronous is nature. The μΡ is used with memories or I/O devices which have longer Ρ synchronize this request and at proper time in a m/c cycle by providing the HLDA signal by setting HLDA F/F- for the requesting device. The THOLD state is entered after current m/c cycle is completed.  (^) The HOLD signal is checked during T 2 state after (READY input has been checked) and also during T 4 state (provided if the concerned m/c cycle requires T 5 & T 6 state, also).  (^) If the HOLD signal is found high the HLDA F/F is set and the processor enter the THOLD state after the current m/c cycle.  (^) The microprocessor exits the T HOLD state when HOLD pin becomes 0 and continuous its previous operation from the point at which it was suspended by the HOLD request. On exiting the THOLD state, it resets the HLDA f/f and check for the HALT f/f.

Contd.

 (^) If the HALT f/f is found to be set then the microprocessor enters into the T HALT state else enters into the T 1 state of the next machine cycle.  (^) Before enter into the T 1 state of the next machine cycle, microprocessor checks whether it is the last machine cycle of the current instruction cycle or not. If it is the last machine cycle then check for the interrupt otherwise enters into the T 1 state of next machine cycle.  (^) Microprocessor does not check for the interrupt request until the end of the instruction cycle, however it checks for the HOLD signal after every machine cycle and enters into THOLD state at the end of current machine cycle if the signal is active.