# How to perform addition operation in analog computing? [closed]

In digital computing, addition operations are commonly performed using circuits composed of logic gates, such as the full-adder circuit, which combines multiple bits to generate a sum along with a carry-out bit. The full-adder circuit is foundational how CPU is created because Arithmetic Logic Unit (ALU) in CPU depends on that circuit. However, I'm curious about how addition operations are executed in analog computing, where values are represented continuously through voltages or currents.

About the representation of output values in analog addition operations. I understand that in analog world, the output voltage shouldn't exceed a certain voltage reference. Therefore, the input and output operations essentially involve mapping values. For instance, if a voltage reference is set to 1, and the operation 1 + 1 is performed, the output should be mapped to 1, despite the mathematical result being 2.

Here is a table with example values that illustrates the mapping between voltages and the gauges display, where VIN_A and VIN_B represent the operands of the addition operation, VOUT represents the result of addition operation, and GAUGE_A, GAUGE_B, and GAUGE_OUT represent the corresponding gauge device displays:

VIN_A VIN_B VOUT GAUGE_A GAUGE_B GAUGE_OUT
0 0 0 -10 -10 -20
0 0.25 0.125 -10 20 10
0 0.5 0.25 -10 50 40
0 1 0.5 -10 110 100
0.25 0 0.125 20 -10 10
0.25 0.25 0.25 20 20 40
0.25 0.5 0.375 20 50 70
0.25 1 0.625 20 110 130
0.5 0 0.25 50 -10 40
0.5 0.25 0.375 50 20 70
0.5 0.5 0.5 50 50 100
0.5 1 0.75 50 110 160
1 0 0.5 110 -10 100
1 0.25 0.625 110 20 130
1 0.5 0.75 110 50 160
1 1 1 110 110 220

So, what the circuit will be looks like to achieve relationship between VIN_A, VIN_B, and VOUT?

• With an op amp. Commented May 12 at 20:01
• Voltage sources can be put in series like stacking Lego bricks. Commented May 12 at 20:03
• As a Computer Engineering student that study both hardware and software. The hardware part mostly digital stuffs, so I'm weak in analog world. Therefore, I need practical approach where I just need specify voltages as input and getting result of output in voltage format relative to ground. Most Op-Amp calculator online asked me to specify any else like feedback resistor, etc. Commented May 12 at 20:14
• Try to get your hands on a basic book about op-amps and their uses. Some of the ones from National Semiconductor from the 70's are still very useful. Look for NSC application note AN-4, from 1968, for instance Commented May 12 at 21:25
• there is a thing called a "summing amplifier" which does what its name suggests, more or less anyway. Commented May 13 at 6:31

In general, arithmetic addition (and subtraction, which is merely addition of a negative) in analogue systems is trivial, since one of the key principles at work in such systems is the principle of superposition. It's how electricity works, and is the basis for laws such as Kirchhoff's Voltage Law and Kirchhoff's Current Law.

It means that currents add together at junctions, and voltages across components add together when they are joined end to end. Using these fundamental principles, it's easy to build circuits that add voltages or currents.

For instance, from your table, I gather that the relationship you require is:

$$V_{OUT} = \frac{V_A+V_B}{2}$$

That's what this circuit will do:

simulate this circuit – Schematic created using CircuitLab

Being entirely passive, this circuit imposes no constraints on the voltages at A or B, except the limits imposed by the resistors themselves. This design will work with inputs up to many tens of volts, and will handle negative voltages just fine.

Unfortunately, any load connected to OUT (such as a gauge) will probably draw current, which will influence $$\V_{OUT}\$$, so you may need to buffer the signal with a voltage-follower. I'll use an op-amp in that role:

simulate this circuit

This is no longer passive, and there are now constraints on the acceptable range of inputs, and the range of possible outputs, related to the power supply potentials of 0V and +5V shown here.

With the lower supply at 0V, the op-amp won't be able to output all the way down to exactly 0V, probably getting as far as +50mV or so, but not lower. If you need precision right down to 0V then you'll have to provide a negative supply to the op-amp:

simulate this circuit

The op-amp designs require that the op-amp's own input potentials never fall outside the supply range (that is, 0V to +5V, or -5V to +5V in last two schematics above). In fact, the LM358 shown, and many other models, won't be happy with inputs within 1.5V of the positive supply. $$\(+5V) - 1.5V = +3.5V\$$, so whatever you apply to A and B, make sure that $$\ \frac{V_A+V_B}{2} \$$ doesn't exceed +3.5V, or fall below 0V. If that's a problem, then increase the supply potentials, or choose a different op-amp model.

As long as you are careful about power supplies, and input and output constraints, you can get really creative using op-amps. I won't explain why, but the next circuit performs the function

$$V_{OUT} = -\left(\frac{1}{2}V_A + V_B + 2V_C \right)$$

simulate this circuit

That circuit both adds and inverts (negates), and if you haven't guessed already the coefficients $$\\frac{1}{2}\$$, 1 and 2 are determined by the ratios of the resistances.

