Operator DIV

Operator Library: Arithmetics

运算符 DIV 将输入链路 I1 的值除以输入链路 I2 的值。 在输出链路 O 上,提供除法的整数结果。 在输出链路 R 上,提供除法的余数。

两个输出端均未定义除以零的操作。

[注意] 资源

除法运算需要消耗大量的 FPGA 资源。在执行除法时,请尝试使用最小化的 Parallelism。 对于除以 2 的幂次值 (2^n) 的运算,请改用移位运算符 ShiftRight。

I/O Property

Property 值
Operator Type O
输入链路 I1,被除数 / 分子输入
I2,除数 / 分母输入
输出链路 O,整数商输出
R,余数输出

支持的 Link Format

Link Parameter 输入链路 I1 Input Link I2 Output Link O 输出链路 R
Bit Width [1, 64] [1, 64]1 auto2 与 I2 相同
Arithmetic {unsigned, signed} as I as I as I
Parallelism any as I as I as I
Kernel Columns any as I as I as I
Kernel Rows any as I as I as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I as I as I
Color Format VAF_GRAY as I as I as I
Color Flavor FL_NONE as I as I as I
Max. Img Width any as I as I as I
Max. Img Height any as I as I as I

1

输入 I2(除数)的 Bit Width 必须小于或等于链路 I1(被除数)处输入的 Bit Width。

2

对于无符号输入,输出 O 处的 Bit Width 等于 I1 处的 Bit Width。 对于有符号输入,Bit Width 等于 I1 处的 Bit Width + 1。

参数

无

使用示例

运算符 DIV 的使用方法如以下示例所示:

  • 'Blob2D ROI Selection'

    示例 - 将斑点分析算子应用于输入相机图像。 该小程序显示了小程序中斑点数据的使用情况。 在此情况下,定位具有最大面积的对象,并使用坐标从原始图像中 剪切出该对象。

  • 'Moments in Image Processing'

    Example - Calculates image moments orientation and eccentricity

  • “图像剪切 (Shear of an Image)”

    示例 - 带有线性插值的行剪切示例。

  • '激光三角测量'

    示例 - 一种 High Speed 且稳健的激光线检测算法。 该算法可确定重心坐标,以获得亚像素分辨率的结果。