Electronic – Easy resource to learn solving counter problems

counterdigital-logicflipflop

Could anybody please point me some direction on where I can learn to solve simple counter problems like counting in a given sequence using a given flip-flop? For example:

Create a counter counting in a sequence 3-1-4-7-2 and again from the
beginning using the D-type flip-flops

I'm not asking for help in this particular problem – rather, it'd be great to know how to solve this class of problems. I know how to design counters in a series to count from n to n+k or the reverse but how to do this thing?

Best Answer

Think of your special counter as a state machine. Then assign the state the coded value of the count sequence that you want. In this case the states would be as following with the next state showing.

State    Next State
  3  ->   1
  1  ->   4
  4  ->   7
  7  ->   2
  2  ->   3

Each state can be encoded into three binary bits so your design will require three D type flipflops. You need to make up a set of three karnough maps, one for each flipflop that, shows the next bit value for the flop flop (D input) based upon the three current state (Q outputs).

Use the k-maps to simplify the logic down to the minimal required. Finally you can code the minimal logic up in a series of AND gates driving OR gates into each FF D-input.

Here I show the k-map for the lowest ordered bit of the "counter" to get you started with the idea.

enter image description here

enter image description here