370 likes | 572 Views
State Graphs. Binary Counter State Graph. 00. State graphs are graphical representations of TT’s They contain the same information: no more, no less. 11. 01. 10. State. Transition. Binary Counter State Graph. 00. Each circle is a state. 11. 01. 10. State. Transition.
E N D
State Graphs ECEn 224
Binary Counter State Graph 00 State graphs are graphicalrepresentations of TT’s They contain the same information:no more, no less 11 01 10 State Transition ECEn 224
Binary Counter State Graph 00 Each circle is a state 11 01 10 State Transition ECEn 224
Binary Counter State Graph 00 Each arc is a transition from one state to another Here, the arcs are unlabelled, meaning the transition isalways taken on the clock edge 11 01 10 State Transition ECEn 224
Gray Code Counter State Graph 00 10 01 11 ECEn 224
INC’ 00 INC INC 11 01 INC’ INC’ INC INC 10 INC’ State Graphs for Counters With Inputs INC controls whether transitionis taken or not… There is a one-to-onecorrespondence betweenthe rows of the TT andthe arcs in the SG ECEn 224
State Graphs for Counters With Inputs INC’ When INC=1, we change state… 00 INC INC 11 01 INC’ INC’ INC INC 10 INC’ ECEn 224
State Graphs for Counters With Inputs INC’ When INC=0, we stay in the same state… 00 INC INC 11 01 INC’ INC’ INC INC 10 INC’ ECEn 224
SG for Counter With Multiple Inputs CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR CLR’ • INC CLR’ • INC 10 CLR’ • INC’ NOT an exact correspondence betweenTT rows and SG arcs, why? ECEn 224
SG for Counter With Multiple Inputs CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR CLR’ • INC CLR’ • INC 10 CLR’ • INC’ Some arcs correspond to 2 rows in TT ECEn 224
Transition Table Simplification These are input don’t cares. They are a shorthand for the TT on the left.Middle TT exactly matches SG on previous page. ECEn 224
Simplified Transition Tables With Input Don’t Cares • Contain exactly same information as original • Shorthand way of writing • Should be able to easily convert back/forth ECEn 224
Simplified State Graph CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC 11 01 CLR’ • INC’ CLR’ • INC’ CLR’ • INC CLR’ • INC 10 CLR’ • INC’ There is now a one-to-one correspondence betweenrows and arcs… ECEn 224
More Simplified State Graphs • If the order of inputs is known… • Use binary labellings 1- 00 00 01 01 00 11 01 00 There is no correct way to draw a SG as long as you knowprecisely how it maps back toa transition table. 01 01 10 00 ECEn 224
Design Procedure Using State Graphs • Draw the state graph • Create an equivalent transition table • If transition table contains input don’t cares, • unfold it to a full transition table • Complete the design using K-maps, gates, FF’s ECEn 224
State Graphs With Moore Outputs Z 00 Z 11 01 10 Write the output next to the states it is asserted in… Underline it to make it more clear ECEn 224
Another SG With A Moore Output INC’ 00 Z INC INC Z 11 01 INC’ INC’ INC INC 10 Moore output shows up in multiple TT rows… INC’ ECEn 224
State Graphs and Mealy Outputs INC’ 00 INC INC / Y 11 01 INC’ INC’ INC INC 10 INC’ Mealy output is associated with an arc in SG ECEn 224
Properly Formed State Graphs • A properly formed state graph is both: Completeand Conflict-free ECEn 224
An Incomplete State Graph • This SG is incomplete. Can you see why? INC’ 00 INC INC 11 01 INC’ INC’ INC INC 10 What happens in state ’10’ when INC=0? ECEn 224
An Incomplete State Graph • This SG is incomplete. Can you see why? INC’ 00 INC INC 11 01 INC’ INC’ INC INC 10 There is a missing row in the TT as well… ECEn 224
Complete State Graphs • For a SG to be complete: • Paths leaving each state must cover all cases • To check: • OR together conditions on all arcs leaving a given state • If result = ‘1’, state is complete • If result ‘1’, state is incomplete ECEn 224
Checking for Completeness INC’ INC + INC’ = 1 State 00 is OK INC + INC’ = 1 State 11 is OK 00 INC INC 11 01 INC’ INC’ INC INC 10 INC 1 State 10 is notOK INC + INC’ = 1 State 01 is OK ECEn 224
Alternate Check for Completeness • Full transition table (no input don’t cares) should have 2n rows where: n = (#inputs + #state variables) This only has 7 rows, something is missing… ECEn 224
Additional Completeness Considerations • If some input combination will never occur • Don’t need to enforce completeness CLR’ • INC’ 01 CLR • INC’ CLR’ • INC What about the case of CLR•INC? If INC=CLR=1 will never occur, this incomplete state is OK ECEn 224
CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR INC CLR’ • INC 10 CLR’ • INC’ Conflicts in State Graphs • This SG has a conflict, can you find it? ECEn 224
CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR INC CLR’ • INC 10 CLR’ • INC’ Conflicts in State Graphs • This SG has a conflict, can you find it? What happens in state ’10’ when CLR=INC=‘1’? ECEn 224
CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR INC CLR’ • INC 10 CLR’ • INC’ Conflicts in State Graphs • This SG has a conflict, can you find it? One arc says to go to state 00, another says to go to state 11 This is a conflict… ECEn 224
Conflicts in State Graphs • The corresponding transition table has a problem as well… CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR INC CLR’ • INC 10 We can’t have 2 TT rows active at same time! CLR’ • INC’ ECEn 224
Conflict-Free State Graphs • For a State Graph to not have conflicts: • Paths leaving each state must not conflict with one another • To check: • For each pair of arcs leaving a given state, AND together their conditions • If result = ‘0’, arcs have no conflict • If result ‘0’, arcs have a conflict ECEn 224
Checking for Conflicts CLR • (CLR’ • INC’) = 0These arcs OK CLR CLR’ • INC’ 00 CLR’ • INC CLR’ • INC (CLR’ • INC’) • (CLR’ • INC) = 0These arcs OK CLR CLR 11 01 CLR’ • INC’ CLR’ • INC’ CLR Remember – you must do all pairs of arcs leaving each state! Not all pairs are shown in this example. INC CLR’ • INC 10 INC • CLR 0These arcs not OK CLR’ • INC’ ECEn 224
Alternate Check for Conflicts • Full transition table (no input don’t cares) should have 2n rows where: n = (#inputs + #state variables) This has 18 rows, something is wrong… ECEn 224
Additional Conflict Considerations • If some input combination will never occur • Don’t need to worry about conflicts CLR’ • INC’ 01 CLR INC If INC=CLR=1 will never occur, the conflict shown here is OK. But, you will have to make a decision on how to write the TT. ECEn 224
Summary - Properly Formed State Graphs • A properly formed state graph is both • Complete • Conflict-free • Perform tests to ensure you have covered all the cases once and only once ECEn 224
INC’ 00 INC INC 11 01 INC’ INC’ INC INC 10 INC’ Summary – SG’s vs. TT’s • A state graph is simply a graphical way of writing a Transition Table • No additional information • You should be adept at converting between them • Final design is always done from TT to K-maps to gates/FF’s ECEn 224