Ohm’s Law
George Simon Ohm (1787-1854) was a German schoolmaster who studied the electric circuit and determined the relationship of voltage, the electromotive force (E); current, the intensity of electron flow (I); and resistance, the opposition to electron flow (R). The results of his experiments were expressed in the equation E=IR which can also be expressed as I=E/R and R=E/I.
To those outside the field of electricity, this equation, now called Ohm’s law, may not seem very impressive, but it plays a very important role in the design and creation of such everyday wonders as electric lights, telephones, toasters, TVs, car starters, refrigerators, and computers. Before Ohm’s work, unknown values of voltage, current, or resistance had been difficult, even impossible, to find experimentally. However, these unknown circuit values can now be found quickly and accurately by mathmatical computation from Ohm’s equation. Despite this contribution of great importance to electrical science, Ohm lost his teaching job.
In addition to voltage, current, and resistance the electric circuit includes a fourth element: wattage, the measure of power consumption. Wattage is found by another equation: P=IE, in which P stands for watts. Thus, watts equal current times voltage. Notice that the power equation and Ohm’s equations all have the terms I and E in common. Knowing how mathematics handles equations with common terms, we can see the expanded versions in Figure 1.
Figure 1. Ohm’s Law Variations.
I (Amps) = E/R P/E SQR(P/R) E (Volts) = IR SQR(PR) P/I R (Ohms) = E/I E^2/P P/I^2 P (Watts) = IE I^2 R E^2/R
BOLEX
BOLEX is a program that solves these equations two at a time. Enter the program into your computer, hit RUN and NEWLINE. Four prompts will appear on your screen: amps, volts, ohms, and watts. Type in a value for one, hit NEWLINE. Continue until the values have been entered. With two values you will be able to find the other two. Try the following sample runs:
1) An appliance circuit has a current rating of 9 amps with 120 volts applied. What is the value of resistance in ohms and the power consumed in watts? Input: amps: 9; volts: 120; ohms: 0; watts: 0. The program finds the ohms and watts by solving the equations: R=E/I and P=IE.
2) How much current is drawn and how many watts are consumed by a 120 volt heating unit with 14 ohms resistance? Input: amps: 0; volts: 120; ohms: 14; watts: 0. The amps and watts are found by solving: I=E/R and P=IE or P=E*E/R where E is small enough not to cause an arithmetic overflow.
3) How much amperage and resistance is in the circuit of an appliance that uses 1625 watts plugged into 120 volts? Input: amps: 0; volts: 120; ohms:0; watts: 1625. The program solves: I=P/E and R=E*E/P.
4) A high-voltage circuit draws 5 amps with a known resistance of 450 ohms. Find the watts and volts. Input: amps: 5; volts: 0; ohms: 450; watts: 0. The program solves: E=IR and P=IE.

Machine Limitations
The 4K ROM has three limitations for the full use of the formulas. First, it functions only with whole number arithmetic. However, the program in Listing 2 includes routines for coaxing decimals from the ZX80 for the amps computation in the following lines:
210-240: division to one decimal place.
300-370: division to three decimal places.
430-440: multiplication of a 3-place decimal with accuracy near enough to 100% for the purposes of this program.
Second, the 4K ROM does not have the SQR function so again a routine is included to do this in lines 150-230. However, this gives roots only as whole numbers.
Third, in order to provide whole numbers the 4K ROM always rounds off the number by rounding down. This means that computations involving decimal places on the 4K ROM will not have the accuracy that the 8K ROM provides.
As you use this program to work out electric current problems, remember that the Sinclair is a beginner, too, and has a limited range. If you get carried away trying to figure how many watts are used to light up Yankee Stadium for a night game, be ready for an overflow error code (6).
By the way, six years after Ohm was fired, he got recognition and a better job at the University of Munich.
Figure 2. Ohm’s Law Program (4K ROM).
10 PRINT "AMPS (I)##";
20 INPUT I
30 PRINT I
40 PRINT "VOLTS (E)#";
50 INPUT E
60 PRINT E
70 PRINT "OHMS (R)##";
80 INPUT R
90 PRINT R
100 PRINT "WATTS (P)#";
110 INPUT P
120 PRINT P
130 PRINT
140 GO TO ABS(150*(I+E=0)+260*(
I+R=0)+350*(I+P=0)+450*(E+R=0)+4
80*(E+P=0)+510*(R+P=0))
150 LET H=182
160 LET L=0
170 LET E=(L+H)/2
180 LET K=(P*R)/E
190 IF K=E THEN GO TO 240
200 IF H-L<2 THEN GO TO 240
210 IF K<E THEN LET H=E
220 IF NOT K<E THEN LET L=E
230 GO TO 170
240 GO SUB 280
250 GO TO 540
260 GO SUB 280
270 GO TO 330
280 LET I=P/E
290 LET X=P-I*E
300 LET Y=10*X/E
310 PRINT I;".";Y;"#AMPS"
320 RETURN
330 LET R=E*E/P
340 GO TO 540
350 LET I=E/R
360 LET M1=E-I*R
370 LET D1=10*M1/R
380 LET M2=10*M1-D1*R
390 LET D2=10*M2/R
400 LET M3=10*M2-D2*R
410 LET D3=10*M3/R
420 PRINT I;".";D1;D2;D3;"#AMPS"
430 LET P=((D1*100+D2*10+D3)/10)
*E/100+I*E
440 GO TO 540
450 LET E=P/I
460 LET R=E/I
470 GO TO 530
480 LET E=I*R
490 LET P=I*E
500 GO TO 530
510 LET R=E/I
520 LET P=I*E
530 PRINT I;"#AMPS"
540 PRINT E;"#VOLTS"
550 PRINT R;"#OHMS"
560 PRINT P;"#WATTS"
Figure 3. Ohm’s Law Program (8K ROM).
10 PRINT "AMPS (I) ";
20 INPUT I
30 PRINT I
40 PRINT "VOLTS (E) ";
50 INPUT E
60 PRINT E
70 PRINT "OHMS (R) ";
80 INPUT R
90 PRINT R
100 PRINT "WATTS (P) ";
110 INPUT P
120 PRINT P
130 PRINT
140 GOTO (150*(I+E=0)+180*(I+R=
0)+210*(I+P=0)+240*(E+R=0)+270*(
E+P=0)+300*(R+P=0))
150 LET E=SQR (P*R)
160 LET I=P/E
170 GOTO 320
180 LET I=P/E
190 LET R=E*E/P
200 GOTO 320
210 LET I=E/R
220 LET P=I*E
230 GOTO 320
240 LET E=P/I
250 LET R=E/I
260 GOTO 320
270 LET E=I*R
280 LET P=I*E
290 GOTO 320
300 LET R=E/I
310 LET P=I*E
320 PRINT I;" AMPS"
330 PRINT E;" VOLTS"
340 PRINT R;" OHMS"
350 PRINT P;" WATTS"
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.