Turn on suggestions

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

Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- FPGA, SoC, And CPLD Boards And Kits
- Re: Arccos calculation

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

Highlighted
##

Altera_Forum

Honored Contributor I

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

11-18-2011
08:00 PM

889 Views

Arccos calculation

Hello everyone,

I am using de0nano and need to perform arccos calculation. I am aware that altera have floating point megafunction for arctan and sin/cos, but it does not have arcsin or arccos mega function. What option do I have? My data is two complement 12 bit width which means it has 4096 possibilities. If I have to use look up table(LUT) method, then I have to program it with 4096 cases.(which is way too much if I have to do it manually using LUT) Thank you anyone for your help. Gunardi :)
5 Replies

Highlighted
##

Altera_Forum

Honored Contributor I

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

11-18-2011
09:22 PM

22 Views

What is your input format? is it Re/Im or just cosine value?

Highlighted
##

If you're using HDL - you can create a LUT using the ROM template from the coding guidelines and you're allowed to use a function to initialise the ram. In VHDL you can use the arcsin and arccos functions from math_real package to generate the LUT.

Altera_Forum

Honored Contributor I

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

11-18-2011
10:06 PM

22 Views

Altera_Forum

Honored Contributor I

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

11-18-2011
10:06 PM

22 Views

Highlighted
##

Altera_Forum

Honored Contributor I

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

11-19-2011
02:48 AM

22 Views

@kaz: Thank you for your reply. It is just cosine value not Re/im input.

@Tricky: Thank you for your reply. "If you're using HDL - you can create a LUT using the ROM template from the coding guidelines and you're allowed to use a function to initialise the ram." What is ROM template or ram? How to create it? Is it possible to use verilog not vhdl? Please be more specific, because I am a beginner in FPGA:)
Highlighted
##

Altera_Forum

Honored Contributor I

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

11-19-2011
08:38 AM

22 Views

Given cosine input range from 0 ~ 4095 representing 1 ~ -1

then use one of following options: 1) use full LUT, simple, needs 4096 * bitwidth as you know. Use cosine input as direct address. 2) use half LUT plus logic. since upper half is anti-symmetric with lower half. e.g. if address > 2047 address = 4095 - address data = pi - data end but pi need be scaled correctly. 3)use smaller LUT e.g. 256 locations then add logic to interpolate linearly values in between. practical and good approximation and intuitive. 4) explore possibilty of using cordic approachFor more complete information about compiler optimizations, see our Optimization Notice.