F
Fred Bloggs
Guest
Robert Monsen wrote:
For the **E96** series the basic calculation is something like this,
where Log's are base 10, and R is input value normalized to 100<=R<1000,
IROUND is round-to-nearest-integer function:
X=1.5*LOG10(R) % compute and scale log base 10 of R
F=FRACT(X) % fractional part of X
Y=INT(X) % integer part of X
RSTD=IROUND(10^((Y+ IROUND(64*F)/64)/1.5)) % standard value output
In words, for normalized R in range 10 to <1000 to be converted to
standard value with hand calculator:
1) compute logarithm base 10 and multiply by 1.5
2) note integer portion and subtract off
3) multiply remaining fraction by 64
4) mentally round that result up/down to nearest integer and then divide
by 64
5) add back in original integer portion subtracted in step 2)
6) divide the above by 1.5
7) take antilog ( raise 10 to this power)
8) round result to nearest integer
It turns out that 920 is a genuine error in the original tabulation of
E192, not a part of E96 and lesser precision series, and 919 should be
the entry instead for E192, unless there is an ancient multi-point
smoothing interpolation I am overlooking. This and a bit more logic to
filter the RSTD calculated produces the correct results, and there is a
very simple theoretical basis for this that I am certain follows the
original thinking and computation. The original table was not generated
using the above formula- the formula is a luxury not available to the
original number crunchers and is an analog of their computation. The
formulation for the other series, which is similar, and of any other
series to be created with specified tolerance makes for an elegant
generalization of which the E96 formula is just one instance.
Some numbers from pi 31415927 say to spot check 314,141,415,159,592,927:
314 X=3.7453945 F=0.7453945 Y=3 RSTD=316
141 X=3.2238287 F=0.2238287 Y=3 RSTD=140
415 X=3.9270721 F=0.9270721 Y=3 RSTD=412
159 X=3.3020957 F=0.3020957 Y=3 RSTD=158
592 X=4.1584826 F=0.1584826 Y=4 RSTD=590
927 X=4.4506196 F=0.4506196 Y=4 RSTD=931
These results are right on. The formula has been checked in other ways
so that 1) standard values are always returned and 2) deviations from
absolute closest standard value to arbitrary input R are hopelessly lost
as noise compared to tolerance.
If I said I have the answer then that means I have the answer.Ok, caching is a usually a good strategy.
Sadly, I don't have a basic interpreter, so I guess I'm stuck with the
clumsy table lookup. It's ok, since I already have all the values typed
(actually cut and pasted) in here:
http://home.comcast.net/~rcmonsen/resistors.html
You have a cute routine, though. Curve fitting is fun. Somebody had alot
of fun doing it, I think. That "if 919, output 920" is hilarious.
I'm hoping Bloggs posts the simpler scheme he claims to know.
For the **E96** series the basic calculation is something like this,
where Log's are base 10, and R is input value normalized to 100<=R<1000,
IROUND is round-to-nearest-integer function:
X=1.5*LOG10(R) % compute and scale log base 10 of R
F=FRACT(X) % fractional part of X
Y=INT(X) % integer part of X
RSTD=IROUND(10^((Y+ IROUND(64*F)/64)/1.5)) % standard value output
In words, for normalized R in range 10 to <1000 to be converted to
standard value with hand calculator:
1) compute logarithm base 10 and multiply by 1.5
2) note integer portion and subtract off
3) multiply remaining fraction by 64
4) mentally round that result up/down to nearest integer and then divide
by 64
5) add back in original integer portion subtracted in step 2)
6) divide the above by 1.5
7) take antilog ( raise 10 to this power)
8) round result to nearest integer
It turns out that 920 is a genuine error in the original tabulation of
E192, not a part of E96 and lesser precision series, and 919 should be
the entry instead for E192, unless there is an ancient multi-point
smoothing interpolation I am overlooking. This and a bit more logic to
filter the RSTD calculated produces the correct results, and there is a
very simple theoretical basis for this that I am certain follows the
original thinking and computation. The original table was not generated
using the above formula- the formula is a luxury not available to the
original number crunchers and is an analog of their computation. The
formulation for the other series, which is similar, and of any other
series to be created with specified tolerance makes for an elegant
generalization of which the E96 formula is just one instance.
Some numbers from pi 31415927 say to spot check 314,141,415,159,592,927:
314 X=3.7453945 F=0.7453945 Y=3 RSTD=316
141 X=3.2238287 F=0.2238287 Y=3 RSTD=140
415 X=3.9270721 F=0.9270721 Y=3 RSTD=412
159 X=3.3020957 F=0.3020957 Y=3 RSTD=158
592 X=4.1584826 F=0.1584826 Y=4 RSTD=590
927 X=4.4506196 F=0.4506196 Y=4 RSTD=931
These results are right on. The formula has been checked in other ways
so that 1) standard values are always returned and 2) deviations from
absolute closest standard value to arbitrary input R are hopelessly lost
as noise compared to tolerance.