Search found 4 matches

by rpocc
Wed May 01, 2019 2:12 am
Forum: Algorithm development
Topic: log/exp exact coefficients
Replies: 7
Views: 18923

Re: log/exp exact coefficients

XOR - is not subtraction. For correct subtract you may use smthing like CLR OR 0x7FffFF rdax reg_value , -1 or some kind of that XOR 7fffff is just a replacement for SOF -1, 2047/2048: The number 0.25 is represented as 00100000_00000000_00000000 ; 0.25 01111111_11111111_11111111 ; xor 7f_ff_ff 0101...
by rpocc
Wed Apr 24, 2019 8:43 am
Forum: Algorithm development
Topic: log/exp exact coefficients
Replies: 7
Views: 18923

Re: log/exp exact coefficients

; ACC has something in the bottom 8 bits out of 24. ; We want to left-shift it by 15 bits. ; Do the first 8 left-shifts using SOF doublings SOF -2,0 SOF -2,0 SOF -2,0 SOF -2,0 SOF -2,0 SOF -2,0 SOF -2,0 SOF -2,0 LOG 1,7.0 ; log() and add 7 to get a further left-shift of 7 places after exp() EXP 1,0...
by rpocc
Tue Apr 23, 2019 11:39 pm
Forum: Algorithm development
Topic: log/exp exact coefficients
Replies: 7
Views: 18923

Re: log/exp exact coefficients

It seems that I have lot of errors in the example: sof 0, %0 0100000 00000000 00000000 ; 0.25 log 1, 0 ; log2(0.25) = -2. if this number is /16 = -2/16 = -1/8 = %1 0000 001 00000000 00000000 ; Assuming, that exp(log(a)+2) = a*2, I should add 2 to the number to multiply it, but sof internal math is i...
by rpocc
Tue Apr 23, 2019 12:54 pm
Forum: Algorithm development
Topic: log/exp exact coefficients
Replies: 7
Views: 18923

log/exp exact coefficients

Hi Guys, I'm new to this forum but quite not an absolute beginner with SPIN chips. I was trying to read documentation several times but I still can't understand the exact math behind LOG and EXP opcodes because it lacks examples of S4.19 stored numbers. No, I understand, what lofarithmic scale is; t...