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

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now