R Calculator for the TS1000

See all articles from QZX v8 n4
Author(s): Guillermo Antonio Garcia (LU8MAD)
Publication: QZX
Pub Details: QZX v8 n4 (Volume 8, Issue 4)
Date: March 1990
Pages: 6-7

This is a program that I have adapted from a basic program published in a Holland magazine. It is for the TS1000 but is easily modified for other Sinclair (and clone) machines.

It is a very useful tool when you need a non-standard value of resistance when building filters from operational amplifiers for modems or other exacting uses. It will help anytime you need a resistor with an unusual value or a small tolerance. It is also a good example of the application of the READ/DATA/RESTORE routines by Clem Wehner, K5KGM, as published in the August 1985 issue of QZX.

The key to the program lies in line 100. The numbers in this line represent the standard resistance values. The program uses them to calculate which standard values can be used to get the particular value you request.

Note that no decimal value is given in this list. All values used and calculated must use the same power of 10. That is, all values must be in kiloohms, megohms, or whatever you need. A particularly useful feature of this program is that, if you put any 12 values of resistance from your junk box in this statement, the program will try to get your desired value of resistance by using these junk box values.

The program takes one or more minutes to do the calculations.

As an example of the amount of labor this program can save, consider the problem of obtaining a 71 ohm resistor with a tolerance of 5 %. The program will print out 31 possible combinations of parallel resistors and 23 possible combinations of series resistors.

If you ask the program to calculate a way to get a 72 ohm resistor with a tolerance of something like 1 %, you will get the printout shown in the figure after the program listing on the next page.

R Calculator (PARSER) listing, part 1
R Calculator (PARSER) listing, part 1
R Calculator (PARSER) listing, part 2
R Calculator (PARSER) listing, part 2
Fig 1. Sample printout for 72 ohms, 1 % tolerance
Fig 1. Sample printout for 72 ohms, 1 % tolerance