(1)| 11/23/2010 1:56 PM | |
|
Joined: 1/28/2009 Last visit: 1/22/2026 Posts: 6892 Rating:
|
Dear member Check this link for principles of natural logarithm in wikipedia.if the value of #register is like (e.g 2^5 ~32~2#100000) , a value like 2^n , the active bit position is the calculated output, but in the case of several active bits, this is not a perfect way : LN(2^N)/LN(2)=N*{LN(2)/LN(2)}=N [code] L #REGISTER //in form of 2^n ITD //integer to double DTR //double to real LN L 6.931472 E-001 //LN(2) /R T #POS //active bit position [/code] For a better conclusion give us the rest of codes, it may use round function to make it a general purpose code. regards hdhosseini |
This contribution was helpful to
|
|
Follow us on