In [2]:

```
#given
vout=750*10**-3
vin = 30*10**-6
#calculation
gain=vout/vin
#Result
print"The Voltage gain of the amplifier is ",gain
```

In [3]:

```
#given
pout=6
power_gain=80.0
#calculation
pin=pout/power_gain
#Result
print"The input power of the signal is ",pin*1000,"mW"
```

In [4]:

```
#given
A1=5;
A2=2;
A3=17;
total_gain=A1*A2*A3;
pin= 40*10**-3;
#calculation
pout=total_gain*pin;
#Result
print"The output power is",pout,"watts"
```

In [7]:

```
#given
pin=25.0*10**-6;
pout=1.5*10**-3;
A1=3.0;
#Calculation
total_gain=pout/pin;
print"Total gain is",total_gain
A2=total_gain/A1
#Result
print"The gain of second stage is ",A2
```

In [7]:

```
#given
R1=10.0*10**3;
R2=470.0;
#Calculation
attenuation=R2/(R2+R1)
A2=1/attenuation
#Result
print"(a) The attenuation (A1) is",round(attenuation,3)
print"(b) The attenuation (A2) is",round(A2,1)
```

In [6]:

```
#given
Vin=20.0*10**-6;
Vout=100*10**-3;
A1=45000.0 #A1 isAmplifier gain
#calculation
AT=Vout/Vin #AT is Total gain
A2=AT/A1 #A2 is attenuation factor
#Result
print"Total gain is",AT
print"The atenuation factor needed to to keep the output voltage from exceeding 100 mv is ",round(A2,4)
```

In [11]:

```
#given
Vin=3.0*10**-3
Vout=5
Pin=50.0*10**-3
Pout=2*10**-3
#calculation
import math
gain_dB= 20*log10 (Vout/Vin)
gain_db=10*log10 (Pout/Pin)
#Result
print"(a) The gain of amplifier in dB is ",round(gain_dB,1)
print"(b) The gain in dB is ",round(gain_db,2)
```

In [19]:

```
#given
gain_dB = 40
pout_W= 100
#calculation
pin_W = pout_W/10.0**4
#Result
print"The input power is ",pin_W,"Watt"
```

In [21]:

```
#given
gain_db = 60
vin = 50*10**-6
#calculation
vout = 10**(60/20.0)*vin
#Result
print"The output voltage is ",vout,"volt"
```

In [13]:

```
#given
vin=90*10**-3
R1= 10.0*10**3
vout=7.8
Rout=8.0
#calculation
pin= vin**2/R1
pout=vout**2/Rout
import math
Ap_db = 10*log10 (pout/pin)
#Result
print"The power gain in decibel is ",round(Ap_db,1),"dB"
```

In [14]:

```
#given
gain_db = 28
pin = 36*10**-3
#calculation
pout = 10**2.8*pin;
#Result
print"The output power is ",round(pout,2),"watt"
```

In [15]:

```
#given
gain1 = 6.8
gain2 = 14.3
attenuation1 = -16.4
attenuation2 = -2.9
vout = 800*10**-3
#calculation
At = gain1+gain2+attenuation1+attenuation2
vin = vout/10.0**(At/20.0)
#Result
print"The input voltage is ",round(vin*10**3,1),"mv"
```

In [16]:

```
#given
pout_db =12.3
#calculation
pout_mW = 0.001*10**(12.3/10.0)
#Result
print"The output power is " ,round(pout_mW*10**3,0),"mv"
```

In [19]:

```
#given
c = 2.7*10**-12
l = 33*10**-9
#calculation
fr= 1/(6.28*(l*c)**0.5)
#Result
print"The resonat frequency is " ,round(fr/10.0**6,0),"Mhz"
```

In [20]:

```
#given
c =12*10**-12
fr = 49*10**6
#calculation
l=1/(4*3.14**2*fr**2*c)
#Result
print"The value of inductance is " ,round(l*10**9,0),"nh"
```

In [6]:

```
#given
fr=28*10**6
Q=70.0
#calculation
bandwidth = fr/Q
#Result
print"The bandwidth is ",bandwidth/10.0**3,"Khz"
```

In [23]:

