|
4.3.5 LPM_COUNTER |
Copyright © 1998 University of Manchester |
Ports
Description | Comments | |||
Parallel Data load for the counter | Vector, LPM_Width wide
Uses Aload and/or Sload | |||
Positive Edge Triggered | ||||
Enable all synchronous activities | Default is enabled (1) | |||
Disables count when low (0) (without affecting Sload, Sset, Sclr) | Default is enabled (1) | |||
Controls direction of count
High = 1 = count up Low = 0 = count down | Default is Up (1) | |||
Counter decode outputs. Active high when at the specified count | Note 3 | |||
Count output. | Vector, LPM_Width wide | |||
Load the counter with Data on the next clock. | Note 4 | |||
Set counter value to all 1's or to the value of LPM_Svalue, if present | Note 5, Note 6 | |||
Clear the counter (set to all 0's) | Note 6 | |||
Load the counter with Data. | Note 4 | |||
Set counter value to all 1's or to the value of LPM_Avalue, if present. | Note 5, Note 6 | |||
Clear the counter (set to all 0's) | Note 6 | |||
Test clock enable input | ||||
Serial test data input | ||||
Serial test data output | TestOut = QLPM_Width-1 |
Note 1: If the LPM_Direction property is used, then the UpDown port cannot be connected. If the LPM_Direction property is not used, then the UpDown port is optional.
Note 2: Either Q or at least one of the Eq ports must be connected.
Note 3: Since the counter goes through C counts where 0 < = C < Modulus, up to Modulus EqC ports can be used. Modulus is either the value specified by LPM_Modulus if present, or 2LPM_Width. The EqC ports are optional; not all of the EqC ports need to appear on the symbol. Generally there will only be one Eq port which will be EqLPM_Modulus-1 which is the terminal count.. The EqC outputs are asynchronous. For any count, EqC goes high when the count is C.
Note 4: If Aload and/or Sload are used, then the Data port must be connected.
Note 5: Sset and Aset will set the count to the value of LPM_Svalue or LPM_Avalue respectively, if those values are present. If no LPM_Svalue is specified, then Sset will set the count to all ones, likewise Aset.
Note 6: For outputs such as Q and EqC on the LPM_COUNTER, Aset, Aclr, Sset and Sclr affect the output before polarity is applied.
Note 7: Either all of the Test ports must be connected or none of them.
Properties
Value | Comments | ||
LPM Value > 0 | Width of input and output vectors. If no output vectors are specified, then this is the number of bits in the count. | ||
LPM Value > 0 | The maximum count. plus one | ||
UP | DOWN | Note 1 | ||
LPM Value | Loaded when Aset is active (1) Note 2 | ||
LPM Value | Loaded when Sset is active (1) Note 2 | ||
LPM Value | Loaded at power on. Note 2 |
Note 1: If the LPM_Direction property is used, then the UpDown port cannot be connected. This property allows implementation of a Down counter as the default when the UpDown port is not connected.
Note 2: If the value specified is larger than the Modulus, then the behavior of the counter is UNDEFINED. The Modulus is the LPM_Modulus, if present, or else 2LPM_Width .
The LPM_Counter defaults to an unsigned binary counter. The LPM_Hint property can be used to suggest an implementation style other than unsigned binary.
It is suggested, but not required, that all of the following styles be supported in the fitting tool and in simulation.
Unsigned binary | Signed Binary | BCD |
standard Gray Code | Johnson | LFSR |
Functions
|
|
|
| Output | |||
Asynchronous value.
Note 1 | |||||||
Synchronous value
Note 2 | |||||||
No change | |||||||
UNDEFINED | |||||||
No change | |||||||
Previous output + 1 | |||||||
Previous output - 1 | |||||||
Note 3 | |||||||
Qi is shifted into Qi+1
TestIn is loaded into Q0 |
Note 1: The asynchronous value is determined by which asynchronous port is high: Aclr, Aset or Aload. If Aclr and Aset are both high, then the output is UNDEFINED. Aclr or Aset takes priority over Aload. Asynchronous controls have priority over synchronous controls. If the LPM_Avalue property is defined, then the Aset port, when active, will set the count to the value of the LPM_Avalue..
Note 2: The synchronous value is determined by which synchronous port is high: Sclr, Sset or Sload. If more then one synchronous port is high, then Sclr takes priority over Sset which takes priority over Sload. Asynchronous controls have priority over synchronous controls. If the LPM_Svalue property is defined, then the Sset port, when active, will set the count to the value of the LPM_Svalue..
Note 3: If the UpDown port is not connected, then the LPM_Direction property, if present, will determine the direction of the count. The LPM_Direction property defaults to UP. The UpDown and the LPM_Direction property are mutually exclusive; if one is used, then using the other is an ERROR.