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

AI Thread Summary
In designing a state diagram for a system with two sequences based on control input, repeating the same state twice in a sequence is not advisable without unique identifiers for each occurrence. If a state is revisited, additional state variables are necessary to distinguish between the instances, effectively creating a new state. The design must consider whether the output signals require glitch-free operation, which may involve additional flip-flops for clarity. The approach to writing state machines should prioritize readability and maintain separation between state numbers and control signals. Overall, careful structuring of states and transitions is crucial for effective state machine operation.
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.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top