I need to implement a system for counting the number of one's and 0's in a bit stream. These will be made of two 4-bit counters one for the 1's and other for 0's. At each rising edge, the system checks the logic of bit stream and increments the counters according.
My simple ASM is attached. Is this the only way to implement this system using an ASM ? or is it possible to go deeper ?
I also need to convert the asm to a one flipflop per state. Will this result in two ring counters? If this is the case then it would need to load the first flip flop initially. The rest would be a 2-to-1 demux to select the clock path according to the input data stream. Any suggestions would be appreciated.