DSP48E2

Calculates a customizable arithmetic equation or logic operation on a DSP48E2 slice available on certain Xilinx FPGA targets.

Configure the node interface on the Item tab to customize the arithmetic equation or logic operation that the node executes at run time.

Note This help is not intended to provide an in-depth explanation of the DSP48E2 slice. NI recommends you become familiar with the 7 Series DSP48E2 Slice User Guide, available at www.xilinx.com, before using this node. This guide includes detailed information on the slice such as architectural details, timing considerations, and sample programs that help you program the slice effectively.
1378

Inputs/Outputs

datatype_icon

a

Value to use in an arithmetic calculation or logic operation on the slice.

Maintaining Fixed-point Numerical Precision

Fixed-point values do not adapt to controls and indicators with different data types. Instead, the program coerces the value, which results in reduced precision. To retain precision, wire a fixed-point value with a matching data type to the input or adjust the integer word length of the input.

datatype_icon

acin

Value of a cascaded from a previous DSP48 node to use in an arithmetic calculation or logic operation on the slice.

To display this input, click Change connector pane in the Item tab and select the acin option button on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Input Connection

This cascaded input only connects to the acout output of another DSP48 node.

datatype_icon

b

Value to use in an arithmetic calculation or logic operation on the slice.

Maintaining Fixed-point Numerical Precision

Fixed-point values do not adapt to controls and indicators with different data types. Instead, the program coerces the value, which results in reduced precision. To retain precision, wire a fixed-point value with a matching data type to the input or adjust the integer word length of the input.

datatype_icon

bcin

Value of b cascaded from a previous DSP48 node to use in an arithmetic calculation or logic operation on the slice.

To display this input, click Change connector pane in the Item tab and select the bcin option button on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Input Connection

This cascaded input only connects to the bcout output of another DSP48 node.

datatype_icon

c

Value to use in an arithmetic calculation or logic operation on the slice.

Maintaining Fixed-point Numerical Precision

Fixed-point values do not adapt to controls and indicators with different data types. Instead, the program coerces the value, which results in reduced precision. To retain precision, wire a fixed-point value with a matching data type to the input or adjust the integer word length of the input.

datatype_icon

inmode

Control bits that select the functionality of the pre-adder as well as a, b, d, and the input registers.

This input only appears when you choose Custom as the Calculation option on the Item tab.

Note National Instruments recommends that you refer to the Input Ports section of the appropriate DSP48 slice user guide for additional information about this terminal.
datatype_icon

pcin

Value of p cascaded from a previous DSP48 node to use in an arithmetic equation or logic operation on the slice.

To display this input, click Change connector pane in the Item tab and select the pcin checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Input Connection

This cascaded input only connects to the pcout output of another DSP48 node.

datatype_icon

carryin

Boolean value that represents the carry input from the FPGA logic.

True The external arithmetic operation carry input on the DSP48 slice is set to 1.
False The external arithmetic operation carry input on the DSP48 slice is set to 0.

To display this input, click Change connector pane in the Item tab and select the carryin checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Note National Instruments recommends that you refer to the Carry Input Logic section of the appropriate DSP48 slice user guide for additional information about this input.
datatype_icon

carrycascin

Boolean value that represents the cascaded carry input from a previous DSP48 node.

True The external arithmetic operation cascaded carry input on the DSP48 slice is set to 1.
False The external arithmetic operation cascaded carry input on the DSP48 slice is set to 0.

To display this input, click Change connector pane in the Item tab and select the carrycascin checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Note National Instruments recommends that you refer to the Carry Input Logic section of the appropriate DSP48 slice user guide for additional information about this input.

Cascaded Input Connection

This cascaded input only connects to the carrycascout output of another DSP48 node.

datatype_icon

multsignin

Boolean value that represents the sign of the multiplied result of a previous DSP48 node calculation.

