# Using Gorner-algorithm in VHDL

Status
Not open for further replies.

#### bibijons

##### Junior Member level 3 hey,
i'm a college student and i have to solve an algorithm in vhdl. can anyone help me to start with.
this is my function:
e^x=1+x/1!+x^2/2!+x^3/3! and so on.

i have to describe the system in vhdl and simulate the function with vhdl.
and it is also asked for a synthesis with the xilinx webpack.

who can help me with this project.

tnx for help

#### the_penetrator

##### Full Member level 5 project vhdl

OK, this look like a univ. project.

anyway, you should do it iteratively, perform: new = old + old*(x/n) at the n-th iteration.

I have seen something close to the Taylor expansion hardware you need to build.

it is hxxp://www.niosforum.com in the custom instructions tutorial for Nios 2.

at least give it a shot on your own and then take a look there.

#### Doka

##### Junior Member level 3 gorner algorithm

Try use Gorner-algorithm:
calculate y(x) = a0 + x(a1 + x(a2 + ... + am)) (m add & m mult)

other way: use CORDIC
(source code you find to opencores_org)

#### bibijons

##### Junior Member level 3 gorner algorithm

hi,
i generated this code, but i have another problem, the loop is only done one time, what do i need, that the increment works.

who do i determine the outputs, i have seen std_logic, but it ist not working.

sourcecode:
begin
if (x=0) and (i=0) and (Therm=0) and (Sum=1) and (n=1) then

Therm:=(x**i)/n*i;

n:=n*i;

Sum:=Sum+Therm;

x:=x+1;
i:=i+1;

--output2<=Sum;
output1<=input;

end if;
tnx
bibijons

Status
Not open for further replies.