DSP48E2
- Updated2023-02-17
- 12 minute(s) read
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.

Inputs/Outputs

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.

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.

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.

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.

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.

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.

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.

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.

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.
Cascaded Input Connection
This cascaded input only connects to the carrycascout output of another DSP48 node.

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.

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.

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.

carryinsel
Control bits that select the carry source.
This input only appears when you choose Custom as the Calculation option on the Item tab.

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.

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.

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.

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.

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.

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.
Cascaded Output Connection
This cascaded output only connects to the carrycascin input of another DSP48 node.

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.
Click Edit on the Item tab to select the values to use in the equation.
Click Edit on the Item tab to configure the Boolean expression.
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.
- On the diagram, select the DSP48 node you want to configure.
- Click the Change connector pane button on the Item tab.
- 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.
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 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 sum of the fractional word lengths is 29. In this situation, set the word lengths of a, b, and p accordingly:
|
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
Arithmetic Operation | Arithmetic Equation | Configuration |
---|---|---|
Multiply |
p = a*b+carryin |
![]() |
Multiply with Pre-Adder |
p = (d+a)*b+carryin |
![]() |
Multiply-accumulate |
p = p+(a*b+carryin) |
![]() |
Multiply-add |
p = c+ (a*b+carryin) |
![]() |
Multiply-subtract |
p = c-(a*b+carryin) |
![]() |
In This Section
- Inputs/Outputs
- a
- Maintaining Fixed-point Numerical Precision
- acin
- Cascaded Input Connection
- b
- Maintaining Fixed-point Numerical Precision
- bcin
- Cascaded Input Connection
- c
- Maintaining Fixed-point Numerical Precision
- inmode
- pcin
- Cascaded Input Connection
- carryin
- carrycascin
- Cascaded Input Connection
- multsignin
- Cascaded Input Connection
- alumode
- opmode
- carryinsel
- acout
- Cascaded Output Connection
- bcout
- Cascaded Output Connection
- p
- Maintaining Fixed-point Numerical Precision
- pcout
- Cascaded Output Connection
- carryout
- carrycascout
- Cascaded Output Connection
- multsignout
- Cascaded Output Connection
- a
- Configuring the Node Interface
- Configuring DSP48 Node Inputs and Outputs
- Retaining DSP48 Node Numeric Precision
- Common DSP48E2 Arithmetic Equation Configurations