Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Community Forums
- :
- Forums
- :
- Vivado RTL Development
- :
- Simulation and Verification
- :
- Fraction Output in Simulator

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

rajesh

Newbie

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-06-2019 05:57 AM

460 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.

1 Reply

drjohnsmith

Teacher

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-06-2019 01:07 PM

437 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 ==>