State Machine Implemetation

State Machine Implemetation - State Machines: Brief...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
State Machines: Brief Introduction to Sequencers Prof. Andrew J. Mason, Michigan State University Introduction A state machine models behavior defined by a finite number of states (unique configurations), transitions between those states, and actions (outputs) within each state. A finite state machine refers to a machine with only a relatively small number of states, though this term is often truncated to simply state machine. The current state is a function of past states, and thus the state machine must have memory of its past. A state machine can be represented by a state diagram and/or state transition tables . A counter is a type of state machine. It constantly increases its output value as it sequences through states until it reaches its final value and returns to its initial value. We will now consider a type of state machine referred to as a sequencer, one that cycles through a sequence of states in a predefined order. Consider the state diagram in Figure 1. It cycles through four states in a specific sequence. The states are number 1-4 in binary notation such that the sequence is 00 Æ 01 Æ 11 Æ 10 Æ 00. 0 0 0 1 1 1 1 0 start Fig. 1: State diagram for a simple 2-bit state sequencer. Number of flip flops To implement state machines in digital hardware, flip flops are often used because they exhibit the necessary memory capabilities. They would be combined with so-called “glue logic” that determines the proper input values in order for the specified state sequence to be realized. The number of flip flops needed to implement a state machine is a function of the number of states in the state machine. Since a single flip flop has one digital output, it can represent two discrete states, namely 0 and 1. Two flip flops working together provide an output pair (2 signals) that can implement four states, 00, 01, 10, and 11. In general, n flip flops can represent 2 n states, much in the same way as an n -bit number can represent 2 n values. Thus, the number of binary bits needed to represent all of the states will equal the number of flip flops needed to implement the state machine. Example 1 : How many flip flops are needed to implement a state machine with 12 states? Answer : 3 flip flops can implement 2 3 =8 states and 4 can implement 2 4 =16. Since 8 states are too few, 4 flip flops would be needed to cover 12 states. Note this would provide 4 unused states that must be taken care of as described later. Implementing Glue Logic Knowing how many flip flops are needed is the starting point, but how can we force the flip flops to produce the correct output to implement the desired state sequence? The answer lies in the glue logic , the circuitry that will set the flip flop inputs to the proper values at each state to
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ensure that they will generate the desired next-state outputs after a clock transition. Indentifying the glue logic functionality requires developing state transition tables.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/29/2009 for the course ECE 331 taught by Professor M.shanblatt during the Spring '08 term at Michigan State University.

Page1 / 5

State Machine Implemetation - State Machines: Brief...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online