one flip flop per state

Thread Starter

full

Joined May 3, 2014
225
hello everyone

I did problem for change ASM chart to one flip flop per state

I don't know how connect output in one flip flop per state please show me how I can connect output in one flip flop?

thanks
 

Attachments

Last edited:

MikeML

Joined Oct 2, 2009
5,444
Normally, if you only have four states, you can get by with using only 2 flip-flops. 2^2=4.

With four states, you could arbitrarily number them S0, S1, S2, and S3. Suppose you call the two flip-flops X and Y. Most designers just encode the states into the binary number created by using this convention: n= 2*X + Y, so now you can refer to Sn, so for S3, X=1 and Y=1, for S2, X=1 and Y=0, and so on...

Note that by doing it this way, the state machine begins to look like a simple two-bit binary counter...

If you use one FF per state, with four states, you have created a state machine with 2^4=16 possible states. If only using four of the 16, what happens if the machine accidentally gets into one of the 12 non-used states?
 
Last edited:

WBahn

Joined Mar 31, 2012
29,979
You do it the same way you would if you were using 2 FFs. You make a transition table that reflects what values you want each of the FFs to take on in response to the inputs and for each possible present state. As MikeML warns, you need to decide what to do with all of the unused states. At first glance, you might just make them don't cares, but in practice this is not the way to do it for just the reason MikeML states.

BTW, this is called One-Hot encoding.
 

Thread Starter

full

Joined May 3, 2014
225
Normally, if you only have four states, you can get by with using only 2 flip-flops. 2^2=4.

With four states, you could arbitrarily number them S0, S1, S2, and S3. Suppose you call the two flip-flops X and Y. Most designers just encode the states into the binary number created by using this convention: n= 2*X + Y, so now you can refer to Sn, so for S3, X=1 and Y=1, for S2, X=1 and Y=0, and so on...

Note that by doing it this way, the state machine begins to look like a simple two-bit binary counter...

If you use one FF per state, with four states, you have created a state machine with 2^4=16 possible states. If only using four of the 16, what happens if the machine accidentally gets into one of the 12 non-used states?
your idea for draw logic circuit using D flip-flop not for one flip flop per state
please see this PDF , I want know how I can connect output?
 

Attachments

MrCarlos

Joined Jan 2, 2010
400
Hello full

Apparently, for all the messages that have been generated, you want to make a ring counter.

However in post #4 You say:
I want know how I can connect output?

What output. ??. . . there are several of them.
 

Thread Starter

full

Joined May 3, 2014
225
Hello full

Apparently, for all the messages that have been generated, you want to make a ring counter.

However in post #4 You say:
I want know how I can connect output?

What output. ??. . . there are several of them.
from S1 to S2
3.PNG
 
Top