Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20693 Discussions

complex math in VHDL

Altera_Forum
Honored Contributor II
1,365 Views

Hi,  

 

I wonder if there is any synthesizable VHDL code/Library to deal with math operations on complex numbers; especially transforming into/from polar. The library math_complex uses "real numbers" which is, as far as I know, not synthesizable. 

 

thankx
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
381 Views

reals are not synthesisable. 

There are no other synthesisable libraries that deal with it - but there is nothing to stop you writing your own, especially if you use the new fixed point libraries. 

 

Just delcare a record type: 

 

type complex_fixed_t is record rl : sfixed(7 downto -7); imag : sfixed(7 downto -7); end record complex_fixed_t;  

 

or something like that and you can create all sorts of functions that will be fully synthesisable.
0 Kudos
Reply