Operator SUB

Operator SUB calculates the difference between input link I1 and input link I2 i.e. O = I1 - I2

I/O Properties

Property Value
Operator Type O
Input Links I1, data input
I2, data input
Output Link O, data output

Supported Link Format

Link Parameter Input Link I1 Input Link I2 Output Link O
Bit Width [1, 62] unsigned, [2, 62] signed [1, 62] unsigned, [2, 62] signed auto1
Arithmetic {unsigned, signed} {unsigned, signed} signed
Parallelism any any as I1
Kernel Columns any any as I1
Kernel Rows any any as I1
Color Format VAF_GRAY VAF_GRAY as I1
Color Flavor FL_NONE FL_NONE as I1
Max. Img Width any any as I1
Max. Img Height any any as I1


The output bit width is automatically determined from the input link bit widths. The output bit width is determined by


Type static write parameter
Default AUTO
Range (AUTO, EmbeddedALU, LUT)

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

You can select one of the following values:

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

EmbeddedALU: The operator uses embedded arithmetic logic elements of the FPGA that are not LUT based.

LUT: The operator uses the LUT logic of the FPGA.

[Note] Use AUTO in General

Normally, the parameter should be set to AUTO. In special cases, i.e., if one kind of FPGA ressource runs short in a design, you can manually influence the FPGA resource management using the values EmbeddedALU and/or LUT.

Examples of Use

The use of operator SUB is shown in the following examples:

  • 'Histogram Threshold'

    Example - Histogram thresholding

  • 'Blob2D ROI Selection'

    Examples - The blob analysis operator is applied to an input camera image. The applet shows the usage of the blob data in the applet. In this case, the object with the maximum are is localized and the coordinates are used to cut out the object from the original image.

  • 'Motion Detection'

    Examples - Calculates the differences between two successive images. The differences are thresholded and output via DMA channel.

  • 'Moments in Image Processing'

    Example - Calculates image moments orientation and eccentricity

  • 'Line Mirror'

    Examples - Shows how to vertically mirror an image. Note the mirroring of the parallel words and the pixel.

  • 'Dead Pixel Replacement'

    Examples - The examples shows an automatic dead pixel detection and replacement.

  • '2D Shading Correction / Flat Field Correction'

    Examples - The example shows the implementation of a 2D shading correction. Correction values are stored in frame grabber RAM. The applet performs a high precision offset and gain correction.

  • '1D Shading Correction Using Block RAM'

    Examples - The example shows an 1D shading correction. The correction values are stored in block RAM memory.

  • '1D Shading Correction Using Frame Grabber RAM'

    Examples - The example shows an 1D shading correction. The correction values are stored in Frame Grabber RAM.