13.07.2015 Views

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sequential PartsConfigurable Counter (cntr)active clk edge. If the value of the port is 0 (or the parameter is set to Down), the count isdownwards on an enabled active clk edge.The effect of counting upwards or downwards depends of the mode of counting (Binary,Johnson, LFSR or Onehot) as described in the sections for each style.The input ports rst and load have a higher priority than the port up_dn and the counter countsonly when the control ports rst and load are not active. The result is placed in the output portcount.If the counter is counting up and the enumerated parameter max_type is set to ActiveHigh, avalue of 1 is placed on the output port max if the counter value is equal to the value ofparameter max_count.If the counter is counting down and the enumerated parameter max_type is set to ActiveHigh, avalue of 1 is placed on the output port max if the counter value is equal to lowest possible value(all bits are o). In either case, if the enumerated parameter max_type is set to ActiveLow, a valueof 0 is placed on the output port max.Parameter sync_rst_priority has no effect when the rst_type is AsyncActiveHigh orAsyncActiveLow. When the value of rst_type is SyncActiveHigh or SyncActiveLow andsync_rst_priority is enabled, a synchronous reset will always reset synchronously regardless ofthe clock enable. When sync_rst_priority is disabled, the clock enable takes priority over thereset.The counter behavior, the maximum count and the reset value depends upon the value of theparameter style as explained in the following sections.Binary Counter (parameter style = Binary)In this style, the count is executed by increasing or decreasing the counter value by 1. Uponreset, the value of the parameter rst_val is placed in the counter.If the parameter max_count has a value of 0, the implied value used for maximum count is themaximum possible value (2 (width of output port count) - 1). This saves users from having tocalculate the maximum possible value but is only available for the binary style.For all other values of the parameter max_count, the implied value is exactly equal to its givenvalue.If the value of the input port up_dn is 1 (counting up), the counter counts until the implied valueof max_count and upon reaching this value it is set back to 0. If the value of the input portup_dn is 0 (counting down), the counter counts down to 0 and is set to the implied value of theparameter max_count.If a new value is loaded at any time (input port load = 1), the counter resumes counting fromthis new value.In the case of a up counter, if the loaded value is more than the value of the parametermax_count, the counter counts up until all bits are 1, wraps back to 0 and counts up until thevalue of the parameter max_count.<strong>ModuleWare</strong> <strong>Reference</strong> Manual, Library Version 1.9 179September 18, 2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!