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

In summary, the conversation discusses the design of a system that runs different sequences based on the control input being on or off. The question is whether the system can repeat the same state twice in the sequence for the control input being on, potentially missing other states. The solution involves using additional state variables or encoding outputs into state flops to ensure glitch-free outputs. The speaker also mentions their preferred method of writing state machines in Verilog.
  • #1
Physicist3
104
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
  • #2
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).
 
  • #3
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.
 

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

What is a digital logic state diagram?

A digital logic state diagram is a graphical representation of the different states of a digital system and how those states change in response to various inputs. It is used to design and analyze digital circuits and systems, and can help visualize the behavior of complex systems.

How is a digital logic state diagram constructed?

A digital logic state diagram is constructed using symbols and lines to represent the different components and connections of a digital system. The symbols used in the diagram depend on the type of digital system being represented, such as logic gates, flip-flops, and inputs/outputs. The lines connecting the symbols represent the flow of data between components.

What is the purpose of a digital logic state diagram?

The purpose of a digital logic state diagram is to provide a visual representation of the behavior and operation of a digital system. It can help identify potential problems and optimize the design of a system by showing the relationship between inputs and outputs, as well as the different states and transitions within the system.

How is a digital logic state diagram different from a truth table?

A truth table is a tabular representation of a logical function, showing all possible combinations of inputs and their corresponding outputs. A digital logic state diagram, on the other hand, is a graphical representation of the behavior and operation of a digital system, showing the different states and how they change in response to inputs.

Can a digital logic state diagram be used for both combinational and sequential circuits?

Yes, a digital logic state diagram can be used for both combinational and sequential circuits. For combinational circuits, the diagram will show the different logic gates and how they are connected, while for sequential circuits, it will also show the sequential elements such as flip-flops and their inputs and outputs.

Similar threads

Replies
1
Views
1K
Replies
1
Views
1K
Replies
5
Views
3K
Replies
19
Views
3K
Replies
3
Views
4K
Replies
7
Views
2K
Back
Top