Binary Counter Problem (repeating state)

Thread Starter

ArchonZ

Joined Apr 15, 2008
2
My assignment is to design a sequential circuit that counts out the sequence "0-1-0-2-0-3-0-4-4-4..." in binary (when the count reaches '4', it latches and remains that way unless externally reset.)

My problem: That repeating zero is really confusing me. I've searched this forum and found a couple of other mentions of repeating states, but they weren't similar enough for me to be able to figure this problem out.

I've got the states named:

A = 000
B = 001
C = 010
D = 011
E = 100

So the circuit should follow this state path: "A-> B-> A-> C-> A-> D-> A-> E -> E...". But how is the circuit supposed to tell the 'A's apart? They are all '000' in binary, so it seems like the circuit would just get stuck on the "A-> B-> A" part without ever moving to C.

*scratching my head*

Any links to further reading on this would be greatly appreciated. :)
 

veritas

Joined Feb 7, 2008
167
The trickier part is choosing the next state from the 0 output.

I am assuming the only input to the system is a clock. Therefore, you will need 4 separate states that output a zero, because there are four different states the system will transition to after a zero output.
 

Thread Starter

ArchonZ

Joined Apr 15, 2008
2
Thank you for the replies. veritas' advice put me on the right track. Just in case anybody else happens to have a similar problem in the future, I will add the relevent portions of my solution.

The root of my problem was caused by my assigning 'A' to all outputs of '000'. By separating the count generated by the flip-flops (three D's) as veritas suggested, I could avoid the issue.

State assignments: (using three binary bits)

State Name | binary value | Output

A | 000 | 000
B | 001 | 001
C | 010 | 000
D | 011 | 010
E | 100 | 000
F | 101 | 011
G | 110 | 000
H | 111 | 100

Transition Table:

Current State | Next State | Output

000 | 001 | 000
001 | 010 | 001
010 | 011 | 000
011 | 100 | 010
100 | 101 | 000
101 | 110 | 011
110 | 111 | 000
111 | 111 | 100

Thanks again :D
 
Top