
22
Altera Corporation
Arithmetic Functions
Parameters
Name
Type
Required
Description
aset
Input
No
Asynchronous set input. Default = 0. Sets 
q[]
 outputs to all 1s, or to the value 
specified by 
LPM_AVALUE
. If both 
aset
 and 
aclr
 are used and both are 
asserted, 
aclr
 is dominant. For outputs such as 
q[]
 and 
eq[]
, 
aset
 affects 
the output before polarity is applied.
Asynchronous clear input. Default = 0. If both 
aset
 and 
aclr
 are used and 
both are asserted, 
aclr
 is dominant. For outputs such as 
q[]
 and 
eq[]
, 
aclr
 affects the output before polarity is applied.
Asynchronous load input. Asynchronously loads the counter with the value on 
the data input. Default = 0. If 
aload
 is used, 
data[]
 must be used.
This port is provided only for backwards-compatibility in MAX+PLUS II 
pre-version 6.0 designs. Altera does not recommend using this port in new 
designs.
Counter decode output. Active high when the counter reaches the specified 
count value. Either the 
q[]
 port or 
eq[]
 port must be connected. Up to c
eq
ports can be used (c
≤
 15). Only the 16 lowest count values are decoded. 
When the count value is c the 
eq
coutput is set high (1). For example, when 
the count is 0, 
eq
0 = 1, when the count is 1, 
eq
1 = 1, and when the count is 
15, 
eq
15 = 1. Decoded outputs for count values of 16 or greater require 
external decoding. The 
eq
coutputs are asynchronous.
Data output from the counter. This port is 
LPM_WIDTH
 wide. Either 
q[]
 or at 
least one of the 
eq[]
 ports must be connected.
aclr
Input
No
aload
Input
No
aconst
Input
No
eq[]
Output
No
q[]
Output
No
Name
Required
Value
Description
LPM_SVALUE
No
Integer 
≥
 0
Constant value that is loaded on the rising edge of clock when 
sset
 is high. Must be used if 
sset
 is used.
Constant value that is loaded when 
aset
 is high. This 
parameter must be used if 
aset
 is used. If the value specified 
is larger than the <modulus>, the behavior of the counter is an 
undefined logic level. The <modulus> is 
LPM_MODULUS
, if 
present, or 2
LPM_WIDTH
.
The maximum count, plus one. Number of unique states in the 
counter’s cycle. If the load value is larger than the 
LPM_MODULUS
 parameter, the behavior of the counter is not 
specified. The default value is 2
LPM_WIDTH
.
If the 
LPM_DIRECTION
 parameter is used, the 
updown
 port 
cannot be connected. When the 
updown
 port is not 
connected, the count direction is "
UP
". In all other cases, the 
default value is 
"DEFAULT"
.
Width of the input and output ports. If no output ports are 
specified, the value is the number of bits in the count.
LPM_AVALUE
No
Integer 
≥
 0
LPM_MODULUS
No
Integer > 1
LPM_DIRECTION
No
"UP"
"DOWN"
"DEFAULT"
LPM_WIDTH
Yes
Integer > 0
Ports (Part 2 of 2)