As I pointed out before, the op-amp's power supply potentials impose limits upon what range of inputs are acceptable, and what output range you can expect. Here I am using ±12V supplies, and an LM358, so as long as you don't provide inputs that would map to an output outside the range -11.95V to +10.5V, it will work well.

• Let me conclude your answer. To follow my defined input-output volt mapping in the table, basically what I need is just a voltage divider. But this doesn't solve the load problem in VOUT for gauge; therefore, it's buffered by Op-Amps? Correct my conclusion if I'm wrong. Commented May 13 at 7:20
• I understood the precision should be exact 0V is not possible if using positive voltage sources for op-amps, therefore using negative-positive voltage source can solved this. I understood how to decide resistor coefficients in input voltage, but I don't get it why feedback resistor is 10k. Is there any rule what value shall I set for feedback resistor? Commented May 13 at 7:34
• You are correct that both input range and output range in my case must limited by 0 until 1 volt, suppose those ranges rule is my analog computer design. Gauge display is just output device, in computer architecture if we focus on computer unit such as analog ALU, we can ignore that any display devices. So, do I still need op-amp? I mean I can just use voltage divider for my defined input - output voltage map table. Then when any complex calculation done, yes now I can think the load and current for output device like gauge. Commented May 13 at 7:56
• @MuhammadIkhwanPerwira That all sounds correct. Commented May 13 at 8:35
• @MuhammadIkhwanPerwira As for the feedback resistor, it's the ratios that are important, not the absolute values, but you must choose values in a sensible range, corresponding to sensible currents, which is another topic altogether. Commented May 13 at 8:38

A summing configuration using opamps can provide what you need. The example below shows this configuration. One thing that is missing in the schematic are the power supplies which is not needed for the universal opamp behavioral model (mathematical description of an opamp) in LTspice.

Depending on the output impedance of your sensors, additional buffering of the inputs may be necessary.

• Yep. This is the way it was done for years before digital IC's became readily available. Commented May 12 at 21:18

Voltages add along series connected elements called branches. Figure 1. Kirchhoff's voltage Law.

Currents add at nodes. Figure 2. Kirchhoff's current Law.

Adding voltages in series has the disadvantage that only one element is grounded.

If all the voltages to be added are ground referenced, then the voltages must be converted to currents. Figure 3 displays the most basic addition circuit called a lossy adder. The output is a scaled version of the sum of the inputs. A following amplifier with a gain of 3 is required. The Thevenin resistance of the sources V3 and V4 must be insignificant compared to the resistances R1 and R2 respectively. Adding more inputs increase the loss. For instance, adding 4 sources would reduce the sum by a fifth requiring a following amplifier with again of 5.

Clearly the lossy adder has limitations. Amplifying the inputs instead of the output would extend its capability. A 4 input adder would then require, 4 amplifiers.

The op-amp configuration (called an op-amp summer) shown in @qrk's answer requires 2 amplifiers. regardless of the number of inputs.

So there are some choices that depend on the application.

There are other examples using transistors that can work

simulate this circuit – Schematic created using CircuitLab

Are there any common components or circuit configurations or designs used for this purpose?

If the inputs are currents, there is nothing to do. You can parallel current sources and addition is inherent just from the connection. If the voltage sources are floating, not ground-referenced - like, say batteries in series - the addition is also inherent in the connection scheme:

simulate this circuit – Schematic created using CircuitLab

If you have ground-referenced voltage sources and want to add the voltages, we can get their average value, which is just a sum multiplied by a constant factor 1/(number of sources), by taking voltage at a central point in a resistor "star". Then we can amplify the result by a factor (number of sources) - below, that factor is 3, since there are 3 sources:

simulate this circuit

I understand that in analog world, the output voltage shouldn't exceed a certain voltage reference.

The averaging circuit shown above takes care of it. The output voltage from the averager will never be higher than the input voltage. So, if the voltage range is 0-1V, and you average 3 input voltages of 1V each, the output is still 1V, which is the desired result scaled by a factor of 1/3.

Could the output be represented using a gauge, with an analog servo as the device for output display to achieve this like same principle for analog volt meter being used.

An analog electromechanical voltmeter is a servo already. The input voltage is converted to current and generates a torque acting against the torque of a spring with a given spring constant, and against the damping torque of air and/or any damper elements. The net torque is the error signal, and the servo (regulation) is carried out by the torque balancing principle.

If you want to servo a gauge, the simplest method is to convert the voltage to a PWM pulse train and use it to drive a typical pulse-width-controlled servo used in radio-controlled (RC) models etc.

With resistors from each input to a summation point, you can "get" a - high impedance - (weighted, scaled if you add a resistor to ground) average. If you scale two inputs the same, the sum is twice the average.

With an operational amplifier, you can make the summation point a virtual ground, advantage: no retroactive effect between inputs - but the coefficients from each input to output would be negative. Not to worry: add an inverter.