Electrical – How to properly describe a Math Equation in Verilog to be synthesizable

fpgamathsynthesisverilog

I have not been able to find a book or information in internet, about the correct way to describe a Math Equation in Verilog.

With the correct way I mean for example, how to analyze the equation and to express it, Behavioral? Sequential? How to take advantage of the Non-blocking assignments, or if to avoid the blocking assignments. Create the basics operations in a different module and instantiate, as a task? or to create everything in one module?

I have not been able even to find an example in internet, arithmetic books limit themselves to the basic operations and fixed-floating point representations.

Let's say an equation like this: A = (B + 1) / C^(B-10.05)

MOREOVER, I sense like Verilog/VHDL was not designed to do this (this would explain the lack of information?), most of the books teach how to do registers, memories, latches, flip-flop, then state machines, THEN a full Microprocessor with instruction set and ALU.

Might I be wrongly focusing my vision of Arithmetic (equation implementation) in verilog? Is designing a Microprocessor a better aproach for this kind of equations?

Maybe you can adress me to a proper information to read?

Best Answer

There are often standard ip cores that can do floating point logic furnished by the manufacturer. For example, Altera have megafunctions that can do floating point operations, and pipelinable. See this document:

https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/ug/ug_altfp_mfug.pdf