Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Hello Dears
Could you please tell me which one is better for implementation of "arc Cos(x)" in VHDL?(Also, better for implementation on real hardware(FPGA))
1_ Using Maclaurin series ( attached fig ).
2_ Using "CORDIC" method.
Thanks dear FvM.
But could you please tell me, why in some paper the authors said they used cordic core while they can do it by LUT? ( sorry if the question is simple, I don't have enough experience in this area).
Thanks in advance
Mostafa
Speaking of which, what are your requirements? If you want people to give advice on cordic vs say piecewise linear interpolation or some such, then it would help if you gave some specifics.
And generally if I want to know which method to pick. To take this specific example ... I'd write a little matlab script that does the original "exact function", and also does for example a lookup table with interpolation AND does my favorite cordic XYZ with banana flavor optimization. The I'd compute the error function for the LUT vs cordic. Then you plot the error function over your range of interest. Keep track of min/max/average error.
If the arccos goes into another function, then also check what compound error you get due to the initial error. And then you can make an informed decision on which one you use.
Thanks Dear mrflibble.
In fact I want to implement the following equation. At first I guessed, I can split the SQRT and arcCos to addition and multiplication, and then obtain the data flow design, but the data flow contains plenty amount of ADD/SUB and multiplier ( you and others in another post told me that floating point units consume plenty amount of sources in real implementation), So I searched for an alternative for it and faced with CORDIC in paper. but I don't know is it really the best one or? LUT is good but I forgot to ask, does it consume a lot of memory or not?
The LUT approach generally is pretty darn cheap because your average fpga is just about made from LUTs (and FFs). As in, LUT resources are abundant so if you can, try and use that to implement your functions. With the LUT approach it generally is a choice between using the fabric LUTs and between block ram. If your design allows it try and use the fabric LUTs because those resources are plentiful. The block rams are a more limited resource, so depending on how much you need block ram for the rest of your design you may or may not want to use block ram for your function lookup. It all depends really on the rest of your design. Also, if you can it to use fabric LUTs you typically can get it to run at a higher clock. The price being that you PROBABLY get a deeper pipeline. blah blah blah more general stuff that can not get specific without specs on your requirements such as: precision of your inputs, required precision of your outputs, further constraints on error such as max non-linearity and whatnot.
So short version: either give a lot more detail, or get matlab scripting to get a feeling for what kind of result you get for each approach. There really is no substitute for that. Do that sort of thing a couple of times and you get a good feeling for what to do for later designs. And if you don't get that feeling then you just generate vacuum (*) at math. (kidding )
*) (curse you edaboard language filter, curse yoooouuuuu)
Look-up table. A number of function values (e.g. 256 - 4096) is stored in a ROM table, the exact value is linearly interpolated. With most FPGA families, the ROM will be implemented in block RAM.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.