D Flip-Flop Counter

Discussion in 'Homework Help' started by TwoPlusTwo, Oct 14, 2010.

  1. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    Hey, my first post on here.

    The problem I have is this:

    I'm supposed to design a 2 bit binary down-counter using D flip-flops and NOR gates. Sounds simple enough but I'm stuck.

    What I don't get is that since the D flip flop has no toggle mode, the input D always has to equal the output Q, right? So how do I get it to switch back and forth?

    Looking at the now/next state table I found a logic expression for the second D input, which was of the type XNOR. But when I try to make an expression for the first D input, it just simplifies down to 1, which can't be right because then it wouldn't switch back and forth.

    Am I making any sense? Any help would be appreciated :)

    Thanks
     
  2. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
  3. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    Thanks, but as far as I can tell this only deals with JK Flip-Flops, not D Flip-Flops. And I already know how to make counters using the former, because it toggles. The question is: how do I create that effect with a D Flip-Flop, when it has no toggle mode?
     
  4. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    950
    [​IMG]

    You do it the same way. You feed the clock to the first FF, and then "clock" the next FF with the first ones Qnot output. The oscillator/clock/data input only goes to the first one. The circuit counts/clocks the rest by itself based off the 'drive' of the first FF
     
  5. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    Great! So what about the logic for the first D input? I know the second one has to be:

    Q1 XNOR Q0

    But for the first one I get:

    Q1 Q0not + Q1not Q0not

    Which just equals Q0not.

    Won't that just make the first FF stay in the same state, or will it still toggle because of the delay?

    Thanks
     
  6. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    There must be something wrong with your excitation table.

    This was my approach ...
     
  7. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    This is exactly what I got too. But I think I understand now. When we feed the Qnot back to its D input, the flip flop will change to the opposite state at the next clock pulse, thus creating a toggle.

    Thanks for the help guys!
     
  8. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    950
    I don't understand your question. The clock will make it 'toggle'. You have an OPEN input. It won't create its own data. YOU have to provide it some form of data. If you just want to count then provide it clock pulses. It will count to 16 pulses and then start again, if you have four FF coupled up. To do DOWN counting you start at all ones and go down, so you use the NOT outputs which start out all ones.
     
  9. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    Correct.

    I have attached my implementation for interest.
     
  10. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    Nice! This is how I ended up implementing it too. What software did you use to make that image, by the way?
     
  11. TwoPlusTwo

    Thread Starter Member

    Oct 14, 2010
    51
    0
    One other thing. I'm gonna let this go after this, I promise ;)

    If I wanted to implement this as an asynchronous counter in stead of a synchronous one, is it correct to say that I would have to feed the Q output of the first flip flop into the clock of the second one? Or should it be Qnot? If it's Qnot I don't really get why.
     
  12. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    It depends on the FF. Most of them are positively-triggered, that means, they switch state on the positive front of the clock. For them, you need to connect the Q' output. Don't forget to connect Q' of every FF to its D input to simulate the "toggle" operation of the JK FF.
     
    TwoPlusTwo likes this.
  13. t_n_k

    AAC Fanatic!

    Mar 6, 2009
    5,448
    782
    It's called SIMETRIX

    http://www.simetrix.co.uk/
     
    TwoPlusTwo likes this.
Loading...