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
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.
Thank u ,it helped a lot.But how to handle wit floating points?,is der any keyword for it?.
look at opencores.org, guess you get a floating point unit from there.
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.