Continue to Site

Welcome to EDAboard.com

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.

dealing with derivative in VHDL,is it totally impossible ?

Status
Not open for further replies.

jojo26

Newbie level 5
Joined
Jan 27, 2017
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
80
hi,
i know that dealing with derivative in VHDL is not that possible,but i want to ask why ? and if i have a given funcion would it be possible to do a certain approximation in order to have derivative and what are the steps to succed in that.i'm so confused.
thanks a lot.
 

dealing with derivative in VHDL is not that possible
Don't know what that means, I would generally contradict, it's possible in different regards.

Before we discuss VHDL specific questions, you should specify the problem in terms of digital signal processing respectively numerical mathematic. Who is the antiderivative defined? What are input and output quantities? One- or multidimensional arrays? Or simply a data stream?
 
  • Like
Reactions: jojo26

    jojo26

    Points: 2
    Helpful Answer Positive Rating
i'm sorry i have no details about the function i'm going to work on,i was given an assignment,i should find algorithms for derivative in vhdl using multiplication,addition and division only.so if i got you right,it is possible to write this kind of VHDL algorithms ?
thank you
 

It's totally possible. You need to define your problem a little more specifically.
 
  • Like
Reactions: jojo26

    jojo26

    Points: 2
    Helpful Answer Positive Rating
Derivative in the discrete domain is usually viewed as the signal sampled in T1 minus the signal sampled in T0.
Delta T (between T0 and T1) equals the timing interval between samples.
 
  • Like
Reactions: jojo26

    jojo26

    Points: 2
    Helpful Answer Positive Rating
i did some research and i read about numerical differentiation and finite difference approximation,and it is indeed the solution to derive in vhdl.but i found nothing about vhdl algorithms treating this kind of problems. can you help me with an example ?
 

Remember that as sample interval Delta-t tends towards 0, the linear slope tends towards a point and your result gets more and more accurate.
This is to say that the method for finding the slope of a straight-line graph is applicable and the result gets closer to the differential with decreased sample time interval. It depends on the degree of accuracy you need...reduce your sample time interval the more for even better accuracy.
 
  • Like
Reactions: jojo26

    jojo26

    Points: 2
    Helpful Answer Positive Rating
i did some research and i read about numerical differentiation and finite difference approximation,and it is indeed the solution to derive in vhdl.but i found nothing about vhdl algorithms treating this kind of problems. can you help me with an example ?

do you know how to write vhdl? if you understand the problem, you can write a simple difference-based core in 5 mins.
 

do you know how to write vhdl? if you understand the problem, you can write a simple difference-based core in 5 mins.

I'm trying,this my first time writing a code of a system without its description (inputs,outputs,blocks..).i'll succeed soon..not in 5mins but soon.thanks for your help ;-)
 

hi,
i have the coordinates (easting / northing) on 12bits std_logic_vector, so i'm going to use those to implement f'(x(i))=(Y(i-1)-Y(i+1))/(x(i-1)-x(i+1))
can you help me with some examples or refrences,thanks a lot.
regards
jojo26
 

@Akanimo: Both posts #12 and #13 are correct. No one cares in which order the subtraction is made and same result will be given.

@jojo26: According to your expression in post #11, how can you know Y(i+1) if it has not happened yet ? Go with the expression in post #13 or #12.
 
  • Like
Reactions: jojo26

    jojo26

    Points: 2
    Helpful Answer Positive Rating
@Akanimo:

@jojo26: According to your expression in post #11, how can you know Y(i+1) if it has not happened yet ? Go with the expression in post #13 or #12.


i have the values of my expression in discrete points in advance(following the same step), all i have to do is to conclude the derivative of each one
thanks a lot for answering and sorry if my english is not that good
 

Hi jojo26,

You have to also consider the fact that a single (Y(i)-Y(i-1))/(X(i)-X(i-1)) consideration may not be adequate for the task depending on what process variable you are watching. Realize that X in this case is instantaneous sample time and recent (X(i)-X(i-1)) is the period between samples and is constant. The accuracy of Y will depend largely on the resolution of the ADC.

You may need to pipeline several consecutive (Y(i)-Y(i-1))/(X(i)-X(i-1))'s and also consider whether the more recent (Y(i)-Y(i-1))/(X(i)-X(i-1))'s are decreasing, increasing, remaining constant, or the difference is excessively large or zero relative to the older (Y(i)-Y(i-1))/(X(i)-X(i-1))'s.

---------------

You can consider the following conditions:

If (Y(i)-Y(i-1))/(X(i)-X(i-1)) is lesser than (Y(i-1)-Y(i-2))/(X(i-1)-X(i-2)) which in turn is lesser than (Y(i-2)-Y(i-3))/(X(i-2)-X(i-3)) which in turn is lesser than (Y(i-3)-Y(i-4))/(X(i-3)-X(i-4)) and so on, then the variable is increasing, then the process variable changing in a 'capacitor-charging' manner (i.e. exhibiting the a curve equivalent to a capacitor charging from a certain v(t=0) to a certain v(t=some_latter_time)).

If (Y(i)-Y(i-1))/(X(i)-X(i-1)) is greater than (Y(i-1)-Y(i-2))/(X(i-1)-X(i-2)) which in turn is greater than (Y(i-2)-Y(i-3))/(X(i-2)-X(i-3)) which in turn is greater than (Y(i-3)-Y(i-4))/(X(i-3)-X(i-4)) and so on, then the process variable is changing with respect to time in a way that it is exhibiting a curve equivalent to the right-side of the letter "U".

If the differences between older (Y(i)-Y(i-1))/(X(i)-X(i-1))'s and more recent (Y(i)-Y(i-1))/(X(i)-X(i-1))'s are zero, then you have negligible change in Y with respect to X.

If the differences between older (Y(i)-Y(i-1))/(X(i)-X(i-1))'s and more recent (Y(i)-Y(i-1))/(X(i)-X(i-1))'s are constant, then you have a straight-line graph.

If the change between (Y(n)-Y(i))/(X(n)-X(i)) is excessively large, then you probably have a surge. You have to decide that setpoint to suit your project though.

There are several other conditions that you can watch out for as they suit your aim.

The pipeline of (Y(i)-Y(i-1))/(X(i)-X(i-1))'s should be moderate (not too long and not too short) or you'd have issues with accuracy of your results.

I hope this helps.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top