Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

logarithm implementation

sir,

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

thnaks in advance.:)

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.