Shop OBEX P1 Docs P2 Docs Learn Events
vhdl code — Parallax Forums

vhdl code

SaraSara Posts: 9
edited 2007-02-22 14:46 in General Discussion
HI


rolleyes.gif·rolleyes.gif·rolleyes.gif

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·

smhair.gif·smhair.gifsmhair.gifshocked.gifshocked.gifshocked.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-21 22:05
    What units are being used for the transcendental functions? Are they in degrees? Are they in radians? Are they in some other units?

    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.
  • SaraSara Posts: 9
    edited 2007-02-21 22:47
    these values from gps . It is in degrees ,min,second i have to use it to calculate this equation
    aNd use the value of the output to move the stepper motor by using FPGA.
  • SteveWSteveW Posts: 246
    edited 2007-02-22 14:46
    Err, this is going to need a pretty big FPGA, a usable floating point library and a substantial amount of effort.
    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
Sign In or Register to comment.