Forum Discussion

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

Fixed-point multiplication with "altmult_complex" megafunction

Hi,

I am using the altmult_complex (complex multiplier) with inputs dataa (both real and imaginary) having 16 fractional bits, and inputs datab (both real and imaginary) having 2 decimal bits and 14 fractional bits. Dataa inputs are signed while datab inputs are unsigned.

I know that the output of the megafunction block would be singed results:

-> real = [(dataa_real * datab_real) - (dataa_imag * datab_imag)]

-> imag = [(dataa_real * datab_imag) + (dataa_imag * datab_real)]

Since the multiplication has both decimal and fractional bits, I'd like to know how many bits the outputs would have if I restrict the output to 16-bits in total.

Since 0.16 * 2.14 = 2.30 (32 bits), would restricting output to 16-bits give 2.14? [x.y -> x=decimal bits and y=fractional bits]

Also, would it be better if I use the fixed-point vhdl package?

Appreciate your help and guidance.

15 Replies