6

I know now a days FPGAs have very good floating point performance as reported here for example . But then why it is said that Floating point is non-synthesizable in verilog? How FPGA handles float then?

gpuguy
  • 1,618
  • 8
  • 31
  • 54
  • 1
    Where is it said that floating point is non-synthesizable in verilog? – Samuel Oct 18 '13 at 06:03
  • for example [here](http://www.asic-world.com/verilog/synthesis2.html). They are calling it real. I thing real and float are same. Am I right ? – gpuguy Oct 18 '13 at 06:08
  • 2
    Real and float are not the same. Reals are, well, real numbers while floating point cannot represent any number like a real can. The answer by apalopohapa explains how to synthesize floating point. – Samuel Oct 18 '13 at 06:45

2 Answers2

12

It is not that they can't be synthesized (they can, of course!), but tools won't do it combinationally (like they would a fixed point adder) because the resource usage would be unfeasibly large. So it is done sequentially in multiple steps, and there are many, many ways of doing it with several trade-offs to consider, with division being quite complex. So your floating point operation needs to be treated like any other module, you can design it yourself or license it from a vendor, and a tool won't synthesize c = a/b for you, for the same reasons it won't synthesize an integral or an equation solver, but it doesn't mean it can't be done in an FPGA!

apalopohapa
  • 8,419
  • 2
  • 29
  • 39
  • +1, so you mean the tools only synthesize premitive operations which are easy to optimize? And any complex stuff lkie 3.88 X 89.9898 should be implemented by the designer himself? – gpuguy Oct 18 '13 at 06:28
  • See the Xilinx [Floating-Point](http://www.xilinx.com/products/intellectual-property/FLOATING_PT.htm) IP core or the [Divider](http://www.xilinx.com/products/intellectual-property/Divider.htm). These assist you with implementation but are licensed cores. Also note that modern FPGAs with embedded DSP blocks (e.g. the [DSP48A1](http://www.xilinx.com/support/documentation/user_guides/ug389.pdf)) can assist with some math operations. – David Oct 18 '13 at 06:44
2

I know you asked about Verilog, but as an adjunct to apalopohapa's answer, VHDL has a synthesisable floating point library, which does not require instantiation of modules to perform floating-point operations, merely the use of ordinary function calls.

Other than the elegant use of VHDL's bit numbering to separate the exponent and significand, I don't think there's anything to stop someone writing a similar set of functions for Verilog to give the same capability.

Martin Thompson
  • 8,439
  • 1
  • 23
  • 44