Altera_Forum
Honored Contributor
11 years agoLPM_DIVIDER [More than 64 bits necessary]
Greetings,
Simple background/story: Here I am implementing a pipelined version of double-precision floating point arithmetics with the format: So far I've managed to implement addition, subtraction and multiplication using the LPM megafunctions. Right now I'm implementing the division by simply taking the reciprocal of the "denominator" and then multiplying the reciprocal with the "nominator".A/B -> A*1/B LPM_div only accepts a maximum of 64bits, hence leaving me with the fractional/mantissa bits in the remainder. This is a huge problem for me because I'd normally need to divide the remainder with B and in turn lose the purpose with the reciprocal part. For example (Only accounting for 1/B): constant 1: contains 64 bits, where MSB is one and the rest zeroes. NOMINATOR : std_logic_vector(63 downto 0) := (63 => '1', others => '0'); b: 53 bits, hidden bit included. 1.1001111110011001100110011001100110011001100110011010 (the dot isn't there in practic, just to show you where the hidden bit is). The problem is that a big part of the fraction ends up in the remainder. Is there someway I can process the remainder without having to divide it by B to get the rest of the fraction? Has anyone encountered the same issue, or maybe have some tips of what I could do ? Cheers!