Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20693 Discussions

logarithm implementation

Altera_Forum
Honored Contributor II
891 Views

sir, 

 

plz suggest me the method how can i implement logarithm(bbase 2) in vhdl??:( 

 

thnaks in advance.:)
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
205 Views

Depending on your accuracy requirements, you could shift the input until it's between 0 and 1. Count the number of shifts to get the integer portion of the result. Then use a table lookup to find the fractional portion of the result. 

 

Your accuracy will depend on the size of the table.
0 Kudos
Reply