Current mirror ( widlar and cascode) asking for help

Status
Not open for further replies.

Devi92

Newbie level 5
Joined
Dec 2, 2017
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
69
Can anyone know what is the error in this code? and i don't know how to plot

can anyone know how to slove this attachment? I did the example code but there is an error. I can't plot. Anybody can help me? If there is simplier example please guide me

Code:
*** SPICE DECK created from mirr2.sim, tech=scmos
.subckt mirror 1 6 4
* Node order: vdd out vbias
* This subcircuit defines the two transistor CMOS current mirror on the test chip
M1 1 4 5 1 CMOSP L=5.0U W=25.0U
M2 6 5 0 0 CMOSN L=2.0U W=220.0U
M3 5 5 0 0 CMOSN L=2.0U W=122.0U
C4 5 0 0.353000PF
C5 6 0 0.471000PF
C6 4 0 0.011000PF
* GND 0
* OUT 6
* Vdd 1
* Vin 4
.ends
vdd 1 0 dc 5
* The "xi" calls are subcircuit calls
* Current mirrors with varying resistance values
x1 1 3 2 mirror
r100k 1 3 100k
x2 1 4 2 mirror
r500k 1 4 500k
x3 1 5 2 mirror
r1k 1 5 1k
x4 1 6 2 mirror
r10k 1 6 10k
x5 1 7 2 mirror
r50k 1 7 50k
vbias 2 0
.dc vbias 0 5 .1
* The following "probe" line is for those using PSPICE with PROBE Option
.probe
* Plot the currents from 0 to 0.5 mA
.plot dc i(r10k) i(r20k) i(r50k) i(r100k) i(r500k) (0,0.5e-3)
.print dc i(r10k) i(r20k) i(r50k) i(r100k) i(r500k) (0,0.5e-3)
* These SCN-2.0um parameters taken from MOSIS
.MODEL CMOSN NMOS LEVEL=2 LD=0.250000U TOX=408.000001E-10
+ NSUB=6.264661E+15 VTO=0.77527 KP=5.518000E-05 GAMMA=0.5388
+ PHI=0.6 UO=652 UEXP=0.100942 UCRIT=93790.5
+ DELTA=1.000000E-06 VMAX=100000 XJ=0.250000U LAMBDA=2.752568E-03
+ NFS=2.06E+11 NEFF=1 NSS=1.000000E+10 TPG=1.000000
+ RSH=31.020000 CGDO=3.173845E-10 CGSO=3.173845E-10 CGBO=4.260832E-10
+ CJ=1.038500E-04 MJ=0.649379 CJSW=4.743300E-10 MJSW=0.326991 PB=0.800000
.MODEL CMOSP PMOS LEVEL=2 LD=0.213695U TOX=408.000001E-10
+ NSUB=5.574486E+15 VTO=-0.77048 KP=2.226000E-05 GAMMA=0.5083
+ PHI=0.6 UO=263.253 UEXP=0.169026 UCRIT=23491.2
+ DELTA=7.31456 VMAX=17079.4 XJ=0.250000U LAMBDA=1.427309E-02
+ NFS=2.77E+11 NEFF=1.001 NSS=1.000000E+10 TPG=-1.000000
+ RSH=88.940000 CGDO=2.712940E-10 CGSO=2.712940E-10 CGBO=3.651103E-10
+ CJ=2.375000E-04 MJ=0.532556 CJSW=2.707600E-10 MJSW=0.252466 PB=0.800000
.end
 

Attachments

  • current mirrors_home_work.pdf
    165.1 KB · Views: 120

Re: current mirror ( widlar and cascode) asking for help

Which simulator did you use? What's the error message?
 
Reactions: Devi92

    Devi92

    Points: 2
    Helpful Answer Positive Rating
Re: current mirror ( widlar and cascode) asking for help

I am using PSPICE AD lite software.
Do I need to ignore those two line?? when I write all comment there is error but when I ignore those two lines it work.

Code ActionScript - [expand]
1
2
.plot dc i(r10k) i(r20k) i(r50k) i(r100k) i(r500k) (0,0.5e-3)
.print dc i(r10k) i(r20k) i(r50k) i(r100k) i(r500k) (0,0.5e-3)


AND
I don't understand this part.


Code ActionScript - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
x1 1 3 2 mirror
r100k 1 3 100k
x2 1 4 2 mirror
r500k 1 4 500k
x3 1 5 2 mirror
r1k 1 5 1k
x4 1 6 2 mirror
r10k 1 6 10k
x5 1 7 2 mirror
r50k 1 7 50k
vbias 2 0
.dc vbias 0 5 .1

 

Re: current mirror ( widlar and cascode) asking for help


I don't know PSPICE. Perhaps these .plot commands aren't necessary for PSPICE.



5 mirrors (x1..x5) with 5 different output resistors.
 
Reactions: Devi92

    Devi92

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…