06-26-2012 08:30 PM
Can anybody teach me how to generate a tanh function by using cordic 4.0 block? Act, I want to implement this function y(x)=1/2 tanh(x/2)+ 1/2 for sigmoid function approximation. But how can I model this function using Xilinx System Generator's cordic block? Thx
Solved! Go to Solution.
06-26-2012 10:51 PM
the straightforward method would be to use two cordic blocks, one for sinh the other for cosh.
So your system would be like:
tanh_x=sinh(shr(x))/cosh((shr(x)) --(where shr acts as a division by 2)
y= shr(tanh_x) + 0.5 --(where shr acts as a division by 2)
In any case you should carefully study the cores datasheet about the numerical input and output margins of the cordic core.
Also, you need a well designed interface that ensures that you only process matching valid data pairs.
However, there might be some more clever solution than that.
If nothing else helps, try to create a (good enough) lookup table for the equation.
Have a nice synthesis
06-27-2012 06:54 AM
The latest issue of the Xcell journal (issue 79) has a pretty good article on the cordic which may be helpful as well:
06-28-2012 07:50 PM
I would recommend you read the post below:
thx for your help. Is there any issue of Xcell journal that have discussion on Xilinx System Generator?