Counter

Thread Starter

usernamexd

Joined May 21, 2020
5
Hello

I need help with counter scheme.
Counter count like that: 0 -> 1 -> 2 -> 3 -> 4 -> 1 -> 2 -> 4 -> 8 -> 4 -> 3 -> 2 -> 1 -> 0
Already I have this part: 0 -> 1 -> 2 -> 3 -> 4 and it's working, but I have no idea how to get next states....
Can someone help me ?counter.PNG
 

RBR1317

Joined Nov 13, 2010
714
3-count.png
Sometimes the "4" transitions to a "1", other times the "4" transitions to an "8", and still other times the "4" transitions to a "3". How will the counter keep track of what to do with the "4"?
 

WBahn

Joined Mar 31, 2012
30,062
View attachment 207741
Sometimes the "4" transitions to a "1", other times the "4" transitions to an "8", and still other times the "4" transitions to a "3". How will the counter keep track of what to do with the "4"?
The same is true with most of the other outputs. That's why it's important to recognize the number of states in the sequence of outputs, not the number of different outputs.
 

Thread Starter

usernamexd

Joined May 21, 2020
5
Thanks for all of your replies.
I did some research and I think it should be synchronous counter.
This table show how it should work.
1590080954129.png
Outputs: S0 to S4
 

WBahn

Joined Mar 31, 2012
30,062
So if you are in State [0][0][1][0], what state do you go to next?

Remember, a counter ONLY knows what state it is currently in. It has no other record of it's history. So it has to be able to decide what state to go to next based ONLY on what state it is currently in.

Leaving that aside, look at your table closely. Does it really represent either the sequence you are supposed to do (what what contained in your original post) or the encoding of each value that you intended?
 

Thread Starter

usernamexd

Joined May 21, 2020
5
So table represents sequences.
I have to make synchronus counter from 4 j-k flip-flops and some logic gates. This counter has 3 states of work. And I don't know how to set circuit properly to this table;/
 

dl324

Joined Mar 30, 2015
16,923
I have to make synchronus counter from 4 j-k flip-flops and some logic gates. This counter has 3 states of work. And I don't know how to set circuit properly to this table
Are you supposed to display the sequence on discrete LEDs? Or on a seven segment display?

Things might be clearer for us if you posted the entire text of the problem.
 

WBahn

Joined Mar 31, 2012
30,062
So table represents sequences.
I have to make synchronus counter from 4 j-k flip-flops and some logic gates. This counter has 3 states of work. And I don't know how to set circuit properly to this table;/
How do you arrive at "3 states of work"? What are those states?

If you have to make a synchronous counter, then why does your original post show an asynchronous counter?

Please post the entire text of the actual problem so that we know what you are trying to achieve.
 

Analog Ground

Joined Apr 24, 2019
460
Your problem is difficult if you do not know the formal techniques involved in creating "state machines" or "custom counters". Do you know the basics of the following logic design topics?
1. Flip Flop excitation tables. In particular, a JKFF or DFF.
2. Showing "present state" and "next state" information for a state machine in a truth table. (See Post #2)
3. Using Karnaugh maps derived from the truth table and the FF excitation tables to perform logic minimization.
4. Using the results of the Karnaugh maps to produce a circuit using logic gates.
Given your problem, I would think these would be topics taught in your class. It is possible to design a solution through trial and error and inspection but knowing the logic topics in my list is much, much better and will get you a better grade.
 

Analog Ground

Joined Apr 24, 2019
460
Only one what? Design option using four flip flops? If I'm counting right, I get about 3.5 trillion design options.
Not the detailed design, the general architecture. For example, the outputs could not directly be the flip-flop outputs. The FF outputs would have to be decoded to produce the count outputs. If more than four FFs, the outputs could be directly from the FFs. That kind of thing. Or, for example, the approach suggested in Post #14 would not work. That kind of thing. I hope this clarifies my assertion. Any more detail and I am giving away the answer to the OP.
 
Top