FPGARelated.com

Floating-Point (FPGA)

Category: Dsp-in-fpga | Also known as: floating point

Floating-point arithmetic in FPGAs refers to the implementation of IEEE 754 (or similar) floating-point operations — addition, multiplication, division, and transcendental functions — using configurable logic, dedicated DSP slices, or hard floating-point cores, rather than a general-purpose FPU. Because FPGA fabric does not provide a fixed CPU pipeline, floating-point datapaths implemented in fabric are built as pipelined hardware structures whose latency, throughput, and resource cost are determined at synthesis time.

In practice

Floating-point in FPGAs is most common in DSP-heavy applications — software-defined radio, radar, image processing, neural network inference, and scientific computing accelerators — where the dynamic range of IEEE 754 single-precision (32-bit) or double-precision (64-bit) simplifies algorithm development compared to fixed-point. Vendor IP cores such as Xilinx/AMD Floating-Point v7.1 or Intel/Altera's Altera FP Functions implement pipelined operators that can sustain one result per clock cycle after an initial latency of several cycles (typically 3 to 12 cycles for single-precision addition on mid-range devices).

Resource cost is the central tradeoff. For example, a single single-precision floating-point multiplier can consume 2 to 3 DSP48 slices and a non-trivial number of LUTs and FFs on some Xilinx 7-series or UltraScale devices, though the exact count varies with the specific core, configuration, and target device family. Double-precision operations typically cost more than single-precision — often more than 2× for operations such as division or transcendental functions — so resource requirements should be estimated from synthesis results rather than assumed from a fixed multiplier. This makes floating-point logic expensive relative to fixed-point equivalents, so many FPGA DSP designs start with floating-point for algorithm validation, then migrate to fixed-point for the production fabric implementation. The EmbeddedRelated posts "Dealing With Fixed Point Fractions" and "Computing Fixed-Point Square Roots and Their Reciprocals Using Goldschmidt Algorithm" illustrate the kind of reformulation that migration requires.

Some modern high-end FPGAs include hard floating-point blocks. Intel Stratix 10 and Agilex devices, among others, include hardened floating-point DSP blocks targeting IEEE 754 single-precision that deliver significantly higher throughput per watt than soft implementations, though exact capabilities and compliance details vary by family and generation. On devices without hard FP blocks, high-level synthesis (HLS) tools such as Vitis HLS or Intel HLS Compiler can automatically infer floating-point pipelines from C/C++ source, trading some control over latency and resource allocation for faster design iteration.

A practical pitfall is underestimating pipeline latency in feedback paths. A floating-point adder with a 10-cycle latency inside a feedback loop constrains the minimum initiation interval of the loop to 10 cycles, which can severely limit throughput if the loop structure is not redesigned or unrolled. Denormal number handling is another concern: many FPGA floating-point cores flush denormals to zero for resource efficiency, which is a common vendor optimization but is not fully IEEE 754-compliant in the strict sense, and can produce subtle divergences from software reference models that handle denormals fully.

 Learn this in FPGA Fundamentals

Discussed on FPGARelated

Frequently asked

Should I use floating-point or fixed-point for my FPGA DSP design?
It depends on the algorithm's dynamic range requirements and your resource budget. Floating-point is easier to develop and verify because it closely matches software models, but it consumes significantly more LUTs, FFs, and DSP slices. Fixed-point implementations are more resource-efficient and can run at higher clock rates, but require careful analysis of scaling, overflow, and quantization noise. A common workflow is to prototype in floating-point, verify correctness, then convert to fixed-point for the final fabric implementation. Posts such as 'Dealing With Fixed Point Fractions' and 'Polynomial Math' on EmbeddedRelated cover the techniques needed for that conversion.
What does 'pipelined' mean for a floating-point core, and why does it matter?
A pipelined floating-point core accepts a new input operand every clock cycle even though it takes multiple cycles (the latency) to produce each result. This gives high throughput for independent operations but creates a hazard in feedback loops: you cannot reuse the output of a computation as an input until the pipeline latency has elapsed. For a 10-cycle-latency adder in a loop, you either need 10 independent accumulations in flight simultaneously, or you accept a throughput penalty. Designing around pipeline latency is one of the more architecture-specific challenges of FPGA floating-point.
Do all FPGAs support IEEE 754 floating-point?
Any FPGA with sufficient logic resources can implement a soft IEEE 754 core, so in that sense the format is broadly supported. However, full IEEE 754 compliance — including correct rounding modes, exception flags, and denormal handling — is not guaranteed by all vendor IP cores. Many cores default to round-to-nearest-even and flush denormals to zero, which covers the vast majority of practical cases but can diverge from a fully compliant software reference. Hard floating-point blocks, present in devices such as Intel Stratix 10 and Agilex, offer higher performance and are designed to match IEEE 754 single-precision behavior more closely.
Can high-level synthesis tools handle floating-point automatically?
Yes. Tools such as Xilinx/AMD Vitis HLS and Intel HLS Compiler recognize float and double types in C/C++ source and map them to pipelined floating-point operator cores during synthesis. This makes it straightforward to port a software DSP algorithm to an FPGA accelerator without manually instantiating IP. The trade-off is that the tool controls pipeline scheduling and resource sharing, so hand-optimized RTL can still outperform HLS output in latency-critical or resource-constrained designs.
How does floating-point in an FPGA compare to using a soft-core CPU with an FPU?
A pipelined floating-point datapath in FPGA fabric can operate on multiple operations simultaneously and achieve one result per clock cycle per operator instance. A soft-core CPU (such as a MicroBlaze or Nios II with an optional FPU) executes floating-point instructions sequentially in an instruction pipeline, which serializes operations and limits throughput. For compute-intensive kernels with abundant data parallelism, a custom floating-point datapath in fabric typically delivers far higher throughput. For irregular control flow or general-purpose workloads, a soft CPU is simpler to program and maintain.

Differentiators vs similar concepts

Floating-point is often contrasted with fixed-point arithmetic. In fixed-point, the binary point is placed at a programmer-defined position and does not move; the representable range and precision are constant across all values, and overflow must be explicitly managed. In floating-point (IEEE 754), the binary point position is encoded in an exponent field, giving a wide dynamic range at the cost of variable precision and more complex hardware. In FPGA contexts, the distinction also has a resource dimension: fixed-point operations map efficiently onto DSP slice multiply-accumulate chains, while floating-point operations require additional exponent alignment, normalization, and rounding logic that consumes extra DSP slices and LUTs. The two are not mutually exclusive; many production FPGA designs use floating-point for stages where dynamic range is hard to predict and fixed-point for high-throughput stages where the signal statistics are well characterized.