In [1]:

```
#INPUT DATA
CMRR = 10**5; #common-mode rejection ratio
Ad = 10**5; #differential gain
#CALCULATIONS
Acm = Ad/(CMRR); #common mode gain
print "common-mode gain is %d"%(Acm);
```

In [2]:

```
#INPUT DATA
V0 = 20; #voltage in volts
t = 4; #time in microsec
#SLEW RATE
SR = (V0)/t; #slewrate in V/us
print "slewrate is %d V/us"%(SR);
```

In [3]:

```
import math
#INPUT DATA
A = 50; #gain of inverting amplifier
Vid = 20*10**-3; #voltage in V
SR = 0.5; #slewrate in V/us----->SR = (2*math.pi*f*Vm)/(10**6)
#CALCULATIONS
Vm = A*(Vid); #maximum output voltage in V
fmax = (SR*10**6)/(2*math.pi*Vm); #frequency in hz
print "thus maximum frequency of the input for which undistorted output is obtained is %g hz"%(fmax);
```

In [4]:

```
import math
#INPUT DATA
A = 10; #gain of inverting amplifier
f = 40*10**3; #frequency in hz
SR = 0.5; #slewrate in V/us----->SR = (2*math.pi*f*Vm)/(10**6)
#CALCULATIONS
Vm = (SR*10**6)/(2*math.pi*f); #maximum output voltage in V peak
Vm = 2*Vm; #maximum output voltage in V peak to peak
Vid = Vm/A; #maximum peak-to-peak input voltage for undistorted output
print "Thus maximum peak-to-peak input voltage for undistorted output is %1.3f V peak-to-peak"%(Vid);
```

In [6]:

```
#INPUT DATA
Rf = 10.*10**3; #feedback resistance in ohms
R1 = 1*10**3; #resistance in ohms
#CALCULATIONS
Af = -(Rf/R1); #closed-loop voltage gain for inverting amplifier
print "Thus closed-loop voltage gain is %d"%(Af);
```

In [7]:

```
#INPUT DATA
Rf = 10.*10**3; #forward resistance in ohms
R1 = 1.*10**3; #resistance in ohms
#CALCULATIONS
Af = 1+(Rf/R1); #closed-loop voltage gain in non-inverting amplifier
b = (R1/(R1+Rf)); #feedback factor
print "Thus closed-loop voltage gain and feedback factor are %d and %1.3f respectively"%(Af,b);
```

In [8]:

```
#INPUT DATA
V1 = 2.; #input voltage 1 of summing amplifier in V
V2 = 3.; #input voltage 2 of summing amplifier in V
V3 = 4.; #input voltage 3 of summing amplifier in V
R1 = 1.; #resistance 1 of summing amplifier in kilo ohms
R2 = 1.; #resistance 2 of summing amplifier in kilo ohms
R3 = 1.; #resistance 3 of summing amplifier in kilo ohms
Rf = 1.; #feedback resistance in kilo ohms
R = 1.; #resistance in kilo ohms
#CALCULATIONS
V0 = (-Rf/R)*(V1+V2+V3); #output voltage in volts
# result
print "Thus output voltage is %d V"%(V0);
```