cordic sincos output usage

OP (Company: panacea) #3696921
Rate this post
• ▲ useful
▼ not useful
Hi all,



I m using cordic ip core in spartan 6 device,futher im getting the 
correct outputs too, but facing problem in multiplying tat output to 
some number( like pwm ontime).



For Example



Input: Pin(phase): 0001100100011110



Output: cos(theta):Xout: 0010110101000111



Output: Sin(theta):Yout: 0010110100111011





from above example,



Phase in = 45 degrees or 0.785 in radians in 2QN format.



Xout: 11591 in decimal format, 0.7071067 in 1QN format

Yout : 11579 in decimal format, 0.7071 in 1QN format



Now consider ,

I want to multiply 50 * Xout



     = 50 * 11591  is what im able to do,but actually i need to do this 
= 50 * 0.7071067





Please can any one help me out!!!!





Thanks in Advance
Guest #3710344
Rate this post
• ▲ useful
▼ not useful
Actually,
as long  as you do not have a floating point unit
instantiated, all you can do is integer arithmetics.

So, you do

 50 * 11591

and then right shift  the result to avoid overflow, keeping the number
of right shifts  in memory.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.