This answer was originally written before the Q was edited. After consulting with the OP, it's been expanded.
This is pretty straightforward. Given your initial states, the output of your three flip-flops are:
Q:dff0 = 0
Q:dff1 = 0
Q:dff2 = 1
- dff2's input is connected to dff1's Q
- dff1's input is connected to dff0's Q
- dff0's input is the output of the XOR, which is 1 in the initial state.
So, when the clock pulses (and I'm doing this out of order on purpose):
- dff1's input D is 0, so it's output Q will remain 0.
- dff2's input D is 0, so it's output Q will switch from 1 to 0.
- dff0's input D is 1, so it's output Q will switch from 0 to 1.
Thus, the next state solution of 100
.
Remember, the clock will push whatever the value is on pin D (e.g., D:dff2=0 in the initial state) to pin Q (therefore Q:dff2 switches from 1 to 0).
The fact that dff1 doesn't change state in this example is important. It takes the effect of the XOR out of the example (reducing analysis complexity). Think of it this way. If you erase the XOR and simply say the initial state on D:dff0 is 1 you'll get the same output and it might make the clock event more understandable for this example.
OK, part of what's throwing you off is that you think the word "counter" is numerically relevant. You're expecting something like 1, 2, 3, 4... However, a "counter" in the world of boolean logic is nothing more than a circuit that cycles through all the numbers ("states") without ambiguity.
In other words, it's a lot easier to think of this circuit as a state machine than it is a counter. Let's start with what you already know, the XOR logic.
We know our XOR inputs are Q:dff2 and Q:dff0. So let's develop a state map (a list of states and what they would become after the next clock cycle). Note in this example that I'm starting with a traditional boolean progression (something like 0, 1, 2, 3...). Remember, the output of the XOR is the input to dff0. (NOTE: "012" is shorthand for "dff0, dff1, dff2.")
012 |
X |
> |
Next State |
000 |
0 |
> |
000 (can't get out of this so it's an "illegal state") |
100 |
1 |
> |
110 (this is your stated "initial state") |
010 |
0 |
> |
001 |
110 |
1 |
> |
111 |
001 |
1 |
> |
100 |
101 |
0 |
> |
010 |
011 |
1 |
> |
101 |
111 |
0 |
> |
011 |
Now, let's reorder the state state table according to state progression. This means we're walking away from (1, 2, 3, 4...) so we can see what will actually happen as the clock cycles.
012 |
X |
> |
Next State |
100 |
1 |
> |
110 |
110 |
1 |
> |
111 |
111 |
0 |
> |
011 |
011 |
1 |
> |
101 |
101 |
0 |
> |
010 |
010 |
0 |
> |
001 |
001 |
1 |
> |
100 (go back to the 1st line and repeat) |
Remember, this is a "counter" (in the lexicon of digital boolean logic) because you're moving (counting) based on a clock from one state to another in a predictable and unambiguous manner. And I think that's what's confusing you, because this isn't a "counter" from the point of view of counting (1, 2, 3, 4...).
Under normal circumstances I'd call dff0 the least significant bit, meaning the "number" is represented as Q:dff2, Q:dff1, Q:dff0, or 100 = 4. But because this is a "counter" only in the boolean sense I can't tell if it's progression is (4, 6, 7, 3, 5, 2, 1) or (1, 3, 7, 6, 5, 2, 4). However, I mention this only for the sake of interest, I don't think it's important. What you have is a state machine that's changing states on every clock pulse.
Finally...
It's worth noting that there are a number of "counters" in the digital boolean world. One of the most famous is the Johnson Walking Ring Counter. (Curiously, it's #2 on the list in that link.) You should become accustomed to the idea of "counters," this won't be the last time you encounter them.