cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rajesh
Newbie
Newbie
498 Views
Registered: ‎04-06-2019

Fraction Output in Simulator

I am currently working on  CORDIC algorithm to compute sine and cosine of angles.

I used 16-bits for calculating the sine and cosine.

i.e. if the sin(x) value is 0.5, the output is 0100000000000000 (16 bit).

The output is sin(x) * 2^15. 

How do I display the output as 0.5 instead of 010000...0.

0 Kudos
1 Reply
drjohnsmith
Teacher
Teacher
475 Views
Registered: ‎07-09-2009


What your looking at is the Q format question.

http://www.ee.ic.ac.uk/pcheung/teaching/ee3_Study_Project/lecture%205(4).pdf

In base 10, where we put the decimal point is up to us, We tend to write a number as say 56.78 , in binary we do the same, say 110101.1010, but in the hardware we dont have a rela point,its up to us where we put it.

If I remember, check the cordic docs, the input is radians,
<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos