# State diagram of 4 connected d flip flops

1. Oct 9, 2011

### ogward

Last edited by a moderator: May 5, 2017
2. Oct 9, 2011

### lewando

For the 3 states (00, 01, and 10) that you show, what does each of the 2 bits represent?

[edit: I count only 3 flip-flops, not 4 as your problem's title claims]

3. Oct 9, 2011

### ogward

first two bits are the first the first flip flop and so on.
My mistake it should be 3 not 4, its a typo.

4. Oct 9, 2011

### lewando

If you have 3 flip-flops, why not 3 bits?

5. Oct 9, 2011

### ogward

You are making me a bit confused. Are you asking me or telling me?
I'm really lost I have no idea what I should do.

6. Oct 9, 2011

### ogward

Last edited by a moderator: May 5, 2017
7. Oct 9, 2011

### lewando

It's pretty much incorrect. When you have 3 flip-flops, you have 3 memory elements each capable of being in a 0 or 1 state. The state of this system refers to the collective state of the individual flip-flops. With 3 flip-flops, you have 23 possible system states. The 3-bit value you are showing in the center of the circles represents the state of the flip-flops for that particular system state. For example, when the state of the first flip-flop (going from left to right) is a 1 (internally, not referring to Q or Q') and the second and third are both 0, you can say that the state of the system is [D1, D2, D3] = [1,0,0] or even "4" if you treat [1,0,0] like 1002.

[Edit: I see you are treating the clock like an input to the system. Technically, it is an input but it is a special input used for synchronizing the inputs and allowing the system to advance from state to state. In this case, your "input" is really the output of D3 fed back to D1. I say "input" with quotations because it is really an internal signal, not coming from outside the system.]

Last edited: Oct 9, 2011
8. Oct 9, 2011

### ogward

To begin with I should have 8 circles(0-7) with 3 bits in each?
At the beginning the "system" is 000 then 001 and so on?

9. Oct 9, 2011

### lewando

You could start with 8 circles. Remember there are 8 possible states. You may not get to some of them. Yes, start with state [000], the implied power-on reset condition.

Be clear in what [000] represents. For purposes of this discussion use [state-of-D1, state-of-D2, state-of-D3] with D1 the FF on the left and D3 the FF on the right.

If you start out with [000] and hit it with a clock pulse, what is the next state?

10. Oct 9, 2011

### ogward

I'm sorry but I don't understand this sentence.
"For purposes of this discussion use [state-of-D1, state-of-D2, state-of-D3] with D1 the FF on the left and D3 the FF on the right."

The next state should be [001] if the CP=1. Should I allays assume that the CP is 1?

11. Oct 9, 2011

### ogward

I think I'm gonna going to change my answer to [100] for state two.

12. Oct 9, 2011

### lewando

Sorry, this was just to make it easy to understand each other. Since the original circuit has no reference designators on any of the flip-flops (FFs), I thought it would be a good idea to name each FF D1, D2, D3, going left to right.
If you are using the above convention, you are not correct. Let's assume the FFs change state upon the rising edge of the CP (when going from 0 to 1). That is what I meant by "hitting it with a clock pulse"-- a 0-1-0 pulse contains the rising edge).

When in state [000], what do you have for the inputs to each FF? (before any CP happens)

Edit-- [100]: then you are correct! Continue the process with each additional CP.

13. Oct 9, 2011

### ogward

then every FF has to be [000]?

14. Oct 9, 2011

### lewando

I thought you were getting on the right track when you correctly asserted [100] as the next state from [000]. How did you get [100]?

15. Oct 9, 2011

### ogward

I find it a bit hard to explain but the 1 pushes the [000] to the right so the zero to the right "falls out".
sounds weird when I read what I just wrote...

16. Oct 9, 2011

### lewando

Yes, sounds weird . Let's formalize the action. You need to look at the input to each FF before the CP happens (when in state [000], what are they?). When the CP happens, the state of the input into each FF determines the new state of each FF.

Edit: In the case of a D FF, if the input is a 1 when the CP happens, the new state will be a 1 (with Q = 1 and Q' = 0).

Last edited: Oct 9, 2011
17. Oct 9, 2011

### ogward

If the first state is [000] then something tells me that the inputs should be [D1, D2, D3]= [100]

18. Oct 9, 2011

### ogward

I think I'm starting to get this, or at least I hope so...
If in state [000] and receive a 0 I stay in [000], If I get 1 i go to state [100].
If I'm in state [100] and get 0 I stay in [100], if I get 1 I go to state [011].
When in [011] and receive 0 I stay and if I get 1 I go back to state [100].
Is that correct? if so, whats the next step?

19. Oct 9, 2011

### lewando

This is correct.
Okay so far.
Not so. Similar question: If you are in state [100] (and the clock is 0--no CP) what are the inputs to each FF?

20. Oct 9, 2011

### ogward

Aren't they the same as before [100]?