Chapter 7 – Handout 1 Clocked Synchronous State Machine Analysis Now that we've covered how to store a state, lets evaluate how to design a circuit using these elements: State Machine – a general term that refers to sequential circuits. It is called this because it tracks internal states. There are two types of state machines: Mealy and Moore. Mealy – Outputs depend on inputs and the current state. Moore – Outputs depend only on the current state. To do our analysis, we will need the characteristic equations for the F/Fs we derived earlier: D F/F Q* = D J-K F/F Q* = J•Q' + K' •Q T F/F (w/ enable) Q* = T•Q' + T'•Q We will do our analysis and place our results in a state table and state diagram.
15
Embed
Chapter 7 – Handout 1 Clocked Synchronous State Machine ... · Chapter 7 – Handout 1 Clocked Synchronous State Machine Analysis ... Instead, lets see how we could implement this
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Chapter 7 – Handout 1Clocked Synchronous State Machine Analysis
Now that we've covered how to store a state, lets evaluate how to design a circuit using these elements:
State Machine – a general term that refers to sequential circuits. It is called this because it tracks internal states. There are two types of state machines: Mealy and Moore.
Mealy – Outputs depend on inputs and the current state.
Moore – Outputs depend only on the current state.
To do our analysis, we will need the characteristic equations for the F/Fs we derived earlier:
D F/F Q* = DJ-K F/F Q* = J•Q' + K' •QT F/F (w/ enable) Q* = T•Q' + T'•Q
We will do our analysis and place our results in a state table and state diagram.
The book refers to a transition table and state table. These are effectively the same thing and I will sometimes refer to both interchangeably. The only difference is that transition table use bit sequences to represent the state, and the state table assigns a symbolic name to the state. i.e.
transition table → filled with 1's and 0'sstate tables → states assigned a name (A, B, C, or INIT, RUN, QUIT, etc)
State Diagram → provides a graphical representation of the state machine.
• Circle → Represents a state. Contains state value or state name.• Arc → Used to define potential transitions between states.• Output Values → Placed within the circle foe a Moore machine and on the arc for a
Mealy Machine.
Example:
Write equations for F/F inputs
DA = Xi•QA + Xi•QB DB = Xi•QA'
From characteristic Equation for D F/F, Q* = D, therefore
Note: Outputs must be defined in either table style.
State Diagram
Example with J-K F/Fs
Mealy or Moore? Mealy
Write Equations for F/F inputs
J1 = Q2 • X J2 = X Z = X • Q1 • Q2
K1 = X' K2 = X' + Q1'
Since the J-K F/F has two inputs, it is generally easier to write out the inputs values so output value can be determined (i.e. next state)
Using the truth table for a J-K F/F (or characteristic equation), we can now determine next state values:
We can now create a transition table (or state table):
Note: output changes during state, not on clock edge.
Now lets look at the general process for designing a sequential circuit to meet a set of requirements:
1. Get the specification → This can be the hardest part!2. Determine the state table/state diagram3. Choose state assignments
◦ Choose initial code that can easily forced by a reset (i.e. 000 or 111)◦ Minimize the number of state variables that change between each transition.◦ Maximize the number of state variables that don't change in a group of related states ( a
group of states where most transitions stay in the group).◦ Exploit symmetries in the problem specification and the corresponding symmetries in the
state table. (i.e. one state or group means almost the same thing as another. Once the first group has an assignment, the second group should have a similar assignment.)
◦ If there are unused states, the choose the best subset to meet the previous goals.Decompose the set of state variables into individual bits or fields, where each bit or field has a well defined meaning with respect to inputs or output behavior
◦ Consider using more than the minimum number of state variables to make a decomposed assignment possible.
◦ See p 561 for a deeper explanation.4. Choose F/F type5. Generate Excitation maps which allow you to derive input equations6. Sketch the circuit.
Lets start off with a simple example of an up/down counter using all 3 F/F types:
One input: X 0 count down (3-->2-->1-->0-->3, etc)1 count up (0-->1-->2-->3-->0, etc)
Outputs: Count value (0 or 1 or 2 or 3)Z – min/max value
X = 0, Z = 1 when count is 0, 0 otherwiseX = 1, Z = 1 when count is 3, 0 otherwise
Start off by drawing the state diagram
Since we want to output the count, we will let the state value also serve as the count output. Using 2 F/Fs (F/F1 and F/F0) with outputs Q1 and Q0, the state assignments are as follows:
Since we are using three types of F/Fs, lets create a table that shows how each works
Q → Q* D T J K0 → 0 0 0 0 X0 → 1 1 1 1 X1 → 0 0 1 X 11 → 1 1 0 X 0
Lets start with the T F/F (with enable as we discussed it in the lecture). Lets assign the output of t F/F 1 to Y1 and T F/F 0 to Y0. We can then simplify using K-maps.
Detect the input sequence of 0 – 1 – 1 – 0 – 1 – 1 – 1 on input XThe circuit has 2 outputs:
HINT = 1 if X has the correct value for the given point in the sequence. UNLK = 1 when X = 0 after the desired input sequence has been received.
We will start deriving the state diagram by going through the states we require for success. State A will represent the initial state where we assume that we have not received any inputs in the required sequence.
Now lets fill in the rest of the states:
From the state diagram, we can construct the state table for this circuit:
X HINT UNLKState 0 1 0 1 0 1A B A 1 0 0 0B B C 0 1 0 0C B D 0 1 0 0D E A 1 0 0 0E B F 0 1 0 0F B G 0 1 0 0G E H 0 1 0 0H B A 1 0 1 0
State*
Now we need to assign state values for 8 states (3 F/Fs).
What this means is that we choose which of these four state machines are implemented by how we initialize the circuit. If we reset to state 0 (0,0,0), things work as we want them to. If we don't initialize properly, then the circuit may malfunction and the results may be disastrous. We trade cost versus potential stability.