Operator SUB

Operator Library: Arithmetics

运算符 SUB 用于计算输入链路 I1 与输入链路 I2 之间的差值,即 O = I1 - I2。

I/O Property

Property 值
Operator Type O
输入链路 I1,数据输入
I2,数据输入
Output Link O,数据输出

支持的 Link Format

Link Parameter 输入链路 I1 Input Link I2 Output Link O
Bit Width [1, 62] 无符号,[2, 62] 有符号 [1, 62] 无符号,[2, 62] 有符号 auto1
Arithmetic {unsigned, signed} {unsigned, signed} signed
Parallelism any 与 I1 相同 与 I1 相同
Kernel Columns any 与 I1 相同 与 I1 相同
Kernel Rows any 与 I1 相同 与 I1 相同
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} 与 I1 相同
Color Format VAF_GRAY VAF_GRAY 与 I1 相同
Color Flavor FL_NONE FL_NONE 与 I1 相同
Max. Img Width any 与 I1 相同 与 I1 相同
Max. Img Height any 与 I1 相同 与 I1 相同

1

输出 Bit Width 会根据输入链路的 Bit Width 自动确定。 输出 Bit Width 由以下因素决定

参数

ImplementationType
键入 静态写参数
默认 AUTO
范围 (AUTO, EmbeddedALU, LUT)

Parameter ImplementationType influences the implementation strategy of the operator, i.e., which logic elements are used for implementing the operator.

您可以选择以下值之一:

AUTO: When the operator is instantiated, the optimal implementation strategy is selected automatically based on the parametrization of the connected links.

EmbeddedALU: 算子使用 FPGA 的嵌入式算术逻辑元件,这些元件不是基于 LUT 的。

LUT: 算子使用 FPGA 的 LUT 逻辑。

[注意] 通常情况下使用 AUTO

通常,该参数应设置为 AUTO。在特殊情况下,例如设计中的某类 FPGA 资源不足时,您可以使用 EmbeddedALU 和/或 LUT 手动干预 FPGA 资源管理。

使用示例

以下示例展示了运算符 SUB 的用法: