Counting 1's and 0's

Status
Not open for further replies.

jonnybgood

Full Member level 4
Joined
Dec 28, 2010
Messages
214
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Activity points
3,011
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.
 

Attachments

  • counters_asm.png
    29.1 KB · Views: 67

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…