Performs arithmetic on one or more numeric, array, cluster, or Boolean inputs. To select the operation (Add, Multiply, AND, OR, or XOR), right-click the function and select Change Mode from the shortcut menu. When you select this function from the Numeric palette, the default mode is Add. When you select this function from the Boolean palette, the default mode is OR.

The connector pane displays the default data types for this polymorphic function.


icon

Inputs/Outputs

  • cdbl.png value

    value 0..n-1 can be a number or Boolean value, an array of numbers or Boolean values, a cluster, array of clusters, and so on.

    You can wire a waveform to only one value input. If an input is a waveform, you can have an unlimited number of scalar inputs of varying sizes. If value is an error cluster, only the status parameter of the error cluster passes to the input terminal.

  • cdbl.png value

  • idbl.png result

    result returns the result of the selected operation applied to the value 0..n-1. For AND, OR, or XOR, result returns the bitwise operations on numeric inputs and logical operations on Boolean inputs.

  • Add inputs to the node by right-clicking an input and selecting Add Input from the shortcut menu or by resizing the function.

    You can invert the inputs or the output of this function by right-clicking the individual terminals and selecting Invert from the shortcut menu. For Add, select Invert to negate an input or the output. For Multiply, select Invert to use the reciprocal of an input or to produce the reciprocal of the output. For AND, OR, or XOR, select Invert to bitwise complement an integer input or output or to logically negate an input or output.

    When you use the Compound Arithmetic function to perform an XOR operation on 3 or more values, the Compound Arithmetic function performs an XOR operation on the first pair of inputs, then performs an XOR operation on the result of the first pair of inputs and the next input, and so on until all inputs have been processed.

    Note You cannot use this function with fixed-point numbers. If you wire fixed-point numbers to this function, the VI appears with a broken Run button.

    FPGA Module Details

    The following details apply when you use this object in an FPGA VI.

    Note The following details are subject to change with each version of the LabVIEW FPGA Module.
    Single-Cycle Timed Loop Supported.
    Usage

    If you use this function with the single-precision floating-point data type, refer to the Using the Single-Precision Floating-Point Data Type and Deciding Which Data Type to Use in FPGA Designs topics for resource use, latency, and single-cycle Timed Loop support implications.

    When used in an FPGA VI, the Compound Arithmetic function might return different results for floating-point operations, as this function executes operations in a different order than when used on a host computer.

    Timing When placed inside a single-cycle Timed Loop, the combinatorial logic delay is logarithmically proportional to the number of inputs.
    Resources This function consumes FPGA resources in proportion to the number of inputs, N. Each operation receives dedicated hardware and the total number of operations is always N - 1.