Skip to content

Commit 4367eca

Browse files
committed
get rid of use_channel_length modulation parameter
1 parent 95ea7cd commit 4367eca

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

src/Electrical/Analog/mosfets.jl

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
4141
V_tn = 0.8, [description = "Threshold voltage (V)"]
4242
R_DS = 1e7, [description = "Drain to source resistance (Ω)"]
4343

44-
if use_channel_length_modulation
45-
lambda = 1 / 25, [description = "Channel length modulation coefficient (V^(-1))"]
46-
end
44+
lambda = 0.04, [description = "Channel length modulation coefficient (V^(-1))"]
4745

4846
if !use_transconductance
4947
mu_n, [description = "Electron mobility"]
@@ -57,7 +55,6 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
5755

5856
@structural_parameters begin
5957
use_transconductance = true
60-
use_channel_length_modulation = true
6158
end
6259

6360
begin
@@ -72,16 +69,12 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
7269
V_OV ~ V_GS - V_tn
7370

7471
d.i ~ ifelse(d.v < s.v, -1, 1) * ifelse(V_GS < V_tn,
75-
0 + V_DS / R_DS,
72+
V_DS / R_DS,
7673
ifelse(V_DS < V_OV,
77-
ifelse(use_channel_length_modulation,
7874
k_n * (1 + lambda * V_DS) * (V_OV - V_DS / 2) * V_DS + V_DS / R_DS,
79-
k_n * (V_OV - V_DS / 2) * V_DS + V_DS / R_DS),
80-
ifelse(use_channel_length_modulation,
81-
((k_n * V_OV^2) / 2) * (1 + lambda * V_DS) + V_DS / R_DS,
82-
(k_n * V_OV^2) / 2 + V_DS / R_DS)
75+
((k_n * V_OV^2) / 2) * (1 + lambda * V_DS) + V_DS / R_DS
76+
)
8377
)
84-
)
8578

8679
g.i ~ 0
8780
s.i ~ -d.i
@@ -132,9 +125,7 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
132125
V_tp = -1.5, [description = "Threshold voltage (V)"]
133126
R_DS = 1e7, [description = "Drain-source resistance (Ω)"]
134127

135-
if use_channel_length_modulation
136-
lambda = 1 / 25, [description = "Channel length modulation coefficient (V^(-1))"]
137-
end
128+
lambda = 1 / 25, [description = "Channel length modulation coefficient (V^(-1))"]
138129

139130
if !use_transconductance
140131
mu_p, [description = "Hole mobility"]
@@ -148,7 +139,6 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
148139

149140
@structural_parameters begin
150141
use_transconductance = true
151-
use_channel_length_modulation = true
152142
end
153143

154144
begin
@@ -162,15 +152,11 @@ Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Ga
162152
V_GS ~ g.v - ifelse(d.v > s.v, d.v, s.v)
163153

164154
d.i ~ -ifelse(d.v > s.v, -1.0, 1.0) * ifelse(V_GS > V_tp,
165-
0.0 + V_DS / R_DS,
155+
V_DS / R_DS,
166156
ifelse(V_DS > (V_GS - V_tp),
167-
ifelse(use_channel_length_modulation,
168157
k_p * (1 + lambda * V_DS) * ((V_GS - V_tp) - V_DS / 2) * V_DS +
169158
V_DS / R_DS,
170-
k_p * ((V_GS - V_tp) - V_DS / 2) * V_DS + V_DS / R_DS),
171-
ifelse(use_channel_length_modulation,
172159
((k_p * (V_GS - V_tp)^2) / 2) * (1 + lambda * V_DS) + V_DS / R_DS,
173-
(k_p * (V_GS - V_tp)^2) / 2 + V_DS / R_DS)
174160
)
175161
)
176162

0 commit comments

Comments
 (0)