```
#given
f1= 7.93*10**6
f2= 8.07*10**6
#calculation
bw= f2-f1
fr=(f1*f2)**0.5
Q= fr/bw
#Result
print"(a) The bandwidth is ",bw/10.0**3,"Khz"
print"(b) The resonant frequency is ",round(fr/10.0**6,0),"Mhz"
print"(c) The Q of resonant circuit is ",round(Q,2)
```

In [30]:

```
#given
Q=200.0
fr=16*10**6
#calculation
bw=fr/Q
f1= fr-(bw/2)
f2=fr+(bw/2)
#Result
print"Bandwidth is ",bw*10**-3,"KHz"
print"f1= ",f1*10**-6,"MHz"
print"f2= ",f2*10**-6,"MHz"
```

In [9]:

```
#given
Q= 150
Vs=3*10**-6
#calculation
Vc= Q*Vs
#Result
print"The voltage across capacitor is ",Vc*10**6,"microvolt"
```

In [10]:

```
#given
fr= 52*10**6
Q=12.0
L=0.15*10**-6
#calculation
Rw=(6.28*fr*L)/Q
Req= Rw*(Q**2+1)
#Result
print"Impedance of the parellel LC circuit is ",round(Req,0),"ohm"
```

In [13]:

```
#given
fr= 52.0*10**6
Rw= 4.1
L =0.15*10**-6
#calculation
C=1/(4.0*3.14**2*fr**2*L)
Z = L/(C*Rw)
#Result
print"the impedance of the circuit is ",round(Z,0),"ohm"
```

In [17]:

```
#given
bw = 1.0*10**6
XL = 300
Rw = 10.0
fr =10*10**6
#calculation
Q1 = XL/Rw
Rp = Rw*(Q1**2+1)
Q2 = fr/bw
Rpnew = Q2*XL
Rext = (Rpnew*Rp)/(Rp-Rpnew)
#Result
print"The value of resistor needed to set the bandwidth of the parellel tuned circuit is ",round(Rext,1),"ohm"
```

In [18]:

```
#given
R = 8.2*10**3
C =0.0033*10**-6
#calculation
fco = 1/(6.28* R*C)
#Result
print"The cut off frequency is ",round(fco/10.0**3,2),"Khz"
```

In [19]:

```
#given
fco =3.4*10**3
C = 0.047*10**-6
#calculation
R = 1/(6.28* fco* C)
#Result
print"The value of the resistor is ",round(R,0),"ohm"
print"The closest standard value is ", 1000 ,"ohm"
```

In [20]:

```
#given
fnotch = 120
R = 220*10**3
#calculatiuon
C = 1/(6.28*R*fnotch)
#Result
print"The value of capacitance required is ",round(2*C*10**6,3),"microfarad"
```

In [22]:

```
#given
Vpeak =3.0
f=48*10**3
#calculation
fifth_harmonic = 5*f
Vrms=(4/3.14)*(3/5.0)*0.707
#Result
print"(a) The frequency of the fifth harmonic is ",fifth_harmonic/10.0**3,"Khz"
print"The RMS voltage of the fifth harmonic is ",round(Vrms,3)
```

In [25]:

```
#given
Vpeak = 5
f = 4.0*10**6
duty_cycle=0.3
#calculation
T = 1/f
t0 = duty_cycle*T
Vavg = Vpeak*duty_cycle
min_bw =1/t0
#Result
print"(a) The average DC value is ",Vavg,"volt"
print"(b) The minimum bandwidth required is " ,round(min_bw/10.0**6,3),"Mhz"
```

In [26]:

```
#given
tr =6*10**-9
#calculation
min_bw=(35/0.006)
#Result
print"The minimum bandwidth is % is ",round(min_bw/10.0**2,1),"Mhz"
```

In [31]:

```
#given
bw= 200.0*10**3
#calculation
tr= 0.35/(bw*10**-3)
#Result
print"The fastest rise time of the circuit is " ,tr*10**3,"microseconds"
```

In [27]:

```
#given
bw_mhz = 60
tri_ns= 15
#calculation
tra_osci = 0.35/(bw_mhz)
tra_comp = 1.1*(tri_ns**2 + (tra_osci*10**3)**2)**0.5
#Result
print"The rise time of the displayed square wave is ",round(tra_comp,1),"ns"
```