OpenCores
no use no use 1/1 no use no use
Help me to find reciprocal of a binary number
by yugeshjaikar on May 19, 2018
yugeshjaikar
Posts: 2
Joined: Mar 14, 2018
Last seen: Aug 18, 2021
how to find inverse (Reciprocal) of a binary number?
RE: Help me to find reciprocal of a binary number
by dgisselq on May 19, 2018
dgisselq
Posts: 247
Joined: Feb 20, 2015
Last seen: Oct 24, 2024
There's several ways, all dependent upon what your needs are.
  1. You could do a simple table look up. A 256 entry table on a Xilinx device will cost you a modest 4 LUT's per bit.
  2. There's a recursion formula you could use that costs two multiplies per round, but converges very quickly. It's based upon Newton-Raphson's method. Basically, if you want to calculate 1/x, you start with a seed (often ~x) and then apply y_new = y_old * (2 - y_old * x). The result should converge to y=1/x. I've used this in software, although never successfully in hardware. See Wikipedia's article on long division for more info here.
  3. Alternatively, you could use a long division approach. This will cost you something on the order of one clock per bit of accuracy that you want, but it should work quite well. You can find an example of a long divide here.

      Dan
RE: Help me to find reciprocal of a binary number
by 3gghead on Sep 3, 2018
3gghead
Posts: 2
Joined: Sep 1, 2018
Last seen: Sep 3, 2018
how to find inverse (Reciprocal) of a binary number?


For a binary number the 'inverse' is to simply generate its 1's Compliment (change the 1's to 0's and vice-versa). The results are not mathematically intuitive.
no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.