Aimerbhat
Newbie level 5
Hi ,
I have 8 numbers like -398.1234 , -14.1898 etc and I have 8 signals generated in the design .
I need to compute
y = c1* x1 + c2 * x2 .... + c8 *x8 ,
where c1 , c2 etc are the constants and x1 , x2 are the signals to the block .
What is the best way to code this ?
since these are floating point numbers , should I multiply them by10, 000 ,
to convert them to integer, do the computation and then again divide by10, 000 ?
If so , dividing by10,000 will not be easy in binary .
Can we declare floating point numbers in verilog, and will the synthesis tool take care of it ?
Thanks ,
Aimer
I have 8 numbers like -398.1234 , -14.1898 etc and I have 8 signals generated in the design .
I need to compute
y = c1* x1 + c2 * x2 .... + c8 *x8 ,
where c1 , c2 etc are the constants and x1 , x2 are the signals to the block .
What is the best way to code this ?
since these are floating point numbers , should I multiply them by10, 000 ,
to convert them to integer, do the computation and then again divide by10, 000 ?
If so , dividing by10,000 will not be easy in binary .
Can we declare floating point numbers in verilog, and will the synthesis tool take care of it ?
Thanks ,
Aimer