Synchronous counter JK flip flops

Discussion in 'Homework Help' started by manish1991, Jun 17, 2013.

  1. manish1991

    Thread Starter New Member

    Jun 17, 2013
    11
    0
    hello,

    Im having trouble creating a 4-bit synchronous counter that counts in the sequanece 11,13,15,4,2,6 and then back to 11. using jk flip flops.

    I have done my next state and present state table and got my karnaugh maps.

    but im not sure if the algebra that i have got at the end is correct

    JA= BC
    KA=BCD

    JB=D
    KB=not D

    JC=1
    KC=D

    JD=B
    KD=notC +notD

    any help would be appreciated

    thank you
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,360
    Simple. Show all your work.
     
  3. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    We aren't mind readers, so we have no idea how A,B,C, and D map to the bits in your state numbers. There are two obvious choices, but don't make us jump through hoops to figure which, if either, you are using.

    You need to show your WORK, not just your results. This is for several reasons, but here's one that is particularly relevent here. This problem is going to have several possible solutions. Most of us are more than willing to walk through your work and see if it is correct step-by-step. Most of us are not willing to work a multi-solution problem to see if we can, somehow, get the same particular solution you did.

    Finally, since you have managed to make it to a solution (at least a potential solution), then pat yourself on the back for a job well done, celebrate for a moment, stretch, and then proceed to check if your solution is actually correct. Try not to rely on having others check your work when you can pretty easily do so yourself.

    Treat it as an analysis problem:

    A four-bit JKFF-based finite state machine uses the following excitation logic:

    JA= BC
    KA=BCD

    JB=D
    KB=not D

    JC=1
    KC=D

    JD=B
    KD=notC +notD

    What is the sequence of states that this machine cycles through?

    Get in the habit of looking for ways to verify your own work, because out in the "real world" there usually won't be anyone but you to do it -- that's why they are paying you in the first place!

    A quick gander leads be to believe that, assuming I have guessed correctly about your mapping, that your solution is not correct.
     
  4. manish1991

    Thread Starter New Member

    Jun 17, 2013
    11
    0
  5. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    Well, at least sendspace.com only wants to put two or three cookies on my machine. That's tolerable and I'm willing to block those in order to access the site. It's when a site insists on trying to put dozens of cookies on my machine that I balk.

    Most people here won't download .doc or .xls files from an untrusted source -- too much risk.

    It is preferred that you post images or tables directly onto the AAC site, that way they are easily accessible and archived as part of the site and not just a link to an external site that may not remain valid down the road.

    Don't worry, we'll get there.
     
  6. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
  7. manish1991

    Thread Starter New Member

    Jun 17, 2013
    11
    0
    Here is my present state table:

    q3 q2 q1 q0
    1 0 1 1
    1 1 0 0
    1 1 1 1
    0 1 0 1
    0 0 1 0
    0 1 1 0


    next state table:

    q3 q2 q1 q0
    1 0 1 1
    1 1 0 0
    1 1 1 1
    0 1 0 1
    0 0 1 0
    0 1 1 0


    transition table i used to make my maps:

    qn qn+ j k
    0 0 = 0 x
    0 1 = 1 x
    1 0 = x 1
    1 1 = x 0
     
  8. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    What is a "present state table"?

    It would appear to be identical to what you are calling your "next state table".

    But your next state table... isn't one.

    A next state table tells provides the following information:

    If I am in State A and I see Input B then I transition to State C (on the next rising clock edge, since this is a synchronous machine).

    In your case, you have no inputs, so you next state table should have, on each row, a present state and a next state.

    What you call a "transition table" is better called the excitation logic table for a JK FF, but that's a fairly minor point.

    You still haven't addressed the mapping. Your tables have q3,q2,q1,q0. Your logic equations have A,B,C,D. How do these relate?
     
  9. manish1991

    Thread Starter New Member

    Jun 17, 2013
    11
    0
    Thank you for being so patient with me

    i have attatched an image of my next and present state table along with my transistion table i used to make my maps

    also my logic that i have gotten from the maps and the design of the counter.

    like i said before, i think my maps are right but not to sure on the algebra and actual counter design
     
  10. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    That helps quite a bit.

    In your spreadsheet you have three tables that really should be a single table.

    Remember, a table is a stand-alone entity. What you want is a table that has three sections in it:

    Far left: Your Present State columns. These are the entry points into the table.

    Middle: Your Next State columns. These are the end results you want to achieve for each entry point.

    Far right: Your right-top columns. These are the excitation requirements for each entry point.

    I don't know what your row designations 3 through 8 are supposed to mean.

    You organization of your K-maps makes it hard to correlate with your tables and, thus, error prone. Your tables order q3..q0 from left to right. But your K-maps use q0q1 and q2q3, so the bits are read right to left. Needlessly confusing.

    Learn to sanity check your work.

    Take the K-map for J0. In your table you have two 1s and one 0. Yet in your K-map you have three 1s and one 0. Worse, in your table for K0 you have two 1s and one 0, but in your K-map you have only one 1 and one 0. That's bad!

    It would be useful if you made a blank K-map that simply identified which cells correspond to which rows in your transition table.
     
  11. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
  12. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    Feel free to ignore this post, at least for now. But I wanted to point out a few things for you to consider at some point.

    First, your state machine only has six states, thus you can actually run it with just three JK flip flops. You can run in states 0-1-2-3-4-5 and just decode the state variables to map them to 11,13,15,4,2,6.

    I don't know how your instructor would react if you did that. Unless I has specifically indicated that they weren't to do something like that, I would tend to pat them on the back and give them a point or two extra credit.

    But let's look at the structure a bit closer and see if we can leverage something even better:

    11 - 1011
    13 - 1101
    15 - 1111
    04 - 0100
    02 - 0010
    06 - 0110

    Notice that the first and last bits are always the same. Thus, you can reduce this to a 3-FF machine without having to do any mapping at all!
     
Loading...