Table Of Contents

DSP48 (DSP48E) (Clock-Driven Logic)

Last Modified: August 7, 2018

Calculates a customizable arithmetic equation or logic operation on a DSP48E 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.

spd-note-note
Note  

This help is not intended to provide an in-depth explanation of the DSP48E slice. National Instruments recommends you become familiar with the Virtex-5 FPGA XtremeDSP Design Considerations User Guide, available at www.xilinx.com, before using this node. The guide includes detailed information about the slice such as architectural details, timing considerations, and sample programs that help you program the slice effectively.

connector_pane_image
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

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.

spd-note-note
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.

spd-note-note
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.

spd-note-note
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.

spd-note-note
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.

spd-note-note
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.

spd-note-note
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.

spd-note-note
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.

Customizing the Node Interface

Choose one of the three Calculation options on the Item tab to determine how the node operates 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, and carryinsel inputs on the diagram.

    The DSP48 node configures opmode, alumode, and carryinsel automatically when you select the Arithmetic or Logic calculation type. If the combination of opmode, alumode, 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.

spd-note-note
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 DSP48E 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.

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

p = c + (a * b + carryin)

spd-note-note
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

Multiply-accumulate

p = p+(a*b +carryin)

Multiply-add

p = c+(a*b +carryin)

Multiply-subtract

p = c-(a*b +carryin)

One-Step Counter

p = p+carryin

You need to enable the carryin input for this configuration. Wire a True constant to carryin and a value of 0 to a and b.

n-Step Counter/Accumulator

p = p+(c +carryin)

Wire a control to the c input for this configuration.

spd-note-note
Note  

c represents the number of steps for the counter. The function accumulates the value of c.

Where This Node Can Run:

Desktop OS: none

FPGA: All devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics