contents.gifindex.gif

@Carry - Maximum Bit-width for Arithmetic Functions

Syntax

@Carry expression ;

expression - A numeric expression

Use

The @CARRY directive allows you to specify how adders, counters and comparators are generated to reduce the amount of logic required for processing large arithmetic functions. The number generated by the expression indicates the maximum bit-width to use when performing arithmetic functions.

For example, for an 8-bit adder, a @CARRY statement with an expression which results in 2 would divide the 8-bit adder into four 2-bit adders, creating intermediate nodes. This would reduce the amount of logic generated.

The statement:

@CARRY 1;

generates chains of one-bit adders and comparators for all subsequent adder and comparator equations, instead of the full look-ahead carry equations normally generated.

This directive automatically generates additional combinational nodes. Typically, carry chain lengths of 3 or 4 (@carry 3 or @carry 4) is a good trade off between speed and density for Xilinx devices. To specify that full lookahead carry should be generated (the default if no @CARRY has been specified) use the statement:

@CARRY 0;

Example

@carry 2; "generate adder chain
[s8..s0] = [.x.,a7..a0]+[.x.,b7..b0]


See Also

= (Constant Declarations)

Special Constants