Electronic – Design a 4-bit synchronous counter using D filp-flops and 16 x 4 ROM that can generated any arbitrary counting sequence

counterflipfloprom;synchronous

What are the restrictions on the counting sequence? Give the ROM contents for the following sequences: a) 12, 13, 14, 15, 5, 6, 7, 0, 1, 2, 3, 4, 11, 10, 9, 8, 12, 13, etc…
b)8, 9, 0, 1, 8, 9, etc…

This is the question of a sample exam, I have no problem designing a n-bit synchronous counter using any type of flip-flop. My doubts are about the ROM part, on the book I have no example of how to implement a ROM to a counter, can you tell me the step to do it?
and I don't get the question of the restrictions of the sequences, do they refer to the pattern (i don't see it) or what do they mean?
My last question would be, do I need to design two 4-bit counters?, one for each sequence?

Thanks a lot

Best Answer

A counter is just a state machine that advances from one state to the next on each clock edge. Normally, you use logic to determine the next state from the current state to create, for example, binary counters, BCD counters or Gray-code counters.

But there's no reason that the next-state logic couldn't be replaced by a ROM. The ROM would be addressed by the state flip-flops, and the output of the ROM would be the next state of the flip-flops. This allows you to create a sequence of states of any length, up to 2N, where N is the number of flip-flops. The states can occur in any order, as long as each state has a unique next state.