Post Reply 
(48G/S) Closest Standard-Resistor Values
09-27-2020, 02:43 PM
Post: #5
RE: (48G/S) Closest Standard-Resistor Values
It occurred to me that since the standard values are (mostly) exact for E48, E96 and E192 we can dispense with lists entirely. I have stolen some of David Bengston's code for the following programs because the method of the original program does not work well with the one exception for E192.

First the program for E96. The program for E48 is again the same except for replacing the number 96 with 48.

Code:

\<< DUP DUP XPON SWAP MANT 10. 96. INV ^ \-> val xpon mant r
  \<< mant LN r LN / IP r SWAP DUP2 ^ ROT ROT 1. + ^ DUP2 mant - SWAP mant - NEG <
{ SWAP } IFT DROP -3. RND xpon ALOG *
  \>>
\>>

For E192 we must add a check for the errant value but the program is otherwise the same:

Code:

\<< DUP DUP XPON SWAP MANT 10. 192. INV ^ \-> val xpon mant r
  \<< mant LN r LN / IP r SWAP DUP2 ^ ROT ROT 1. + ^ DUP2 mant - SWAP mant - NEG <
{ SWAP } IFT DROP -3. RND DUP 9.19 SAME { DROP 9.2 } IFT xpon ALOG *
  \>>
\>>

Both programs work with all RPL calculators from the HP-28C through the 50g.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (48G/S) Closest Standard-Resistor Values - John Keith - 09-27-2020 02:43 PM



User(s) browsing this thread: 1 Guest(s)