# Design Sequential Circuit Counter (Earn \$5)

Discussion in 'Homework Help' started by mitchmitch555, Mar 2, 2015.

1. ### mitchmitch555 Thread Starter New Member

Mar 2, 2015
5
0
Hello all, this is my first post on All About Circuits. I need some help understanding a project assigned in my computer architecture class. Successful help earns a \$5 tip through paypal.

The problem description: Design a sequential circuit with three flip-flops and one input x. When x = 0, count 0, 2, 3, 5, 6 and repeat. When x = 1, count 6, 5, 3, 2, 0 and repeat.

My problem is that I don't know how to turn this information into boolean expressions for each flip flop, which I can then turn into state diagrams and tables. I know how to write an expression once I have the circuit drawn out in front of me, but I don't understand flip-flops and counters well enough to move through this problem. Some guidance would be greatly appreciated as this problem is due in class tomorrow morning.

Thanks a lot, if you help me I'll pay you \$5 on paypal.

2. ### MrChips Moderator

Oct 2, 2009
12,624
3,451
Last edited: Mar 2, 2015
3. ### mitchmitch555 Thread Starter New Member

Mar 2, 2015
5
0
Thanks, I don't want my homework done for me. I needed guidance as my textbook didn't cover this type of problem and I couldn't find a solution on the internet. So thanks for the link, it's exactly what I needed.

4. ### WBahn Moderator

Mar 31, 2012
18,085
4,917
Huh? You don't want your homework done for you? Let's see. You don't show any work and you want to pay someone to design the circuit and draw it out for you because you couldn't find someone else's solution on the internet that you could copy. Yet you claim with a straight face that you don't want your homework done for you. That's rich.

5. ### mitchmitch555 Thread Starter New Member

Mar 2, 2015
5
0
Alright well thanks for the help guys

Mar 31, 2012
18,085
4,917

7. ### mitchmitch555 Thread Starter New Member

Mar 2, 2015
5
0
I really only needed a point in the right direction as far as teaching myself how to come up with a circuit based on that information, the article that Mr Chips linked me was exactly that. I really didn't want my homework done for me; I still have to take an exam over it. Sorry if I came off like an ignorant lazy student. I offered \$5 in hopes it would entice someone to answer me sooner rather than later. That's all.

8. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
You needn't offer money as incentive, most that would offer you help wouldn't be motivated any more by \$5.

Most of the regulars are here because they enjoy helping.

To get a quality reply, all you need is a problem statement, your work (however complete/correct), a decent title, and a little bit of patience.

9. ### mitchmitch555 Thread Starter New Member

Mar 2, 2015
5
0
I'm currently reading your Synchronous Counters article, tshuck. Extremely helpful. I now understand that I'm supposed to combine the three flip flops' outputs in order to get the "count" number, and that the output of a D flip flop is determined by the state of the D input at every positive edge of the clock update. However, I don't know how to control the output of a flip flop. To me it seems random based on the clock input. I don't understand the workings of the clock well enough to know what to do next so I can actually draw this circuit. My current "work" that I've completed is just converting the outputs I need to get from the flip flops to binary so I at least know what actual outputs I'm looking for.

10. ### tshuck Well-Known Member

Oct 18, 2012
3,531
675
I'm glad you found it useful. That article was intended to formalize what was already in the eBook for a basic synchronous counter. You have a little more complex circuit.

What you have is a finite state machine. Have you learned about them? If not, that's fine, this is a good bridge between counters and FSMs.

One major difference between the article and your design is that you have to have an input (x). To account for this, your state table must reflect the addition of the input.

This means that the part where we list the current state and next state, the input must be present. There are a few ways to do this, here's one:

You should have an extra column for the input, much like the following image from Georacer's article on Finite State Machines:
(disregard the output column)

Note on the image: The current state would be the two bits A and B, where I have listed them as their binary count value in the following table.

Then fill in the table for your design:
Current State Input (x) Next State
000 0 010 = 2
000 1 110 = 6
001 0 xxx = not valid state
001 1 xxx = not a valid state
010 0 011 = 3
010 1 000 = 0
... ... ...

This table captures the behavior of the counter, including the behavior as a result of x. Notice that a current count of 0 is listed twice - once when x=0 and again for when x=1.

Try to fill in the table on your own, here's the code for the table:
Code (Text):
1.
2. [Table=head] Current State | Input (x) | Next State
3. 000|0|010 = 2
4. 000|1|110 = 6
5. 001|0|xxx = not valid state
6. 001|1|xxx = not a valid state
7. 010|0|011 = 3
8. 010|1|000 = 0
9. ...|...|...
10. [/table]
11.
_____________________________
Another way to do this might be to count up and down 0-4 and map the count value to the appropriate output, e.g.:
Count => Mapped Output
0 => 0
1 => 2
2 => 3
3 => 5
4 => 6
Then you only have to worry about a mod-5 up/down counter.

Last edited: Mar 3, 2015