True The multiplied result of the previous DSP48 node is negative, and the input on the DSP48 slice is set to 1.
False The multiplied result of the previous DSP48 node is positive, and the input on the DSP48 slice is set to 0.

To display this input, click Change connector pane in the Item tab and select the multsignin checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Input Connection

This cascaded input only connects to the multsignout output of another DSP48 node.

datatype_icon

alumode

Control bits that select the arithmetic equation or logic operation the slice evaluates.

This input only appears when you choose Custom as the Calculation option on the Item tab.

Note National Instruments recommends that you refer to the ALUMODE Inputs section of the appropriate DSP48 slice user guide for additional information about this input.
datatype_icon

opmode

Control bits that select the input to the X, Y, and Z multiplexers on the slice.

This input only appears when you choose Custom as the Calculation option on the Item tab.

Note National Instruments recommends that you refer to the X, Y, and Z Multiplexer section of the appropriate DSP48 slice user guide for additional information about this input.
datatype_icon

carryinsel

Control bits that select the carry source.

This input only appears when you choose Custom as the Calculation option on the Item tab.

Note National Instruments recommends that you refer to the Carry Input Logic section of the appropriate DSP48 slice user guide for additional information about this input.
datatype_icon

acout

Value of a to cascade to another DSP48 node.

To display this output, click Change connector pane in the Item tab and select the acout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Output Connection

This cascaded output only connects to the acin input of another DSP48 node.

datatype_icon

bcout

Value of b to cascade to another DSP48 node.

To display this output, click Change connector pane in the Item tab and select the bcout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Output Connection

This cascaded output only connects to the bcin input of another DSP48 node.

datatype_icon

p

Result of the operation executed by the slice.

Maintaining Fixed-point Numerical Precision

Fixed-point values do not adapt to controls and indicators with different data types. Instead, the program coerces the value, which results in reduced precision. To retain precision, wire a fixed-point value with a matching data type to the output or adjust the integer word length of the output.

datatype_icon

pcout

Value of p to cascade to another DSP48 node.

To display this output, click Change connector pane in the Item tab and select the pcout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Output Connection

This cascaded output only connects to the pcin input of another DSP48 node.

datatype_icon

carryout

4-bit carry output from the DSP48 slice.

To display this output, click Change connector pane in the Item tab and select the carryout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Note National Instruments recommends that you refer to the CARRYCASCOUT and CARRYOUT Ports section of the appropriate DSP48 slice user guide for additional information about this output.
datatype_icon

carrycascout

Boolean value that represents the control bit for the carry output to cascade to another DSP48 node.

True The external arithmetic operation cascaded carry output on the DSP48 slice is set to 1.
False The external arithmetic operation cascaded carry output on the DSP48 slice is set to 0.

To display this output, click Change connector pane in the Item tab and select the carrycascout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Note National Instruments recommends that you refer to the CARRYCASCOUT and CARRYOUT Ports section of the appropriate DSP48 slice user guide for additional information about this output.

Cascaded Output Connection

This cascaded output only connects to the carrycascin input of another DSP48 node.

datatype_icon

multsignout

Boolean value that represents the sign of the multiplied result to cascade to another DSP48 node.

True The multiplied result is negative, and the output on the DSP48 slice is set to 1.
False The multiplied result is positive, and the output on the DSP48 slice is set to 0.

To display this output, click Change connector pane in the Item tab and select the multsignout checkbox on the Terminals tab of the Configure DSP48 Connector Pane dialog box.

Cascaded Output Connection

This cascaded output only connects to the multsignin input of another DSP48 node.

Configuring the Node Interface

