More Related Content Similar to ECE 468 Lab Project 2 (15) More from Lakshmi Yasaswi Kamireddy (11) ECE 468 Lab Project 21. Lab Project2
Lakshmi Yasaswi Kamireddy
651771619
Part I
The objective of the firstpartof the laboratoryassignmentistoworkwiththe subcircuit of CCVSand to observe the
transferfunctionof the circuitinFigure1.
Figure 1
1. NetlistRepresentationinHspice
******************************************************
**** optionssection
******************************************************
.optionspost=1
******************************************************
**** subcircuitsection
******************************************************
.subcktmy_ccvsin+ in- outref
.paramtransresistance=100
Ra in+ int 1e-3
vsensint in- dc 0V
H1 outref vsensMAX=5V MIN=-5V transresistance
.ends
******************************************************
****circuit description
******************************************************
rsparin inp 50
x1 inp inm outgnd my_ccvs
rfparoutinm 10k
r2par inm gnd 1k
c2par inm gnd 10p
roparoutino 1k
clpar ino gnd 100p
in
inp
inm
gnd
gnd
gnd
gnd
out ino
3. Figure 3
5. As seenfromthe Figure 4 we can observe thatgreaterthe value of R greaterwill be the outputat the CCVS. As
the voltage acrossCCVSincreasesthe outputof the circuitalso increasesandhence the gainalsoincreaseswith
increase intransresistance.Thiscanbe observedinFigure 2.
Figure 4
Part II
The main objective of thispartof the labis to getusedto the circuitsdesignedusingthe opampsassubcircuits.
An invertingamplifieranda lowpassfilterare designed.
A.
1. The figure showsthe netlist
Figure 5
0
20
40
60
80
0 2000 4000 6000 8000 10000 12000
dB
Frequency
Output at the CCVS
TF1 TF2 TF3 TF4 TF5
inm
out
in
4. 2. Hpsice netlist
******************************************************
**** optionssection
******************************************************
.optionspost=1
******************************************************
**** subcircuitsection taken fromthehandout
******************************************************
.subcktmy_opamp in+in- out gain=opamp_gain
Rin in+ in- 1G
Routout A0v 1m
E1 A0v 0 in+ in- gain MAX=12 MIN=-12
.ends
******************************************************
**** circuit description
******************************************************
r1 in inm 2k
x1 gnd inm outmy_opamp gain=opamp_gain
r2 outinm 4k
******************************************************
**** parameterssection
******************************************************
.paramopamp_gain=2e5
******************************************************
**** sourcessection
******************************************************
v1 in gnd sin(0V 2.5V 10k)
******************************************************
**** specify nominaltemperatureof circuit in degreesC
******************************************************
.TEMP= 27
******************************************************
**** analysissection
******************************************************
.tran 0.01ms 2ms
.printV(out) V(in)
.printV(in)
.END
5. 3. Results:
Figure 6
B.
4. The figure showsthe netlist
Figure 7
5. Hspice Netlist
******************************************************
**** optionssection
******************************************************
.optionspost=1
******************************************************
**** subcircuitsection
******************************************************
-6
-4
-2
0
2
4
6
0 0.2 0.4 0.6 0.8 1 1.2
Voltage
Time(ms)
Opamp inverting amplifier
Vout Vin
out
inmin
gndgnd
6. .subcktmy_opamp in+in- out gain=opamp_gain
Rin in+ in- 1G
Routout A0v 1m
E1 A0v 0 in+ in- gain MAX=12 MIN=-12
.ends
******************************************************
**** circuit description
******************************************************
r1 in inm 500
x1 inm gnd outmy_opamp gain=opamp_gain
r2 outinm 2.5k
c1 outinm 0.01u
******************************************************
**** parameterssection
******************************************************
.paramopamp_gain=2e5
******************************************************
**** sourcessection
******************************************************
v1 in gnd ac0.5V
******************************************************
**** specify nominaltemperatureof circuit in degreesC
******************************************************
.TEMP= 27
******************************************************
**** analysissection
******************************************************
.ac dec 100 1k 100k
.printac gaindB=par('20*log10(v(out)/v(in))')
.printv(out) v(in)
.END
6. Results:
Figure 8 showsthat approximatelyfrom6KHZthe gainstarts fallingandapproximatelyat30 KHz the gain is
zero.Until 6Khz the gain isaround13.9 whichmatcheswiththe theoretical results.
The transferfunctionanalysisshowsthatthe circuitacts as a Low passfilter.
7. Figure 8:
Appendix:
Part 1:
freq TF1 TF2 TF3 TF4 TF5
0.01 20.8277 20.8268 20.8185 20.7365 19.9565
0.012589 20.8276 20.8267 20.8184 20.7364 19.9564
0.015849 20.8274 20.8265 20.8183 20.7363 19.9563
0.019953 20.8272 20.8263 20.818 20.736 19.956
0.025119 20.8268 20.8259 20.8176 20.7356 19.9556
0.031623 20.8261 20.8252 20.817 20.735 19.955
0.039811 20.8252 20.8242 20.816 20.734 19.954
0.050119 20.8236 20.8227 20.8144 20.7324 19.9524
0.063096 20.8211 20.8202 20.8119 20.7299 19.9499
0.079433 20.8171 20.8162 20.808 20.726 19.946
0.1 20.8109 20.81 20.8017 20.7197 19.9397
0.125893 20.801 20.8001 20.7918 20.7098 19.9298
0.158489 20.7853 20.7844 20.7762 20.6942 19.9142
0.199526 20.7607 20.7598 20.7515 20.6695 19.8895
0.251189 20.7219 20.721 20.7127 20.6307 19.8507
0.316228 20.6611 20.6602 20.652 20.57 19.7899
0.398107 20.5665 20.5656 20.5574 20.4754 19.6954
0.501187 20.4208 20.4199 20.4116 20.3296 19.5496
0.630957 20.1995 20.1986 20.1904 20.1084 19.3284
0.794328 19.8708 19.8699 19.8617 19.7797 18.9997
1 19.3969 19.396 19.3878 19.3058 18.5258
1.25893 18.7399 18.739 18.7307 18.6487 17.8687
1.58489 17.8712 17.8702 17.862 17.78 17
-15
-10
-5
0
5
10
15
20
0 20000 40000 60000 80000 100000 120000
dB
Frequency
Transfer Function
8. 1.99526 16.7817 16.7808 16.7726 16.6906 15.9106
2.51189 15.4869 15.486 15.4778 15.3958 14.6158
3.16228 14.0231 14.0222 14.014 13.932 13.152
3.98107 12.4393 12.4384 12.4301 12.3481 11.5681
5.01187 10.7891 10.7882 10.7799 10.6979 9.9179
6.30957 9.1267 9.1258 9.1176 9.0356 8.2555
7.94328 7.5063 7.5054 7.4971 7.4151 6.6351
10 5.9819 5.981 5.9728 5.8908 5.1107
12.58925 4.6055 4.6046 4.5964 4.5144 3.7343
15.84893 3.4203 3.4194 3.4112 3.3292 2.5491
19.95262 2.4519 2.451 2.4427 2.3607 1.5806
25.11886 1.7021 1.7012 1.6929 1.6109 0.830702
31.62278 1.1501 1.1492 1.1409 1.0589 0.278569
39.81072 0.7608655 0.759959 0.751716 0.669712 -0.11086
50.11872 0.495614 0.494706 0.486464 0.404456 -0.37643
63.09573 0.3193391 0.318432 0.31019 0.228175 -0.55322
79.43282 0.2042487 0.203342 0.195099 0.113075 -0.66913
100 0.1300016 0.129094 0.120852 0.038813 -0.74467
125.8925 0.0824821 0.081575 0.073331 -0.00873 -0.79424
158.4893 0.0522241 0.051317 0.043073 -0.03903 -0.82774
199.5262 0.0330223 0.032115 0.023871 -0.05829 -0.85209
251.1886 0.0208616 0.019954 0.01171 -0.07055 -0.87238
316.2278 0.0131719 0.012265 0.004017 -0.0784 -0.89293
398.1072 0.0083116 0.007405 -0.00084 -0.0835 -0.91809
501.1872 0.0052434 0.004336 -0.00392 -0.08696 -0.95314
630.9573 0.003305 0.002398 -0.00586 -0.08951 -1.0053
794.3282 0.002082 0.001175 -0.00709 -0.09171 -1.0849
1000 0.0013105 0.000403 -0.00788 -0.09403 -1.2072
1258.93 0.00082389 -8.4E-05 -0.00839 -0.09697 -1.3934
1584.89 0.00051601 -0.00039 -0.00874 -0.10116 -1.6728
1995.26 0.00032231 -0.00059 -0.009 -0.1075 -2.0816
2511.89 0.00019963 -0.00071 -0.00922 -0.11735 -2.6595
3162.28 0.00012287 -0.00079 -0.00945 -0.1328 -3.4421
3981.07 7.3986E-05 -0.00084 -0.00975 -0.15709 -4.4504
5011.87 4.3195E-05 -0.00087 -0.01018 -0.19528 -5.6836
6309.57 2.3927E-05 -0.0009 -0.01083 -0.25509 -7.1193
7943.28 1.1659E-05 -0.00092 -0.01184 -0.34822 -8.7214
10000 4.1913E-06 -0.00095 -0.01342 -0.49182 -10.4501
Part 2:
1.
Time(ms) Vout Vin
0 0 0
0.01 -2.9327 1.4664
0.02 -4.7308 2.3655
0.03 -4.7439 2.372
0.04 -2.9305 1.4653
0.05 1.6081E-15 -8E-16
0.06 2.9365 -1.4683
9. 0.07 4.7308 -2.3654
0.08 4.7439 -2.372
0.09 2.9305 -1.4653
0.1 -3.2162E-15
1.61E-
15
0.11 -2.9365 1.4683
0.12 -4.7308 2.3654
0.13 -4.7439 2.372
0.14 -2.9305 1.4653
0.15 7.0447E-15 -3.5E-15
0.16 2.9365 -1.4683
0.17 4.7308 -2.3654
0.18 4.7439 -2.372
0.19 2.9305 -1.4653
0.2 -6.4324E-15
3.22E-
15
0.21 -2.9365 1.4683
0.22 -4.7308 2.3654
0.23 -4.7439 2.372
0.24 -2.9305 1.4653
0.25 -3.0616E-15
1.53E-
15
0.26 2.9365 -1.4683
0.27 4.7308 -2.3654
0.28 4.7439 -2.372
0.29 2.9305 -1.4653
0.3
-1.40894E-
14
7.04E-
15
0.31 -2.9365 1.4683
0.32 -4.7308 2.3654
0.33 -4.7439 2.372
0.34 -2.9305 1.4653
0.35 1.34771E-14 -6.7E-15
0.36 2.9365 -1.4683
0.37 4.7308 -2.3654
0.38 4.7439 -2.372
0.39 2.9305 -1.4653
0.4
-1.28648E-
14
6.43E-
15
0.41 -2.9365 1.4683
0.42 -4.7308 2.3654
0.43 -4.7439 2.372
0.44 -2.9305 1.4653
0.45 1.22525E-14 -6.1E-15
0.46 2.9365 -1.4683
0.47 4.7308 -2.3654
0.48 4.7439 -2.372
0.49 2.9305 -1.4653
0.5 6.1231E-15 -3.1E-15
10. 0.51 -2.9365 1.4683
0.52 -4.7308 2.3654
0.53 -4.7439 2.372
0.54 -2.9305 1.4653
0.55 1.10278E-14 -5.5E-15
0.56 2.9365 -1.4683
0.57 4.7308 -2.3654
0.58 4.7439 -2.372
0.59 2.9305 -1.4653
0.6
-2.81788E-
14
1.41E-
14
0.61 -2.9365 1.4683
0.62 -4.7308 2.3654
0.63 -4.7439 2.372
0.64 -2.9305 1.4653
0.65 9.8032E-15 -4.9E-15
0.66 2.9365 -1.4683
0.67 4.7308 -2.3654
0.68 4.7439 -2.372
0.69 2.9305 -1.4653
0.7
-2.69542E-
14
1.35E-
14
0.71 -2.9365 1.4683
0.72 -4.7308 2.3654
0.73 -4.7439 2.372
0.74 -2.9305 1.4653
0.75 1.02166E-14 -5.1E-15
0.76 2.9365 -1.4683
0.77 4.7308 -2.3654
0.78 4.7439 -2.372
0.79 2.9305 -1.4653
0.8 8.1591E-15 -4.1E-15
0.81 -2.9365 1.4683
0.82 -4.7308 2.3654
0.83 -4.7439 2.372
0.84 -2.9305 1.4653
0.85 8.9919E-15 -4.5E-15
0.86 2.9365 -1.4683
0.87 4.7308 -2.3654
0.88 4.7439 -2.372
0.89 2.9305 -1.4653
0.9 -2.6143E-14
1.31E-
14
0.91 -2.9365 1.4683
0.92 -4.7308 2.3654
0.93 -4.7439 2.372
0.94 -2.9305 1.4653
0.95 4.32939E-14 -2.2E-14
11. 0.96 2.9365 -1.4683
0.97 4.7308 -2.3654
0.98 4.7439 -2.372
0.99 2.9305 -1.4653
1 8.9702E-15 -4.5E-15
1.01 -2.9365 1.4683
1.02 -4.7308 2.3654
1.03 -4.7439 2.372
1.04 -2.9305 1.4653
1.05 7.59579E-14 -3.8E-14
1.06 2.9365 -1.4683
1.07 4.7308 -2.3654
1.08 4.7439 -2.372
1.09 2.9305 -1.4653
1.1
-2.53318E-
14
1.27E-
14
1.11 -2.9365 1.4683
1.12 -4.7308 2.3654
1.13 -4.7439 2.372
1.14 -2.9305 1.4653
2.
10 13.9797
10.23293 13.9796
10.47129 13.9796
10.71519 13.9796
10.96478 13.9796
11.22018 13.9796
11.48154 13.9796
11.74898 13.9796
12.02264 13.9796
12.30269 13.9796
12.58925 13.9796
12.8825 13.9796
13.18257 13.9796
13.48963 13.9796
13.80384 13.9796
14.12538 13.9796
14.4544 13.9796
14.79108 13.9796
15.13561 13.9796
15.48817 13.9796
15.84893 13.9796
16.2181 13.9796
16.59587 13.9796
16.98244 13.9796
17.37801 13.9796
17.78279 13.9796
12. 18.19701 13.9796
18.62087 13.9796
19.05461 13.9796
19.49845 13.9796
19.95262 13.9796
20.41738 13.9796
20.89296 13.9796
21.37962 13.9796
21.87762 13.9796
22.38721 13.9796
22.90868 13.9796
23.44229 13.9796
23.98833 13.9796
24.54709 13.9796
25.11886 13.9796
25.70396 13.9796
26.30268 13.9796
26.91535 13.9796
27.54229 13.9796
28.18383 13.9796
28.84032 13.9796
29.51209 13.9796
30.19952 13.9796
30.90295 13.9796
31.62278 13.9796
32.35937 13.9795
33.11311 13.9795
33.88442 13.9795
34.67369 13.9795
35.48134 13.9795
36.30781 13.9795
37.15352 13.9795
38.01894 13.9795
38.90451 13.9795
39.81072 13.9795
40.73803 13.9795
41.68694 13.9795
42.65795 13.9795
43.65158 13.9795
44.66836 13.9794
45.70882 13.9794
1949.84 13.5902
1995.26 13.5727
2041.74 13.5544
2089.3 13.5354
2137.96 13.5155
2187.76 13.4948
2238.72 13.4733
13. 2290.87 13.4508
2344.23 13.4274
2398.83 13.403
2454.71 13.3777
2511.89 13.3512
2570.4 13.3238
2630.27 13.2952
2691.53 13.2654
2754.23 13.2345
2818.38 13.2023
2884.03 13.1689
2951.21 13.1342
3019.95 13.0982
3090.3 13.0607
3162.28 13.0219
3235.94 12.9815
3311.31 12.9397
3388.44 12.8963
3467.37 12.8514
3548.13 12.8048
3630.78 12.7566
3715.35 12.7066
3801.89 12.6549
3890.45 12.6015
3981.07 12.5462
4073.8 12.489
4168.69 12.4299
4265.8 12.3689
4365.16 12.306
4466.84 12.241
4570.88 12.174
4677.35 12.1049
4786.3 12.0337
4897.79 11.9605
5011.87 11.885
5128.61 11.8074
5248.07 11.7276
5370.32 11.6455
5495.41 11.5613
5623.41 11.4747
5754.4 11.3859
5888.44 11.2949
6025.6 11.2015
6165.95 11.1058
6309.57 11.0079
6456.54 10.9076
6606.93 10.8051
6760.83 10.7002
14. 6918.31 10.593
7079.46 10.4836
7244.36 10.3719
7413.1 10.2579
7585.78 10.1417
7762.47 10.0232
28183.83 0.840938
28840.32 0.650436
29512.09 0.459527
30199.52 0.268226
30902.95 0.07655
31622.78 -0.11549
32359.37 -0.30787
33113.11 -0.50058
33884.42 -0.6936
34673.69 -0.88693
35481.34 -1.0806
36307.81 -1.2745
37153.52 -1.4686
38018.94 -1.663
38904.51 -1.8577
39810.72 -2.0526
40738.03 -2.2477
41686.94 -2.4431
42657.95 -2.6386
43651.58 -2.8344
44668.36 -3.0303
45708.82 -3.2264
46773.51 -3.4227
47863.01 -3.6191
48977.88 -3.8157
50118.72 -4.0125
51286.14 -4.2094
52480.75 -4.4064
53703.18 -4.6036
54954.09 -4.8008
56234.13 -4.9983
57543.99 -5.1958
58884.37 -5.3934
60255.96 -5.5912
61659.5 -5.789
63095.73 -5.9869
64565.42 -6.185
66069.34 -6.3831
67608.3 -6.5813
69183.1 -6.7796
70794.58 -6.9779
72443.6 -7.1764