Digital Logic State Diagram

  • Thread starter Physicist3
  • Start date
  • #1
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)
 

Answers and Replies

  • #2
analogdesign
Science Advisor
1,150
368
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
meBigGuy
Gold Member
2,324
406
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.
 

Related Threads on Digital Logic State Diagram

  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
3
Views
769
  • Last Post
Replies
11
Views
9K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
10
Views
6K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
2
Views
651
  • Last Post
Replies
4
Views
6K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
11
Views
3K
Top