Synchronous counters

Thread Starter

phantomhaseo

Joined Jun 19, 2008
4
I know of the up and down counters, I was wondering is there was a way to have a counter count only prime numbers in binary. Instead of going 1...2...3...4...it would go 1...3...5...7 ect. I was thinking of having maybe one of the flip-flops connect from the Reset to a Qnot so it would produce a zero rather than a 1. Or maybe for the up counter circuit, flip one of the AND gates. I am spewing out ideas... I am just wondering if its possible and how, what would have to be done to the FLip FLops..or rather the Logic Gates?
 

SgtWookie

Joined Jul 17, 2007
22,230
The problem with that approach is that you would have to immediately issue another clock any time the output of the counter was a non-prime number. 2 in binary is a valid prime, but at any other time if bit 2 is on it must be clocked again, and so on. It wouldn't be long before you're clocking it all the time to get past the non-prime numbers. You would need a ridiculous number of gates to take care of all the non-primes.

A much easier way would be to program an EEPROM with a table of prime numbers, and have the counters select the address lines.
 

Thread Starter

phantomhaseo

Joined Jun 19, 2008
4
Wow...but what if it had to be done by FLip Flops...I mean there has to be a way for inputs to go through a cycle and "skip" certain numbers...or is an EEPROM the only way? I was looking online for a prime number synchronous counter..no luck, thats why I looked at a up counter and tried to figure it out form there.
 

thingmaker3

Joined May 16, 2005
5,083
Counters typically cycle through until they reach a certain number. In order to "skip" numbers, one would have to have an additional counter for each "skip." Either that or the afforementioned ridiculous number of gates in one counter.

Is your instructor actually insisting on flip-flops for this assignment?
 

Thread Starter

phantomhaseo

Joined Jun 19, 2008
4
After hours on here I think I got something....though using them in two programs don't seem to help. I have a prime number up/down counter. Though in Multisims I get an error, saying something about analog and digital inputs cant mix..something like that. Which makes no sense I know the clock input is usually an analog signal. Now the circuit runs on two situations. If switch is open...do this. If switch is closed do that. I checked...double checked..triple checked the connections. Did I miss something?

 

JoeJester

Joined Apr 26, 2005
4,390
Though in Multisims I get an error, saying something about analog and digital inputs cant mix..something like that.
Is your clock signal a square wave or sine? I'm assuming it's a sine wave at 1 volt, per your diagram. It should be a TTL level square wave.

I don't see any connections to the set and reset pins of your flip-flops.

I don't see the anodes of the LED's connected to anything other than each other. They should be.
 
Last edited:
Top