Can a State Diagram Repeat a State Twice in a Sequence?

Click For Summary
SUMMARY

The discussion centers on the design of state diagrams in systems where control inputs dictate the sequence of states. It is established that a state cannot be repeated in a sequence without introducing unique identifiers, effectively creating new states. The user proposes a solution involving multiplexing two state machines based on the control input to manage state transitions. The conversation emphasizes the importance of glitch-free outputs and the use of Verilog for state machine implementation, advocating for clarity in state representation without conflating states with control signals.

PREREQUISITES
  • Understanding of state machine design principles
  • Familiarity with Verilog for hardware description
  • Knowledge of multiplexing techniques in digital systems
  • Concept of glitch-free outputs in state machines
NEXT STEPS
  • Explore advanced state machine design using Verilog
  • Research multiplexing strategies for state machines
  • Learn about glitch-free output techniques in digital circuits
  • Study the implications of unique state identifiers in state diagrams
USEFUL FOR

Engineers and designers working on digital systems, particularly those involved in state machine implementation, control system design, and hardware description language programming.

Physicist3
Messages
103
Reaction score
0
Hi, I am designing a system to run a certain sequence when the control input is off, and then run a different sequence when the control input is on. When drawing a state diagram, for the loop where the control input is on, can the system repeat the same state twice throughout its sequence and therefore miss one of the other states out??

E.g.

Control = 0: 0000, 0001, 0010, 0011, 0100, 0101 etc.

Control = 1: 0000, 0100, 0010, 0011, 0010, 0101 etc (I.e. State 0001 is not used but 0010 used twice)
 
Engineering news on Phys.org
Since control=0 is just a counter it might be easier to mux two state machines and mux them with Control as the muxing variable.

Otherwise it's going to be a bit tricky and you will need some additional state variables (besides your state vector output).
 
You cannot use a state twice without something that makes the two occurences unique, essentially making another state.

If I'm in state 0010, I need to somehow know whether to go to 0011 or 0101.

The easiest way to do this is dependent of the nature of the output signals you are driving. Do they need to be glitch free (meaning no decoded control signals) or ?.

Sometimes a state machine is followed by (or contains additional) flops to produce glitch-free outputs, and sometimes that is all encoded into the state flops.

I generally write my state machines in verilog and do it the way that makes it most easily followed. I never encode outputs into state flops. I always have state numbers be just that --- state numbers ---- not control signals.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
3
Views
4K