2
\$\begingroup\$

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:

enter image description here

Here's the state table:

enter image description here

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:

enter image description here

Kmaps using Logic Friday: enter image description here

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

enter image description here

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?

\$\endgroup\$
5
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Jan 6 at 16:03
  • \$\begingroup\$ Can you show us the 4 k-map minimizations and your final circuit solution? Also, what is 'Y' in your truth table? \$\endgroup\$
    – user350400
    Commented Jan 6 at 20:43
  • \$\begingroup\$ @user350400 the y is an output, it serves as a clock input for the second down timer to have two digit counting down \$\endgroup\$ Commented Jan 7 at 4:38
  • \$\begingroup\$ @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!) \$\endgroup\$ Commented Jan 7 at 5:24
  • \$\begingroup\$ @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 \$\endgroup\$ Commented Jan 23 at 3:23

1 Answer 1

0
\$\begingroup\$

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:

enter image description here

Then the Logic Friday table I prepared:

enter image description here

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;
QAD = QA';

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

enter image description here

Sincerely, best wishes. It's good to see your activities!

\$\endgroup\$
6
  • \$\begingroup\$ Yeah I didn't know there's a minimize function as i just recently installed it. Thank you so much for the help \$\endgroup\$ Commented Jan 7 at 5:59
  • \$\begingroup\$ @Noobielectrix It's fun to see ideas like these work so well also in practice. I used these ideas (not software, as they didn't exist then) when designing my first CPU a long time back. And if I hadn't? I probably would not have succeeded in the end. And that would have probably turned me away from the path I did follow. Life changing, I guess! \$\endgroup\$ Commented Jan 7 at 8:15
  • \$\begingroup\$ Hey.. i am trying to make this now in breadboard and i seem to have a problem in my display. The outputs of the jk flip flops are correct but I can't seem to drive it on an actual 7447 ic to a 7 segment display. It is stuck on display 0. And i have no idea how to fix this. Help \$\endgroup\$ Commented Jan 23 at 3:17
  • \$\begingroup\$ @Noobielectrix I've no idea, either. Probably will need to post up a question showing what you have. If the JK FF are all showing correctly, then there is something wrong with how you are connecting up/to the 7447 or to the 7-seg display. The 7447 is designed for common-anode 7-seg displays. So make sure that's right. There's also a blanking input, etc. Disconnect everything and directly set the inputs to the 7447 by hand. Technically, you should be able to figure out the right steps on your own here. But if you stay stuck on this, write it up and ask for help I think. \$\endgroup\$ Commented Jan 23 at 3:26
  • \$\begingroup\$ I observed that i have to switch the power off in order to update the display. I tried to input a 0001 and it just outputs 0 but when i turn it off and on it updated the display to 1. Any idea? \$\endgroup\$ Commented Jan 23 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.