Synchronous counters

Discussion in 'Homework Help' started by phantomhaseo, Jun 19, 2008.

  1. phantomhaseo

    Thread Starter New Member

    Jun 19, 2008
    4
    0
    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?
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  3. phantomhaseo

    Thread Starter New Member

    Jun 19, 2008
    4
    0
    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.
     
  4. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    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?
     
  5. phantomhaseo

    Thread Starter New Member

    Jun 19, 2008
    4
    0
    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?

    [​IMG]
     
  6. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    Input to U8 and U11 seems to have been mis-drawn.
     
  7. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    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: Jun 21, 2008
Loading...