Electronic – Design a Counter With an Arbitrary Sequence

counterflipflop

I'm trying to design an asynchronous counter with JK flip- flops, with an arbitrary sequence.

The sequence is: 0,1,10,11,0,5,14,15.

I know how to solve this kind of problems, but in this case the sequence repeats one number, 0.

I want to solve this like this guy: https://www.youtube.com/watch?v=Zce6NlHuvfs

But I don't how to manage the problem of the repetition of one number in the sequence.

Any idea?

Thanks in advance.

Best Answer

If you write down the mapping of count states 0-7 to outputs

count             oputput
C2 C1 C0          O3 O2 O1 O0
0  0  0           0  0  0  0    =  0
0  0  1           0  0  0  1    =  1
0  1  0           1  0  1  0    = 10
0  1  1           1  0  1  1    = 11 
1  0  0           0  0  0  0    =  0
1  0  1           0  1  0  1    =  5
1  1  0           1  1  1  0    = 14
1  1  1           1  1  1  1    = 15

You see that
O0 = C0
O1 = O3 = C1
O2 = (C0 OR C1) AND C2

So you can accomplish that simply with a 3 bit counter one OR and one AND gate:

schematic

simulate this circuit – Schematic created using CircuitLab

Note: there is, however, a so-called hazard between count state 5 and 6, i.e. there might be multiple edges before the signal settles to the new state. That won't be a problem if you don't care about output edges, only about levels.