11-03-2017 03:35 PM
I just found this old thread and wanted to contribute a solution to it which I didn't have at the time:
The traits file in %XILINX/include/utils/x_hls_traits.h has the solution to this issue. One can define a trait based on types and use them like this:
typedef ap_fixed<...> foo;
typedef ap_fixed<...> bar;
typedef typename hls::x_traits<foo, bar>::MULT_T fooXbar;
This is how multiplication etc operators can expand their outputs based on the size of the input variable.
01-09-2018 06:06 AM
For your previous comment in Q4 LOSSLESS SUM,it seems your reply is something wrong in my tests in ap_fixed<5,3> for 3.25 and ap_fixed<5,2> for 1.125.
It should be corrected as ap_fixed<max(a-c,b-d)+max(b,d)+1,max(b,d)+1>. Thanks