Gauss bell or gauss function?

D'Artagnan

New member
Joined
Apr 9, 2008
Messages
5
Reaction score
0
Points
1
It seems that I haven't been able to explain myself. I need to design an electronic circuit that can graph the gauss function, that's why I need an algorithm that allows me to calculate every vallue for every x in the gauss bell.

With algoritm I mean a mechanical way to make math operations. The problem is that in the hardware desciption lenguage there's no way to put euler. That's why I need another way to "write" euler, cannot be e, cannot be cos, cannot be sin.

Ex: the multiplication algorithm is to shift n bits, where n is one of the numbers to multiply.

Someone that has worked with ASM and VHDL will understand better, but if someone else has any answer thank you.
 
You first need to decide whether you are using fixed-point or floating-point arithmetic. Remember that floating-point is just an approximation of the Real number system with a finite number of bits. Fixed point involves scaling the domain of the function to the number of integer values representable by the the chosen number of bits.

If you just need the value of a complex exponential, sin or cos function, what's typically done is use a lookup table, rather than using something like truncating the infinite Taylor series.

Since those trig functions are symmetric, you only need lookup values in one quadrant, and can adjust the sign for values in the other three quadrants.

Your argument to the function will, by definition, have a fixed number of bits (either a scaled integer or a floating-point representation); that number of bits defines the number of lookup values you need.

Example: you want to use 8 bits (256 values 0-255) to represent an angle in the range 0 to 2pi. Only 1/4 of those values (the first quadrant) need to be in the lookup table, the others are sign shifts. So you need (1/4) * 256 = 64 entries in the table.

You could also simply store the entire Gauss distribution (it's symmetric about the mean, so you'd only need to store 1/2 the curve in the table), again scaled for the number of bits of the argument of the function. Depends whether you have lots of memory for storage, or want to have less storage and more computing.

Finally, if you didn't want a table at all, you can compute the trig functions using the Taylor series expansion, and truncating when you get to a "close enough" approximation (also constrianed by the number of bits you're using).

Does this help, or did I totally misunderstand your question?
 
Back
Top