Currently the division operator results in a fixed point number with word length equal to that of the left hand side (the numerator). This approach has a couple of problems associated with it:
The division operator can overflow. To grantee avoiding overflow, the resulting integer word length need be at least LHS_INT+RHS_FRAC bits wide.
It's not obvious how this is translated into HDL. The division itself will almost always need to be wider than both the left and right hand side of its operands. This is also related to #3 since the very long divisions need help from external big num libraries.
Unlike the other basic arithmetic operators (+,-,*) which are all very intuitive when used with a HDL, the division operator is very un-intuitive and does little like the division operator in common HDLs.
Given the expression LHS<a,b> / RHS<c,d>, some suitable approaches would be:
Currently the division operator results in a fixed point number with word length equal to that of the left hand side (the numerator). This approach has a couple of problems associated with it:
LHS_INT+RHS_FRAC
bits wide.Given the expression
LHS<a,b> / RHS<c,d>
, some suitable approaches would be:RES<a+d,b-d>
RES<a+d,b>
RES<a+d,std::max(b,d)>