Choose one of the three Calculation options on the Item tab to determine how the node will operate at run time.

  • Arithmetic—Evaluate a specified mathematical equation at run time.

    Click Edit on the Item tab to select the values to use in the equation.

  • Logic—Evaluate a specified Boolean expression at run time.

    Click Edit on the Item tab to configure the Boolean expression.

  • Custom—Configure node functionality at run time by specifying the opmode, alumode, inmode, and carryinsel inputs on the diagram.

    The DSP48 node configures opmode, alumode, inmode, and carryinsel automatically when you select the Arithmetic or Logic calculation type. If the combination of opmode, alumode, inmode, and carryinsel input configurations is invalid, the program reports an error at run time that identifies the invalid combination of input values.

  • Configuring DSP48 Node Inputs and Outputs

    A DSP48 node has several optional inputs and outputs you can enable to customize the functionality of a DSP48 slice on the diagram. Enable optional node inputs and outputs to configure the values the node uses for the calculation it executes.

    Complete the following steps to choose the DSP48 node inputs and outputs to display on the diagram.

    1. On the diagram, select the DSP48 node you want to configure.
    2. Click the Change connector pane button on the Item tab.
    3. On the Terminals tab of the Configure DSP48 Connector Pane dialog box, select the inputs and outputs to display on the diagram and click OK.

    Retaining DSP48 Node Numeric Precision

    In order to retain numeric precision in your program, you must set the integer word length for the inputs in your calculation correctly. If you do not set the integer word length correctly, the result of the calculation may be incorrect.

    The word length of an input on a DSP48 node is a constant value that matches the bit width of the corresponding input on the DSP48 slice. Use the Fixed-point configuration tab of the Configure DSP48 Connector Pane dialog box to adjust the integer word length of an input or group of inputs on a DSP48 node.

    Note Subtract the integer word length from the total word length to calculate the fractional word length.

    The following table outlines the modifications you need to make to the data type of DSP48 node inputs in order to retain numeric precision for node arithmetic calculations.

    Node Input or Equation Configuration Requirements to Retain Numeric Precision Example

    a, b

    • The fractional word length of the input is greater than or equal to the fractional word length of the source.
    • The integer word length of the input is greater than or equal to the integer word length of the source.

    The data type of the source of b is I16 <1.15>. To meet the requirements to retain precision, set the integer word length of b to 3, 2, or 1.

    Multiplier (p = a * b)

    The fractional word length of p is equal to the sum of the fractional word lengths of a and b.

    • The data type of the source of a is I16 <1.15>.
    • The data type of the source of b is I16 <2.14>.

    The sum of the fractional word lengths is 29. In this situation, set the word lengths of a, b, and p accordingly:

    • Set the integer word length of a to 10.
    • Set the integer word length of b to 4.
    • Set the integer word length of p to 19.

    Accumulator (p = p + c)

    The fractional word length of p is equal to the fractional word length of c.

    The data type of the source of c is I16 <3.13>.

    Set the integer word length of p to 35.

    Common DSP48E2 Arithmetic Equation Configurations

    A DSP48 node carries out the following generic equation when you select Arithmetic from the Calculation drop-down menu on the Item tab.

    p = (+/Not z) +/- (x+y + carryin)

    z, x+y, and carryin are variables. You can assign these variables a constant value, the value of a node input, or the result of a computation. The sources available for carryin depend on the values you specify for z and x+y. Click the Edit button on the Item tab to configure the equation.

    When you select DSP48E1 from the Interface drop-down menu on the Item tab, a second equation solving for m appears in the Configure DSP48 dialog box. You can use the result of this equation as an input value for x+y in the calculation the node executes.

    By default, the DSP48E2 interface of a DSP48 node carries out the following equation.

    p = c + (m + carryin)

    m = a * b

    Note For all configurations that involve multipliers, you must set Logical unit mode to One 48-Bit.
    Arithmetic Operation Arithmetic Equation Configuration

    Multiply

    p = a*b+carryin 1378

    Multiply with Pre-Adder

    p = (d+a)*b+carryin 1378

    Multiply-accumulate

    p = p+(a*b+carryin) 1378

    Multiply-add

    p = c+ (a*b+carryin) 1378

    Multiply-subtract

    p = c-(a*b+carryin) 1378