BCD up/down counter 0- 9 using ff-jk

Discussion in 'Homework Help' started by Lepaletiux, Mar 17, 2018.

  1. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I need help with a 4 bit bcd up/down counter that counts 1001 to 0000 ascendant and 0000 to 1001 for descendant
     
  2. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I have this, but only goes 8 and 4 and 4 -8
     
  3. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    Welcome to AAC!

    Your schematic is unreadable. Post your Kmaps.
     
  4. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    Hi, thank you.

    I don't have Kmaps, I used minterms

    J3= Q3'(A'Q2Q1Q0+AQ2'Q1'Q0')
    K3= A'Q0+AQ0'
    J2= Q2'(A'Q3'Q1Q0+AQ3Q1'Q0')
    K2= A'Q1Q0+AQ1'Q0'
    J1= A'Q3'Q1'Q0+AQ3'Q2Q1'Q0'+AQ3Q2'Q1'Q0'
    K1= A'Q3Q1Q0+AQ3'Q1Q0'
    J0= 1
    K0 = 1
     
  5. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    I simulated your circuit. It counts down correctly, but the up sequence is: 0,1,2,3,6,7,A,B

    I don't like to use 2 letter variables. This is the mapping I used:
    Code (Text):
    1. A->E, Q3->D, Q2->C, Q1->B, Q0->A
    2. J3= Q3'(A'Q2Q1Q0+AQ2'Q1'Q0')             = D'(E'CBA+EC'B'A')
    3. K3= A'Q0+AQ0'                            = E'A+EA'
    4. J2= Q2'(A'Q3'Q1Q0+AQ3Q1'Q0')             = C'(E'D'BA+EDB'A')
    5. K2= A'Q1Q0+AQ1'Q0'                       = E'BA+EB'A'
    6. J1= A'Q3'Q1'Q0+AQ3'Q2Q1'Q0'+AQ3Q2'Q1'Q0' = E'D'B'A+ED'CB'A'+EDC'B'A'
    7. K1= A'Q3Q1Q0+AQ3'Q1Q0'                   = E'DBA+ED'BA'
    Schematic:
    upload_2018-3-18_9-4-49.png

    The simulator I use makes the wires gray when they're LOW and black when they're HIGH. You can see that on the next clock, the A and C flops will toggle and B will be unchanged; making the count go from 3 to 6. The B flop needed to either toggle or be reset, so that gives you clues as to which combinational logic is wrong.

    You could use the same procedure to troubleshoot your circuit but your schematic is not as easy to read.

    EDIT: Some hints for you. In my design, the KB and KD inputs were the same and the B flop toggled when going from 3 to 4.
     
    Last edited: Mar 18, 2018
    Lepaletiux and absf like this.
  6. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I think I found the answer, cause k1 = E'D'BA+ED'BA'
     
  7. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    How did you find the problem?

    By not using Kmaps, you aren't taking advantage of logic simplification the don't cares would give you.
     
  8. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    Cause I did the wrong boole simplification
    Is there any aplication for Kmaps for those kind of ecuations?
     
  9. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    Not sure what your asking for.

    If you had populated your truth table with the don't care states and transferred all entries to Kmaps, the equation for K1 would have simplified to E'A+EA'. No amount of boolean algebra would have allowed you to get there from E'D'BA+ED'BA' = D'B(E'A+EA').

    EDIT: This is the Kmap for KB from my design. I used Z as the control and the counter counted up with Z=1 and down with Z=0.
    upload_2018-3-19_8-39-45.png
    I think what they teach in schools now is to use 2 4x4 Kmaps to solve 5 variables. With the technique I use, I can solve for 6 variables in one Kmap.
     
    Last edited: Mar 19, 2018
  10. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    This is my T. table
    My first ec. are:
    J3= E'D'CBA+AD'C'B'A'
    K3= E'DC'B'A+EDC'B'A'
    J2= E'D'C'BA+EDC'B'A'
    K2= E'D'CBA+ED'CB'A'
    J1=E'D'C'B'A+E'D'CB'A+ED'CB'A'+EDC'B'A'
    K1= E'D'C'BA+E'D'CBA+ED'C'BA'+ED'CBA'

    Simplification
    1. j3= D'(E'CBA+EC'B'A')
    2. k3= = E'A+EA'
    3. j2= = C'(E'D'BA+EDB'A')
    4. k2= = E'BA+EB'A'
    5. j1 = E'D'B'A+ED'CB'A'+EDC'B'A'
    6. k1 = E'D'BA+ED'BA'
     
  11. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    The next step after creating the truth table is to transfer the data to a Kmap. You didn't do that. You just wrote down the minterms that were true and simplified with boolean algebra.

    If you had use Kmaps, your Kmap for K1 would have been similar to my map for KB, and the equation would have simplified to E'A+EA'.
     
  12. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    My teacher told me to do it like that, here I have my Kmaps and as you say k1 = E'A+EA'.

    Not sure if i made them correct, cause is my first time doing Kmaps this way.
     
  13. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    I take it that you haven't studied Kmaps yet? That's one of the problems with Homework Help. We don't know what you've studied or what you're currently studying, so we either have to ask a lot of questions, or make assumptions.
    The only equation I agree with is K1, but the groupings you made in the Kmap don't agree with the answer. To simplify to 2 variables, you needed a grouping of 8. You show two groups of 4:
    upload_2018-3-19_13-53-2.png
    The answer should have been A'Q3'Q0+AQ3'Q0'.
     
  14. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I have, but don´t know how to do Kmaps for 5 variables.
    A'Q3'Q0+AQ3'Q0' is the answer but next simp. is AQ0'+A'Q0
     
  15. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    I think the preferred method is to use 2 4x4 maps.

    You seem to have grasped the concept of reflection/mirroring. You just didn't transfer data to all of the cells.
    How are you eliminating Q3'? There's no identity/rule that allows it.
     
  16. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I´m learning by myself to this, I am newbie.
    Can you tell me how did you get that equation, from what truth table did you get that, and how that i didn´t transfer all the data.

    And I am wrong from that sorry I was reading my first ec.
     
  17. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    Your truth table has 20 rows, it should have 32.

    Your Kmap has data in 16 cells; you should enter data from all rows.
    From the data in your Kmap, and the groupings, you can't get the answer you wrote down for K1.
     
    Last edited: Mar 19, 2018
  18. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    Oh I see, maybe that´s why i dont get any secuence.
    The teacher told me that my truth table should have just 20 rows as I have it. Is it wrong?.
     
  19. dl324

    AAC Fanatic!

    Mar 30, 2015
    8,714
    2,105
    Either you misunderstood your teacher, or the teacher is wrong. With 5 variables, a fully populated truth table would have 32 rows:
    upload_2018-3-19_18-1-19.png
    It's the don't cares in the rows for invalid counts that lets you simplify the logic.

    Other than reversing the polarity of the count direction variable, our tables would be the same.
     
  20. Lepaletiux

    Thread Starter New Member

    Mar 17, 2018
    20
    0
    I see, I understand everything now, I am going to do it again. Thanx
     
Loading...