Forum Discussion
Altera_Forum
Honored Contributor
15 years agoDividing two N-bit signed binary (with fractional bits) in Quartus
In my design, I am required to divide a signed 16-bit binary, say A, with another signed 16-bit binary, say d. Both inputs have decimal and fractional bits. The denominator d is actually a posi...
Altera_Forum
Honored Contributor
15 years agoYou are on right track. you only need to scale 1/d by some power of 2 then truncate final result equally. e.g. .999 = .999 x 2^14/2^14
hence scale .999 to = .999 * 2^14 = 16368 In hardware truncate off 14 LSBs thus you get .999 in effect The real issue is how to get 1/d from d if not constant(may be lut...)