12-12-2017 02:55 PM
Hi I want to design a multi channel counting module with individual binary pulse inputs. Is this possible by using generate statement? Or is there anyother method instead of replicating the same counter? If any of these is possible could you please give me an example for clarifying?
p.s The total number will be something like 50 individual counter all have specific inputs and outputs.
Thanks in advance and best wishes :)
12-12-2017 03:32 PM
A "generate" loop is a fine solution for what you're trying to do.
There's many examples out there - both on these forums, and on the net in general. Give it a shot, and let us know if you're having trouble.
12-13-2017 04:50 AM
Dear @markcurry thank you for the answer.
For sure I did make search on the web. Most of the examples based on a half adder design using a d flip-flop and I didn't understand very well how individual inputs gets in and individual outputs goes out. But anyway I'll search again since you also stated that this is the correct way. Later on when I get it I'll write here!
12-14-2017 03:07 AM
just a little hint:
Use your generate_loop value for indexing the inputs and outputs of each counter instance.
This requires I/Os of a type that can be indexed. (e.g. std_logic_vectors or arrays of some kind.)
Have a nice synthesis
12-14-2017 04:27 AM
Another tip is to draw a block diagram of what a single counter would look like, especially with regards to input size, output size, counter size.
Will all counters run from the same clock? Will all counters be (potentially) enabled at the same time? Will counters roll over when/if they reach their respective max count?
I'm slightly curious as to what you are doing that requires you to produce 50 separate counters .. ? In my mind there must be potential to optimise this, even at the design stage.