Fixed-Point to Integer Cast Function

Scales the fixed-point input to produce an integer output. This function is the equivalent of an arithmetic shift of the input, constrained so that the least significant bit of the input becomes the least significant bit of the output.


icon

Inputs/Outputs

  • cunkn.png fixed-point

    fixed-point is the data you want to scale. fixed-point can be any fixed-point data type.

  • ii32.png integer

    integer is the input data scaled to the smallest compatible integer type that prevents overflow. This output discards the overflow status.

  • If fixed-point is a signed number, LabVIEW sign-extends the input data as necessary to ensure that the input and output data are always the same sign.

    Note The Fixed-Point to Integer Cast function combines elements of the Scale by Power of 2 function and the Type Cast function. The Fixed-Point to Integer Cast function performs an operation that reinterprets the bits, like a cast, but also implements an arithmetic shift with sign extension, similar to the Scale by Power of 2.

    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.

    The Fixed-Point functions do not support array inputs. However, you can pass array data to these functions element-by-element if you meet the following criteria:

    • You place the function inside a For Loop within a single-cycle Timed Loop
    • You enable auto-indexing on the For Loop tunnels
    • You use the function with other supported functions
    • You do not include shift registers or Feedback Nodes

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Numerics\Fixed-Point Cast.vi