Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

complex math in VHDL

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

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.