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

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- Other FPGA Architecture
- :
- How to implement log10 (x) in verilog in Vivado?

- 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

shruthi_07

Observer

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

06-08-2016 12:50 PM

8,498 Views

Registered:
09-30-2015

1 Solution

Accepted Solutions

Highlighted

LawsonSSEC

Visitor

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

06-08-2016 02:51 PM

13,999 Views

Registered:
06-03-2016

Sorry I don't have FPGA code handy, but I have implemented a fixed point integer logarithm on small microprocessors. I used a successive approximation algorithm similar to CORDIC. http://www.quinapalus.com/efunc.html <= is where I found the basic algorithm. In my case, I built a Log2() function covering an input range of 1 to 2 with a prescaling loop to find the integer portion of the answer. Then I used the change of base formula to convert any logarithm to Log2(). example: 10*log10(x) = 10/log2(10)*log2(x). Gave about 1-bit per loop and I would expect a state machine implementing it to be pretty simple.

Also found this quick discussion that links to a few other algorithms in current use for calculating logarithms. What algorithm is used by computers to calculate logarithms?

Marty

3 Replies

Highlighted

bwiec

Xilinx Employee

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

06-08-2016 02:20 PM

8,481 Views

Registered:
08-02-2011

A lookup table is common for this, depending on your requirements.

www.xilinx.com

Highlighted

LawsonSSEC

Visitor

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

06-08-2016 02:51 PM

14,000 Views

Registered:
06-03-2016

Sorry I don't have FPGA code handy, but I have implemented a fixed point integer logarithm on small microprocessors. I used a successive approximation algorithm similar to CORDIC. http://www.quinapalus.com/efunc.html <= is where I found the basic algorithm. In my case, I built a Log2() function covering an input range of 1 to 2 with a prescaling loop to find the integer portion of the answer. Then I used the change of base formula to convert any logarithm to Log2(). example: 10*log10(x) = 10/log2(10)*log2(x). Gave about 1-bit per loop and I would expect a state machine implementing it to be pretty simple.

Also found this quick discussion that links to a few other algorithms in current use for calculating logarithms. What algorithm is used by computers to calculate logarithms?

Marty

Highlighted

ctpoomagal

Newbie

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

06-11-2018 12:45 AM

3,158 Views

Registered:
06-11-2018

How the lookup table method is used to implement log10 (x) in verilog. Please give me some example?