# Given data
Vin1= 5 # in µV
Vin1= Vin1*10**-6 # in V
Vin2= -7 #in µV
Vin2= Vin2*10**-6 # in V
Av= 2*10**5 # unit less
Rin= 2 # in MΩ
Vout= (Vin1-Vin2)*Av # in V
print "The output voltage = %0.1f volts" %Vout
from __future__ import division
# Given data
Rs= 2 # in kΩ
RL= 5 # in kΩ
A= 10**5 # unit less
Rin= 100 #in kΩ
Rout= 50 # in Ω
Vout= 10 # in V
# For Vout = 10 V, V1= V2 = Vout
V1= Vout # in V
V2= V1 # in V
# From equation V1= Vs*Rin/(Rin+Rs)
Vs= V1*(Rin+Rs)/Rin # in V
Vout_by_Vs= Vout/Vs # value of Vout/Vs
print "The value of Vs =%0.1f volts" %Vs
print "The value of Vout/Vs = %0.2f" %Vout_by_Vs
print "The input resistance of the circuit = %0.f kΩ" %Rin
import math
# Given data
Ad= 100 # differential mode gain
Acm= 0.01 # common mode gain
CMRR= Ad/Acm
CMRR_desh= 20*math.log(CMRR,10) # CMRR in dB
print "CMRR = %0.f dB" %CMRR_desh
# Given data
Ad= 10**5 # differential mode gain
CMRR= 10**5
# Common-mode gain,
Acm= Ad/CMRR
print "The common-mode gain = %0.f" %Acm
# Given data
V1= 10 # in mV
V2= 9 # in mV
Ad= 60 # differential voltage gain in dB
Ad= 10**(Ad/20)
CMRR= 80 # in dB
CMRR= 10**(CMRR/20)
Vd= V1-V2 # difference signal in mV
Vcm= (V1+V2)/2 # common-mode signal in mV
# Output voltage,
Vout= Ad*Vd*(1+1/CMRR*Vcm/Vd) # in mV
AdVd= Ad*Vd # in mV
# Error voltage
Verror= Vout-AdVd # in mV
Per_error= Verror/Vout*100 # percentage error
print "The error voltage = %0.2f mV" %Verror
print "The percentage error in the output voltage = %0.3f " %Per_error
# Given data
V1= 745 # in µV
V2= 740 # in µV
Ad= 5*10**5 # differential voltage gain
CMRR= 80 # in dB
CMRR= 10**(CMRR/20)
Vd= V1-V2 # difference signal in µV
Vcm= (V1+V2)/2 # common-mode signal in µV
# Output voltage,
Vout= Ad*Vd*(1+1/CMRR*Vcm/Vd) # in µV
AdVd= Ad*Vd # in µV
# Error voltage
Verror= Vout-AdVd # in µV
Vout= Vout*10**-6 # in V
Verror= Verror*10**-6 # in V
Per_error= Verror/Vout*100 # percentage error
print "The output voltage = %0.6f V" %Vout
print "The percentage error in the output voltage= %0.4f" %Per_error
# Given data
Vd= 25 #differential input voltage in µV
Vd= Vd*10**-6 # in V
A= 200000 # open loop gain
# Output voltage,
Vout= A*Vd # in V
print "The output voltage = ± %0.f " %Vout
# Given data
dVout= 20 # change in output voltage in V
dt= 4 # change in time in µs
SR= dVout/dt # slew rate in V/µs
print "The slew rate = %0.f V/µs" %SR
# Given data
IB1= 10 # in µA
IB2= 7.5 # in µA
# Input bias current,
I_in_bias= (IB1+IB2)/2 # in µA
# Input offset current,
I_in_offset= IB1-IB2 # in µA
print "The input bias current = %0.2f µA" %I_in_bias
print "The input offset current = %0.1f µA" %I_in_offset
from numpy import pi
# Given data
SR= 6 # slew rate in V/µs
SR= 6*10**6 # in V/s
# Part (i) For Vmax= 1V
Vmax= 1 # in V
fmax= SR/(2*pi*Vmax) # limiting frequency in Hz
fmax= fmax*10**-6 # in MHz
print "Part (i) : The limiting frequency for maximum voltage of 1V = %0.3f MHz" %fmax
# Part (ii) For Vmax= 10V
Vmax= 10 # in V
fmax= SR/(2*pi*Vmax) # limiting frequency in Hz
fmax= fmax*10**-3 # in kHz
print "Part (ii) : The limiting frequency for maximum voltage of 10V = %0.1f kHz"%fmax
# Given data
Vpp= 3 # output voltage in V
del_t= 4 # in µs
del_V= 90*Vpp/100-10*Vpp/100 # in V
# Required slew rate,
SR= del_V/del_t # in V/µs
print "The required slew rate = %0.1f V/µs" %SR