vhdl code
HI
·
·
I have problem with VHDL code how can i use number like 21,42333 as integer· in VHDL to calculate this
equation:
q=tan-1(sin (x-y)/(cos z*tan d - sin z *cos(x-y))
all values x,y,z,d is input must be in integer·
·






I have problem with VHDL code how can i use number like 21,42333 as integer· in VHDL to calculate this
equation:
q=tan-1(sin (x-y)/(cos z*tan d - sin z *cos(x-y))
all values x,y,z,d is input must be in integer·






Comments
If they're in degrees, you're probably not going to be able to use the fractional portion of a number like 21.42333 except perhaps in the x-y terms. How are the transcendentals computed? Are they done in floating point? Are they done by table lookup? How are the results represented? How are you expected to compute the intermediate terms of your equation? In floating point?
You're going to have to answer some of these questions before anyone here could even venture a suggestion.
aNd use the value of the output to move the stepper motor by using FPGA.
If it was me, I'd be looking at compiling up a small micro, and doing the floating point work in software. At that point, you might wonder if the FPGA was the right choice after all.
At the moment, your project isn't very well defined, but looks a lot like a moneypit and timepit. If you're doing this for its educational value, then go for it. You'll learn a huge amount before finishing it...
(Note that VHDL for simulation and VHDL for synthesis are rather different worlds)
Steve