 The Museum of HP Calculators

# Series/Parallel Resistor Calculator for the HP-67/97

This program is Copyright © 1997 by John H. Meyer and is used here by permission.

This program is supplied without representation or warranty of any kind. The author and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

 Series/Parallel Resistor Calculator Shift Rtotal % error Number/decade Label Rmin Rmax Series Parallel Key A B C D E

## Overview And Instructions

This program finds two standard resistors that, when placed in either series or parallel, give the closest approximation to a desired non-standard resistance value.

Two standard resistors can be placed in series or parallel to approximate a desired resistance. Standard resistance values are calculated from the following formula:

```      [10(1/n)]x
```

where n = the number of standard resistance values per decade, and x = an integer. Each succeeding integer results in the next standard value. 5% resistors come 12 to the decade, thus n=12. Precision resistor values are 24 to the decade, thus n=24.

To calculate the closest fit, using a series connection, the following algorithm is used: (R' and R'' are the trial resistances; R= the desired resistance)

``` 1.  R' = [10 ^ (1/n)] ^ INT [log (R)/log ( 10 ^ (1/n) ) ]
2.  Set flag 2
3.  R'' = [10 ^ (1/n)] ^ INT [log (R - R')/log ( 10 ^ (1/n) ) ]
4.  If R'' > R', program is finished.
5.  Compute error = ABS [R- (R'+R'')]. If this is smallest error yet,
save R' and R''.
6.  If flag 2 is set, multiply R'' by 10 ^ (1/n), clear flag 2,
and go to step 5.
7.  Divide R' by 10 ^ (1/n). Go to step 2.
```

If R'' falls below the minimum resistance (Rmin), Rmin gets substituted for R''. Program approximates parallel resistance by substituting 1/R for R, and the reciprocal of maximum acceptable (Rmax) for Rmin .

Program works for capacitors and inductors. Use parallel program to approximate series capacitance and vice versa.

To use the program:

1. Load side 1 and side 2.
2. Optional: Enter number of standard components per decade (default - 24). Press [f] [E].
3. Set display for one less than the number of significant digits that the standard components are specified to (e.g., for 9.09 k-ohms set [DSP] ). Also, set display to ENG.
4. Input minimum standard value (Rmin). Press A.
5. Input maximum standard value (Rmax). Press B.
6. Input desired resistance. Press C to compute series values, or D to compute parallel values.
7. Optional: Compute total resistance given by total value (press [f] [A]).
8. Optional: Compute % error of actual resistance compared to desired resistance (press [f] [B]).
9. Optional:
Recall Rmin [RCL] [A]
Recall Rmax [RCL] [B]
Recall R (desired resistance) [RCL] [C]
Recall R1 (first standard resistor) [RCL] [D]
Recall R2 (second standard resistor) [RCL] [E]

Note: Steps 2 - 5 above can be done in any order, at any time. To compute a new approximation, merely re-execute step 6.

## The Program

```LINE    CODE      KEYS          KEYSTROKES (67)    COMMENTS
001  31 25 00    Label 0       [f] [LBL]       Compute R' and R''
002     35 64    ABS           [h] [ABS]          according to
003     31 53    LOG           [f] [LOG]          formula on page 1.
004     34 08    RCL8          [RCL] 
005        81    ÷             ÷
006     31 83    INT           [f] [INT]
007     34 09    RCL9          [RCL] 
008     35 52    X<>Y          [h] [X<>Y]
009     35 63    Yx            [h] [Yx]
010     35 22    RTN           [h] [RTN]
011  32 25 15    Label e       [g] [LBL f] [e]
012  35 51 00    SF0           [h] [SF]        Store n
013     33 03    STO3          [STO] 
014     35 22    RTN           [h] [RTN]
015  31 25 11    Label A       [f] [LBL] [A]
016     33 11    STOA          [STO] [A]          Store Rmin
017     35 22    RTN           [h] [RTN]
018  31 25 12    Label B       [f] [LBL] [B]
019     33 12    STOB          [STO] [B]          Store Rmax
020     35 22    RTN           [h] [RTN]
021  32 25 11    Label a       [g] [LBL f] [a]
022     35 23    ENG           [h] [ENG]          Compute Rtot
023     34 14    RCLD          [RCL] [D]
024  35 71 01    F1?           [h] [F?] 
025     35 62    1/x           [h] [1/x]
026     34 15    RCLE          [RCL] [E]
027  35 71 01    F1?           [h] [F?] 
028     35 62    1/x           [h] [1/x]
029        61    +             +
030  35 71 01    F1?           [h] [F?] 
031     35 62    1/x           [h] [1/x]
032     35 22    RTN           [h] [RTN]
033  32 25 12    Label b       [g] [LBL f] [b]    Compute % error
034     34 13    RCLC          [RCL] [C]
035  32 22 11    GSBa          [g] [GSB f] [a]
036     32 82    % Change      [g] [%CH]
037     31 23    FIX           [f] [FIX]
038     35 22    RTN           [h] [RTN]
039  31 25 14    Label D       [f] [LBL] [D]      Parallel approx.
040     35 62    1/x           [h] [1/x]
041     33 13    STOC          [STO] [C]
042  35 51 01    SF1           [h] [SF] 
043     34 12    RCLB          [RCL] [B]
044     35 62    1/x           [h] [1/x]
045     22 04    GTO4          [GTO] 
046  31 25 13    Label C       [f] [LBL] [C]      Series approx.
047     33 13    STOC          [STO] [C]
048  35 61 01    CF1           [h] [CF] 
049     34 11    RCLA          [RCL] [A]
050  31 25 04    Label 4       [f] [LBL]       Set n=24. If flag
051     33 04    STO4          [STO]           0 is set, set n
052     35 23    ENG           [h] [ENG]          equal to user
053     34 03    RCL3          [RCL]           supplied number
054        02    2             2                  of values
055        04    4             4                  per decade
056  35 71 00    F0?           [h] [F?] 
057     35 52    X<>Y          [h] [X<>Y]
058     35 62    1/x           [h] [1/x]
059     32 53    10x           [g] [10x]          Compute 10^(1/n)
060     33 09    STO9          [STO] 
061     31 53    LOG           [f] [LOG]          log[10^(1/n)]
062     33 08    STO8          [STO] 
063     34 13    RCLC          [RCL] [C]
064     33 07    STO7          [STO]           Initialize error=R
065  31 22 00    GSB0          [f] [GSB]       Compute R'
066     33 06    STO6          [STO] 
067  31 25 01    Label 1       [f] [LBL] 
068  35 51 02    SF2           [h] [SF] 
069     34 13    RCLC          [RCL] [C]
070        51    -             -                  Compute R' - R
071  31 22 00    GSB0          [f] [GSB]       Compute R''
072     33 05    STO5          [STO] 
073     34 04    RCL4          [RCL] 
074     32 81    X>Y?          [g] [X>Y?]         If R''< Rmin
075     33 05    STO5          [STO]           Rmin -> R''
076  31 25 02    Label 2       [f] [LBL] 
077     34 06    RCL6          [RCL] 
078     34 05    RCL5          [RCL] 
079     32 71    X<=Y?         [g] [X<=Y?]        If R''<R', set flg
080  35 51 03    SF3           [h] [SF]        3 which will
081        61    +             +                  allow program to
082     34 13    RCLC          [RCL] [C]          continue.
083        51    -             -                  Compute ABS   [R'+
084     35 64    ABS           [h] [ABS]          R'' - R]
085     34 07    RCL7          [RCL]           Compare new error
086     32 71    X<=Y?         [g] [X<=Y?]        to smallest
087     22 03    GTO3          [GTO]           previous error.
088     35 53    Roll Down     [h] [roll dn]
089     33 07    STO7          [STO] 
090     34 06    RCL6          [RCL]           If current error
091  35 71 01    F1?           [h] [F?]        is smallest yet,
092     35 62    1/x           [h] [1/x]          store current
093     33 14    STOD          [STO] [D]          error (7),
094     34 05    RCL5          [RCL]           R''(D), and R'(E).
095  35 71 01    F1?           [h] [F?] 
096     35 62    1/x           [h] [1/x]
097     33 15    STOE          [STO] [E]
098  31 25 03    Label 3       [f] [LBL] 
099     34 09    RCL9          [RCL] 
100  33 71 05    STx5          [STO] [x]       Compute next R''
101  35 71 02    F2?           [h] [F?] 
102     22 02    GTO2          [GTO] 
103  33 81 06    ST ÷ 6        [STO] [÷]       Compute next R'
104     34 06    RCL6          [RCL] 
105  35 71 03    F3?           [h] [F?]        If flg 3 is set,
106     22 01    GTO1          [GTO]           go through next
107     34 13    RCLC          [RCL] [C]          set of
108  35 71 01    F1?           [h] [F?]        calculations,
109     35 62    1/x           [h] [1/x]          otherwise display
110     33 13    STOC          [STO] [C]          results.
111     34 14    RCLD          [RCL] [D]
112     31 84    Print X       [f] [-x-]
113     34 15    RCLE          [RCL] [E]
114     31 84    Print X       [f] [-x-]
115     35 22    RTN           [h] [RTN]
```