# Making a 9-0 synchronous down counter using flip-flops

I've been trying to make a timer that starts from 0 then counts down at 9 to 0. I've been struggling to make it. I made state tables and diagrams and for the flipflops, but when implementing to a simulator, it just doesn't give me the output I want.

I've tried making the don't cares (10-15) as 0 but still doesn't work.

Here's the state diagram:

Here's the state table:

I followed the kmap results in the simulator but still can't get it to work.

Here's my state table for the JK flip-flop:

Kmaps using Logic Friday:

Simulation in Proteus, it counts down from 0 to 9 but gets stuck at 3 and 2 going back and forth:

I got it working thank you all. A lot of misinputs was present in making the state table.

Next is to make the 2nd digit in this count down I want it to start at 6 not 0, basically 6,5,4,3,2,1,0. I made the flip-flop state table and followed the similar process I used in the first digit.

But when simulating it, it starts at 0, 7, 6, ... I want it to start at 6. How can I do this?

• There is a discussion of something like this here. It counts up or down, though. It it looks like he did another one here that is just a down-counter, starting at 9 if I read it right. Commented Jan 6 at 16:03
• Can you show us the 4 k-map minimizations and your final circuit solution? Also, what is 'Y' in your truth table?
– user350400
Commented Jan 6 at 20:43
• @user350400 the y is an output, it serves as a clock input for the second down timer to have two digit counting down Commented Jan 7 at 4:38
• @Noobielectrix I've added an update to my answer. I think you missed out on using the minimize option that is available to you in Logic Friday. Hopefully, this helps. (I'll +1 your question with this additional added work product. Thanks!) Commented Jan 7 at 5:24
• @periblepsis hey, im trying to make this in breadboard. The outputs are correct and fine but I can't seem to drive it to the actual 7447 ic to 7 segment display it just stuck on display 0 and i have no idea how to fix this Commented Jan 23 at 3:23

### efforts noted

Your first post shows a lot of supplies, parts, and solderless breadboards in use. Your second post writes: "I am required to use sequential circuits and combinational circuits only for this project." This tells me you are involved in related classwork, so not only trying to build something but also studying how to design what you may later build. This latest question now extends on the prior two, showing you are trying to acquire a specific set of useful mental tools related directly to these kinds of activities. Looks like significant effort, to me.

