# ask three clock cycles counter

Discussion in 'Homework Help' started by cupcake, Oct 27, 2010.

1. ### cupcake Thread Starter Member

Sep 20, 2010
73
0
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

2. ### beenthere Retired Moderator

Apr 20, 2004
15,815
283
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?

3. ### cupcake Thread Starter Member

Sep 20, 2010
73
0
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: Oct 27, 2010
4. ### beenthere Retired Moderator

Apr 20, 2004
15,815
283
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?

5. ### cupcake Thread Starter Member

Sep 20, 2010
73
0
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..

6. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
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.

• ###### temp1.GIF
File size:
4.1 KB
Views:
109
Last edited: Oct 28, 2010
7. ### cupcake Thread Starter Member

Sep 20, 2010
73
0

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?

8. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
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).

.

File size:
34.5 KB
Views:
32
9. ### cupcake Thread Starter Member

Sep 20, 2010
73
0
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..

10. ### Wendy Moderator

Mar 24, 2008
20,772
2,540
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.

11. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
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.

File size:
1.3 KB
Views:
10