# Arithmetic Circuits

In the previous chapter, we discussed about the basic applications of op-amp. Note that they come under the linear operations of an op-amp. In this chapter, let us discuss about arithmetic circuits, which are also linear applications of op-amp.

The electronic circuits, which perform arithmetic operations are called as **arithmetic circuits**. Using op-amps, you can build basic arithmetic circuits such as an **adder** and a **subtractor**. In this chapter, you will learn about each of them in detail.

## Adder

An adder is an electronic circuit that produces an output, which is equal to the sum of the applied inputs. This section discusses about the op-amp based adder circuit.

An op-amp based adder produces an output equal to the sum of the input voltages applied at its inverting terminal. It is also called as a **summing amplifier**, since the output is an amplified one.

The **circuit diagram** of an op-amp based adder is shown in the following figure −

In the above circuit, the non-inverting input terminal of the op-amp is connected to ground. That means zero volts is applied at its non-inverting input terminal.

According to the **virtual short concept**, the voltage at the inverting input terminal of an op-amp is same as that of the voltage at its non-inverting input terminal. So, the voltage at the inverting input terminal of the op-amp will be zero volts.

The **nodal equation** at the inverting input terminal’s node is

If Rf=R1=R2=RRf=R1=R2=R, then the output voltage V0V0 will be −

Therefore, the op-amp based adder circuit discussed above will produce the sum of the two input voltages v1v1 and v1v1, as the output, when all the resistors present in the circuit are of same value. Note that the output voltage V0V0 of an adder circuit is having a **negative sign**, which indicates that there exists a 180^{0} phase difference between the input and the output.

## Subtractor

A subtractor is an electronic circuit that produces an output, which is equal to the difference of the applied inputs. This section discusses about the op-amp based subtractor circuit.

An op-amp based subtractor produces an output equal to the difference of the input voltages applied at its inverting and non-inverting terminals. It is also called as a **difference amplifier**, since the output is an amplified one.

The **circuit diagram** of an op-amp based subtractor is shown in the following figure −

Now, let us find the expression for output voltage V0V0 of the above circuit using **superposition theorem** using the following steps −

### Step 1

Firstly, let us calculate the output voltage V01V01 by considering only V1V1.

For this, eliminate V2V2 by making it short circuit. Then we obtain the **modified circuit diagram** as shown in the following figure −

Now, using the **voltage division principle**, calculate the voltage at the non-inverting input terminal of the op-amp.

Now, the above circuit looks like a non-inverting amplifier having input voltage VpVp. Therefore, the output voltage V01V01 of above circuit will be

Substitute, the value of VpVp in above equation, we obtain the output voltage V01V01 by considering only V1V1, as −

### Step 2

In this step, let us find the output voltage, V02V02 by considering only V2V2. Similar to that in the above step, eliminate V1V1 by making it short circuit. The **modified circuit diagram** is shown in the following figure.

You can observe that the voltage at the non-inverting input terminal of the op-amp will be zero volts. It means, the above circuit is simply an **inverting op-amp**. Therefore, the output voltage V02V02 of above circuit will be −

### Step 3

In this step, we will obtain the output voltage V0V0 of the subtractor circuit by **adding the output voltages** obtained in Step1 and Step2. Mathematically, it can be written as

Substituting the values of V01V01 and V02V02 in the above equation, we get −

If Rf=R1=R2=R3=RRf=R1=R2=R3=R, then the output voltage V0V0 will be

Thus, the op-amp based subtractor circuit discussed above will produce an output, which is the difference of two input voltages V1V1 and V2V2, when all the resistors present in the circuit are of same value.