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

#### Lepaletiux

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

#### Lepaletiux

Joined Mar 17, 2018
20
I have this, but only goes 8 and 4 and 4 -8

#### Attachments

• 98.2 KB Views: 39
• 150.4 KB Views: 43

#### dl324

Joined Mar 30, 2015
11,593
Welcome to AAC!

#### Lepaletiux

Joined Mar 17, 2018
20
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

#### dl324

Joined Mar 30, 2015
11,593
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:
A->E, Q3->D, Q2->C, Q1->B, Q0->A
J3= Q3'(A'Q2Q1Q0+AQ2'Q1'Q0')             = D'(E'CBA+EC'B'A')
K3= A'Q0+AQ0'                            = E'A+EA'
J2= Q2'(A'Q3'Q1Q0+AQ3Q1'Q0')             = C'(E'D'BA+EDB'A')
K2= A'Q1Q0+AQ1'Q0'                       = E'BA+EB'A'
J1= A'Q3'Q1'Q0+AQ3'Q2Q1'Q0'+AQ3Q2'Q1'Q0' = E'D'B'A+ED'CB'A'+EDC'B'A'
K1= A'Q3Q1Q0+AQ3'Q1Q0'                   = E'DBA+ED'BA'
Schematic:

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:

#### Lepaletiux

Joined Mar 17, 2018
20
I think I found the answer, cause k1 = E'D'BA+ED'BA'

#### dl324

Joined Mar 30, 2015
11,593
I think I found the answer, cause k1 = E'D'BA+ED'BA'
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.

#### Lepaletiux

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

#### dl324

Joined Mar 30, 2015
11,593
Is there any aplication for Kmaps for those kind of ecuations?

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.

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:

#### Lepaletiux

Joined Mar 17, 2018
20

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.
View attachment 148643
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.
This is my T. table
My first ec. are:
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'

#### Attachments

• 158.8 KB Views: 13

#### dl324

Joined Mar 30, 2015
11,593
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'.

#### Lepaletiux

Joined Mar 17, 2018
20
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.

#### Attachments

• 117.6 KB Views: 12

#### dl324

Joined Mar 30, 2015
11,593
My teacher told me to do it like that
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.
Not sure if i made them correct, cause is my first time doing Kmaps this way.
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:

The answer should have been A'Q3'Q0+AQ3'Q0'.

#### Lepaletiux

Joined Mar 17, 2018
20
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

#### dl324

Joined Mar 30, 2015
11,593
I have, but don´t know how to do Kmaps for 5 variables.
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.
A'Q3'Q0+AQ3'Q0' is the answer but next simp. is AQ0'+A'Q0
How are you eliminating Q3'? There's no identity/rule that allows it.

#### Lepaletiux

Joined Mar 17, 2018
20

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.
View attachment 148643
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.
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.

How are you eliminating Q3'? There's no identity/rule that allows it.
And I am wrong from that sorry I was reading my first ec.

#### dl324

Joined Mar 30, 2015
11,593
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.
Your truth table has 20 rows, it should have 32.

Your Kmap has data in 16 cells; you should enter data from all rows.
And I am wrong from that sorry I was reading my first ec.
From the data in your Kmap, and the groupings, you can't get the answer you wrote down for K1.

Last edited:

#### Lepaletiux

Joined Mar 17, 2018
20
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?.

#### Attachments

• 264.9 KB Views: 9

#### dl324

Joined Mar 30, 2015
11,593
The teacher told me that my truth table should have just 20 rows as I have it. Is it wrong?
Either you misunderstood your teacher, or the teacher is wrong. With 5 variables, a fully populated truth table would have 32 rows:

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.