synthesizing

E

ECS.MSc.SOC

Guest
Hi all

I want to calculate a simple formula, including multiply and division
operands. I use Verilog language to program FPGA.

Can I use the sign of Multiplication (*) and Division (/)? Or I have
to write the code of a Multiplication algorithm like Booth?

Regards
 
On 7/25/2011 9:37 AM, ECS.MSc.SOC wrote:
Hi all

I want to calculate a simple formula, including multiply and division
operands. I use Verilog language to program FPGA.

Can I use the sign of Multiplication (*) and Division (/)? Or I have
to write the code of a Multiplication algorithm like Booth?

Regards
That depends on whether you expect the math to be done in the hardware
or at compile time. If it's the latter, you can do whatever you'd like.
If the former, then it'll depend. Most FPGA families have multiplers
and the tools are smart enough to use those multipliers to perform a
multiply when you specify one.

Divides (by other than a power of 2) are a pain, and always require
serial algorithms to do them. You'd be well served trying to replace
that divide with a reciprocal multiply if possible.

--
Rob Gaddi, Highland Technology
Email address is currently out of order
 
"ECS.MSc.SOC" <mahdiyar.sarayloo@gmail.com> wrote:

Hi all

I want to calculate a simple formula, including multiply and division
operands. I use Verilog language to program FPGA.

Can I use the sign of Multiplication (*) and Division (/)? Or I have
to write the code of a Multiplication algorithm like Booth?
That depend on the synthesis tools. I guess with most modern tools you
can use the * and / sign. How it gets mapped to the hardware depends
on the target. You really should consult the manual of the synthesis
tool on how this is handled.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------
 
On Mon, 25 Jul 2011 09:37:22 -0700, ECS.MSc.SOC wrote:

Hi all

I want to calculate a simple formula, including multiply and division
operands. I use Verilog language to program FPGA.

Can I use the sign of Multiplication (*) and Division (/)? Or I have to
write the code of a Multiplication algorithm like Booth?
If you can stand the repetition: it depends on your tools, and what
you're trying to do.

If you're multiplying integers then most tools will see a '*' and map it
to a hardware multiplier (or synthesize one). I wouldn't trust a
synthesizer to know how to do a fixed-point multiply that wasn't integer,
although I would give it a whirl and see what happened. Divide is so
resource hungry that there are a tremendous number of system-level
decisions to be made in implementing it: I would be astonished at a
synthesizer that would see a '/' and automagically map it to some sort of
a divide.

You need to read up on the algorithms in question to see why divide is so
different from multiply, and to get an idea of what you might have to do
to make it work. (Although I expect that most FPGA manufacturers and/or
tool chain vendors will have some sort of divide primitive wizard that
you can at least use for the bit-slice portion, even if you have to wrap
it with your own sequencing logic).

--
www.wescottdesign.com
 

Welcome to EDABoard.com

Sponsor

Back
Top