# Counter Flip Flop D no sequence

I have the sequence: 0-3-1-2-3-1. Making the table for this.

|Present state | Next state | D1| D0 |

| 0 0 | 1 1 | 1 | 1 |

| 0 1 | 1 0 | 1 | 0 |

| 1 0 | 1 1 | 1 | 1 |

| 0 1 | 0 1 | 0 | 1 |

In kmap i get : D0 = ~Q1 + Q0.

D1 = ~Q0 + ~Q1.

But, my sequence is incorrect when I set up the circuit. What was my mistake? Thank you in advance.

*I don't know if I was clear on the issue, but the image of the sequence

• Your sequence repeats every six elements, but you only have four states. You'll need to actually have six states, that are mapped to the outputs 0, 3, 1, 2, 3, 1 with some logic function. Otherwise, there's no way, based on the current state alone, to tell apart the 1->0 and 1->2 transitions that occur after the third and sixth states, if your states are just the 0,1,2,3. – nanofarad Dec 28 '20 at 21:06
• Do I need to add two more mappings to my table? Excuse me for my confusion. Did not quite understand. – tyler Dec 28 '20 at 21:22
• You'd need at least six states, with three flip-flops (which can represent up to eight states). One example mapping would be to count 0,3,1,6,7,5, and output only the two lowest bits of the state as the result; another would be to count 0,1,2,3,4,5 and have combinational logic that translates the state to the values 0,3,1,2,3,1. – nanofarad Dec 28 '20 at 21:27
• Thanks. I'm still a little confused as to how to work with the 6 states, but it's something to start thinking about. – tyler Dec 28 '20 at 21:40
• Same way -- you'd kmap them in a 4x2 kmap, and you'd need three state variables. – nanofarad Dec 28 '20 at 21:46

Your last present state in the table should be 11 not 01.

That makes

D0 = ~Qo + Q1

• I actually missed the last value in the table present state, but do you talk about D1 and D0 that should be 11? – tyler Dec 28 '20 at 23:09
• I was confused how to get that answer – tyler Dec 28 '20 at 23:21
• Please don't give out solutions to obvious homework problems. Pointing out an error is one thing, but working out the equation for the OP is further than I would like to go. – Elliot Alderson Dec 28 '20 at 23:22
• I redid the kmap and understood my mistake. Thanks – tyler Dec 28 '20 at 23:50