2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Keeping track of the preceding value is a potential solution. \$\endgroup\$ – Peter Smith Dec 18 '16 at 14:01
6
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ This is good. +1! \$\endgroup\$ – Vladimir Cravero Dec 18 '16 at 14:32
  • \$\begingroup\$ Which software do you use to make that schematic? \$\endgroup\$ – Jose de arimatea Dec 18 '16 at 18:41
  • \$\begingroup\$ @Josedearimatea He's using the schematic editor built into site. See the pencil, diode, capacitor and resistor symbol at top of the Editor or type Ctrl-M while in Editor. \$\endgroup\$ – StainlessSteelRat Dec 18 '16 at 20:12
-1
\$\begingroup\$

Instead of making a counter that counts in a strange sequence, let the counter count normally, then map the result thru a lookup table. It seems your numbers are limited to the 0-15 range, so 4 bits. That means you only need a 4-bit memory with 4-bit addresses, for a total of 64 bits.

Even easier is to do this all in firmware in a microcontroller. Generate the count by incrementing, then use the low 4 bits to index into a table.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.