Is it possible to alter the next state of a state diagram?

Thread Starter

nubpwn3r

Joined Oct 15, 2015
15
Hi guys I am working on the last part of my Traffic Lights Project

I have a question about the 7476 IC JK Flip Flop
is it restricted to do down and up counters?

because I got creative and thought 'is it possible to modify the next state?'
an example of the state table that I have in mind is this:
STATE TABLE.PNG

Now to make it relevant to using it to traffic lights, the reason each Next state only has 1 Active HI Bit is because i will connect it to RED, GREEN, and YELLOW LED's respectively.

I know I have options like using 4017 IC, but I will also be using a 7 segment, so, that option is not viable.

Anyone Help?
 

MikeML

Joined Oct 2, 2009
5,444
If you are building a generic state machine out of flip-flops and gates, then there is no restriction on what the next state can be. You will, however, have to decode the present state in order to form the inputs so that the next state is what you want...
 

Thread Starter

nubpwn3r

Joined Oct 15, 2015
15
In a decoder, I just input the present state and voila, outputs will come.

eitherway, ill try that now thanks for the tip,
be right back
 

Thread Starter

nubpwn3r

Joined Oct 15, 2015
15
If you are building a generic state machine out of flip-flops and gates, then there is no restriction on what the next state can be. You will, however, have to decode the present state in order to form the inputs so that the next state is what you want...
I inputted the present states to the 74138 decoder it didnt work :(
my desired Present State, Next state is:
STATE TABLE.PNG

but after the simulation i just get a Steady HI State in output D from flip flop

error.png
 

WBahn

Joined Mar 31, 2012
24,693
Hi guys I am working on the last part of my Traffic Lights Project

I have a question about the 7476 IC JK Flip Flop
is it restricted to do down and up counters?

because I got creative and thought 'is it possible to modify the next state?'
an example of the state table that I have in mind is this:
View attachment 93971

Now to make it relevant to using it to traffic lights, the reason each Next state only has 1 Active HI Bit is because i will connect it to RED, GREEN, and YELLOW LED's respectively.

I know I have options like using 4017 IC, but I will also be using a 7 segment, so, that option is not viable.

Anyone Help?
Your table isn't going to work very well. Let's assume that you start things off in state 0000. What's the next state that the machine goes to? 0001. What state does it go to after that? 0001. See the problem?
 

WBahn

Joined Mar 31, 2012
24,693
Is this a school project assignment?

If so, the thread can/should be moved to Homework Help -- it will get the attention of people that focus on that sort of thing.
 

Thread Starter

nubpwn3r

Joined Oct 15, 2015
15
Your table isn't going to work very well. Let's assume that you start things off in state 0000. What's the next state that the machine goes to? 0001. What state does it go to after that? 0001. See the problem?
Mhm Im get the point thanks, and after i did a state diagram, so what you are trying to say is that Next states and the next states there after, should not be redundant. I should therefore mix it up.

And regarding the thread issue, ummm I saw the Header that it is "Projects Forum" and I am working on a project so I posted it here.
 

WBahn

Joined Mar 31, 2012
24,693
Mhm Im get the point thanks, and after i did a state diagram, so what you are trying to say is that Next states and the next states there after, should not be redundant. I should therefore mix it up.
Saying "mix it up" sounds like a random process. While there is flexibility, there is very little that is random.

First what you need to do is forget about how the states are encoded. Design your state machine with general state labels such as A, B, C, or S0, S1, S2. You first need to figure out what you need the machine to do, then worry about how you will get it to do it.

And regarding the thread issue, ummm I saw the Header that it is "Projects Forum" and I am working on a project so I posted it here.
Not unreasonable, but if it is any kind of course work for credit, it really should be over in Homework Help. If that's the case, just say so and I'll gladly move it over there.
 
Top