# ask three clock cycles counter

#### cupcake

Joined Sep 20, 2010
73
I want to implement a three clock cycles counter using 74193..
is this a correct way to do? start from 00,01,10 and then stop and reset

#### beenthere

Joined Apr 20, 2004
15,819
There is no gate that will stop the clock, nor another to reset the counter. Is that the function you want, to simply count to 2 and then stop with a reset to 0? If you want to count continuously, shouldn't the next clock after the one that counted to 2 do the reset?

#### cupcake

Joined Sep 20, 2010
73
oh, so, means, 11 or 3, in the next clock will do the reset? but, I need to reset everything to 0..how do I stop the clock? could I just feed the next output of the counter to the clock pulse to reset everything?

Last edited:

#### beenthere

Joined Apr 20, 2004
15,819
Place a gate in the clock line that breaks on a count of 2 (if that is really what you want to do).

Are you sure the counter should not go 0 - 1 - 2 - 0 - 1 - 2 - 0, etc?

#### cupcake

Joined Sep 20, 2010
73
no, because I only need three clock cycles (00,01,10), if I count 0-1-2-0-1-2-0, it will be 7 clock cycles..

I draw a schematic again..

#### Wendy

Joined Mar 24, 2008
22,547
With counters there are usually several different ways to do things. One consideration is whether it matters if if the counter spends a few microseconds in an illegal condition, in this case binary 11. If it is a visual display then it doesn't matter, but if it is for a number crunch application you may not be able to get by with it.

For the moment I'm going to assume it doesn't matter. I've mentioned it before, but a 74193 is not the best chip for a simple counter application, a simple 7472 or a 7474 would probably work better. However, I'll go with the 74193 for the sake of illustration.

74192 Datasheet

One side comment, datasheets are your friend, always. When you find PDF files of a chip you will use save it on your computer.

#### Attachments

• 4.1 KB Views: 113
Last edited:

#### cupcake

Joined Sep 20, 2010
73

just a few question, what is the function of SR FF there? is it possible to replace with D FF? in my 74193 chip above, the count up pin is actually the clock input, so I think I can directly connect it to clock instead of using AND gate, right?

#### Wendy

Joined Mar 24, 2008
22,547
Maybe. The thought occurred to me that a NOR gate connected along side the AND gate on the output would detect 00, and this could be used to gate the clock signal. To override you add a third input to the NOR gate, and input a 1 to disable the count hold.

You may have noticed the count hold is a feature that requires extra logic, possibly an extra flip flop. Otherwise you could do what beenthere suggested, and create a much simplier more traditional counter that simply repeats "0 1 2 0 1 2 0 1 2 0 1 2 ...". This is much more typical of counters in general.

You didn't comment whether having "11" for a microsecond was allowed or not. You need to think about it and come back with an answer.

What you want can also be done with JK flip flops. This is actually the reason they exist, simply by using the JK inputs you can create any count sequence you want with no illegal conditions with two flip flops (one simple chip). Again, the hold feature will require extra logic.

This reminds me strongly of a digital class I took many decades ago (around 3 and a half).

The 74192/93 has a close match in the CMOS logic family 4029, as do the other flip flops mentioned. I've used them to create count down timers, specifically for sports events. The basics don't change no matter what logic family you use.

I'm attaching my gates template to help you draw using simple graphics programs such as MS Paint. It is part of my PaintCAD package (found in my blog here at AAC).

.

#### Attachments

• 34.5 KB Views: 35

#### cupcake

Joined Sep 20, 2010
73
Thanks again for your clear explanation, I got the idea actually..

I think, this question doesn't allow to have 11 for a microsecond, the counter should stop immediately after 10, and reset the whole counter.., so actually I only need to detect 1 (outpun pin QB) and use it to clear the whole counter.. of course with some logic gates.. that's what I thought

there also a limitation of the number gates to use, that's why I limit my self to either use 74191 or 74193, but I go with 74193 because it already has a reset pin..

Thanks, I will think about it again..

#### Wendy

Joined Mar 24, 2008
22,547
I may have a solution for that too. If I can get the idea to gell I'll post it. As you can probably tell I'm a very visual person, I like to draw my ideas.

#### Georacer

Joined Nov 25, 2009
5,182
Here's an alternative: Take the attached diagram and read this thread to turn it into a counter that counts when given the input 1: http://forum.allaboutcircuits.com/showthread.php?t=44399

I am away from home so I can't make an image capture for you now. Download the editor of the attached file here: http://sourceforge.net/projects/qfsm/ (it's a freeware) or wait till Monday for me to upload a screen capture.

P.S. One of these days I will mail Drunkilton with my submission, since no corrections seem to come up.

#### Attachments

• 1.3 KB Views: 12