NI Tutorial 7781 En

2

Click here to load reader

description

n

Transcript of NI Tutorial 7781 En

  • 1/2 www.ni.com

    1. 2. 3.

    Fixed-Point Math Library for LabVIEW FPGAPublish Date: May 02, 2012

    Overview

    The Fixed-Point math Library contains LabVIEW FPGA IP blocks that implement a variety of elementaryand transcendental math functions. These functions use the Fixed-point data type introduced in LabVIEW8.5 extending the current offering of functions to include Divide, Sine, Cosine, and many more importantmath operations. All functions are verified for usage inside and outside a Single-Cycle Timed Loop as wellas in Windows and FPGA simulation on the Development computer. The toolkit comes with helpdocumentation that includes details for each function to learn more about individual usage. Users of LabVIEWImportant Note:2009 or newer should not need this library; The added to the FPGA palette in LabVIEW 2009High Throughput Math Functionsare, in fact, the same functions provided in this library after having been fully tested and documented by National Instruments.

    Table of Contents

    DownloadsIncluded Fixed-Point Math VIsDifferences between Fixed-Point Math Library and FPGA palette IP

    1. Downloads

    LabVIEW 2009 - This IP set is now in LabVIEW FPGA under the High-Throughput Math PaletteLabVIEW 8.6 Fixed Point Math Library - (4.8 MB) (1.1 MB) Version 8.6 User's GuideLabVIEW 8.5 Fixed Point Math Library - (28.6 MB) Version 8.52. Included Fixed-Point Math VIs

    AddSubtractMultiplyDivideReciprocalSquare RootSineCosineArctangent2Polar To RectangularRectangular To PolarHyperbolic SineHyperbolic CosineExponentialNatural LogarithmAddSubDiscrete delayInteger accumulatorTo Fixed-Point Conversion

    3. Differences between Fixed-Point Math Library and FPGA palette IP

    Not Always Exactly Like LabVIEW Counterpart - The main difference between the IP in the FXP Math Library and the FPGApalette IP is that it does not always give the same behavior as the same function in LabVIEW for a PC. Careful consideration isgiven to the IP in the FPGA palettes to make sure that the experience is unchanged between particular functions on multipleplatforms. However, for some corner cases or input parameters, outputs from the Fixed-Point Math Library can be undefined orunexpected. The library IP also does not support the overflow bit handling introduced in LabVIEW 8.6. In some cases, thesedecisions were made to streamline the IP to use less resources. Nevertheless, it means that more of the burden of complexity andtesting is placed on the user. These corner cases are described in the help documentation for the particular function. Additional Math Functions - The Fixed-Point Math Library currently has a number of functions not present in the LabVIEW FPGApalettes today, such as trig, log, and rectangular/polar transformations. Single-Cycle Loop Compatibility - Each of the math library IP blocks can be configured to work in a Single-Cycle Loop.However, you must deal with the boolean handshaking protocol, which adds some complexity in programming. Basically, thefunctions do not give valid results every iteration of the loop and users must handle this when passing data to the next function.This is very similar to the protocol currently used by windowing and FFT in the single-cycle loop.

    Configurable Pipeline Stages - Many of the functions have configurable pipeline stage within the IP configuration panel. This

  • 2/2 www.ni.com

    Configurable Pipeline Stages - Many of the functions have configurable pipeline stage within the IP configuration panel. Thisallows the IP to meet timing at a higher throughput rates at the expense of adding extra clock cycles to the latency of the system.To learn more about the concept of pipelining refer to the help topic about optimizing for size and speed in the LabVIEW FPGAdocumentation.Labeled Terminals - One helpful aspect of the Fixed-Point Library is that the inputs and outputs are labeled with the configured bitwidth. This is nice as your code gets larger to easily see how the bit widths are growing and contracting through yourprogram. Remember you can use Context Help to quickly see the bit width configured for a particular wire when usingfunctions without labels.