06-18-2010 04:31 PM
I am trying to implement a 48-bit counter using DSP48E slice. My counter currently starts counting from zero. However, I want it to count from some other non-zero value. I couldn't find an attribute which could achieve this. I also wanted the counter to stop counting after a particular value and stay at that value till it gets reset (after the reset, it should again count from the non-zero value). Is it possible to achieve this using DSP48E slices only?
Kumar Vijay Mishra.
06-19-2010 12:48 PM
Take a look at the Counter example and pattern detect in UG193: http://www.xilinx.com/support/documentation/user_g
You start with this simple equation P=P+C+CIN, you can create many different logic by changing the inputs:
To count from an initial value, first you reset the DSP48, then for the first cycle you set C=initial value, CIN=1, you then set C=0 and CIN=1 afterwards. To stop counting, you set C=0 and CIN=0.