(In the following, I'm borrowing table work from here to save time.)

### FF options

Unless homework specifically limits choices, please keep in mind there are at least these options for FFs:

$$\begin{array}{c|c|c} \text{Transition} & \text{JK FF} & \text{T FF} & \text{D FF}\\\hline {\begin{smallmatrix}\begin{array}{c} \text{start }\to\text{ end}\\\\ 0 \quad \to \quad 0\\ 1 \quad \to \quad 1\\ 0 \quad \to \quad 1\\ 1 \quad \to \quad 0 \end{array}\end{smallmatrix}} & {\begin{smallmatrix}\begin{array}{cc} J & K \\\\ 0&x\\ x&0\\ 1&x\\ x&1 \end{array}\end{smallmatrix}} & {\begin{smallmatrix}\begin{array}{c} T\\\\ 0\\ 0\\ 1\\ 1 \end{array}\end{smallmatrix}} & {\begin{smallmatrix}\begin{array}{c} D\\\\ 0\\ 1\\ 1\\ 0 \end{array}\end{smallmatrix}} \end{array}$$

The D column is obvious. Just present the next state you want before clocking. T FFs are readily made from JK types (just wire the J and K inputs together.) The JK often offers the least complicated surrounding combinatorial logic for desired state transitions. But not always. It doesn't hurt to keep all options on the table when using a simulator. Otherwise, obey physical reality (7400 family) or virtual reality (homework limits.)

### decade down-counter starting at 0

The table I see for this problem is:

$$\begin{array}{c|c} \text{States} & \text{FF Inputs}\\\hline\\ {\begin{smallmatrix}\begin{array}{cccc} Q_D & Q_C & Q_B & Q_A\\ \vphantom{\left.\overbrace{\begin{array}{ccc}J & K & T & D\end{array} } \right.}\\ 0&0&0&0\\ 1&0&0&1\\ 1&0&0&0\\ 0&1&1&1\\ 0&1&1&0\\ 0&1&0&1\\ 0&1&0&0\\ 0&0&1&1\\ 0&0&1&0\\ 0&0&0&1\\\\ 1&0&1&0\\ 1&0&1&1\\ 1&1&0&0\\ 1&1&0&1\\ 1&1&1&0\\ 1&1&1&1 \end{array}\end{smallmatrix}} & {\begin{smallmatrix}\begin{array}{cccc} Q_D & Q_C & Q_B & Q_A\\ \left.\overbrace{\begin{array}{cccc}J & K & T & D\\ 1&x&1&1\\ x&0&0&1\\ x&1&1&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x \end{array} } \right. & \left.\overbrace{\begin{array}{cccc}J & K & T & D\\ 0&x&0&0\\ 0&x&0&0\\ 1&x&1&1\\ x&0&0&1\\ x&0&0&1\\ x&0&0&1\\ x&1&1&0\\ 0&x&0&0\\ 0&x&0&0\\ 0&x&0&0\\\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x \end{array} } \right. & \left.\overbrace{\begin{array}{cccc}J & K & T & D\\ 0&x&0&0\\ 0&x&0&0\\ 1&x&1&1\\ x&0&0&1\\ x&1&1&0\\ 0&x&0&0\\ 1&x&1&1\\ x&0&0&1\\ x&1&1&0\\ 0&x&0&0\\\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x \end{array} } \right. & \left.\overbrace{\begin{array}{cccc}J & K & T & D\\ 1&x&1&1\\ x&1&1&0\\ 1&x&1&1\\ x&1&1&0\\ 1&x&1&1\\ x&1&1&0\\ 1&x&1&1\\ x&1&1&0\\ 1&x&1&1\\ x&1&1&0\\\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x\\ x&x&x&x \end{array} } \right. \end{array}\end{smallmatrix}} \end{array}$$

The above is offered by way of comparison with your own thoughts.

I'm not going to draw out the k-maps. You can take the above table and generate those, if you like. And it's good practice. However, you can also readily plug any part of the above information into Steve Rickman's Logic Friday program (the latest version I have is 1.1.4.) It will minimize the logical algebra. If you do your own k-maps, verifying your findings using Logic Friday makes sense.

What I see in your question right now doesn't show your simulation efforts. So I can't be more help, yet. If you decide to include more in your question, I may then know better how to offer further details.

### update

Now that you've added your work product, allow me to add mine for comparison, starting with the final result:

Then the Logic Friday table I prepared:

And finally the minimized output from Logic Friday:

Entered by truthtable:
QDJ = QD' QC' QB' QA';
QDK = QD QC' QB' QA';
QDT = QD' QC' QB' QA' + QD QC' QB' QA';
QDD = QD' QC' QB' QA' + QD QC' QB' QA;
QCJ = QD QC' QB' QA';
QCK = QD' QC QB' QA';
QCT = QD' QC QB' QA' + QD QC' QB' QA';
QCD = QD' QC QB' QA + QD' QC QB QA' + QD' QC QB QA + QD QC' QB' QA';
QBJ = QD' QC QB' QA' + QD QC' QB' QA';
QBK = QD' QC' QB QA' + QD' QC QB QA';
QBT = QD' QC' QB QA' + QD' QC QB' QA' + QD' QC QB QA' + QD QC' QB' QA';
QBD = QD' QC' QB QA + QD' QC QB' QA' + QD' QC QB QA + QD QC' QB' QA';
QAJ = 1;
QAK = 1;
QAT = 1;
QAD = QD' QC' QB' QA' + QD' QC' QB QA' + QD' QC QB' QA' + QD' QC QB QA' + QD QC' QB' QA';

Minimized:
QDJ = QC' QB' QA';
QDK = QA';
QDT = QC' QB' QA';
QDD = QD QA + QD' QC' QB' QA';
QCJ = QD QA';
QCK = QB' QA';
QCT = QD QA' + QC QB' QA';
QCD = QC QB  + QC QA + QD QA';
QBJ = QD QA' + QC QA';
QBK = QA';
QBT = QD QA' + QC QA' + QB QA';
QBD = QB QA + QD QA' + QC QB' QA';
QAJ = 1;
QAK = 1;
QAT = 1;

It looks to me as though you forgot to use Logic Friday's minimize option as shown below: