Skip to content
LIBRARY
Analog.Semiconductors.NMOS.md

Analog.Semiconductors.NMOS ​

N-channel MOSFET with a heat port, translated from MSL. Shichman-Hodges square law.

ud/us are the higher and lower of the drain and source potentials, so uds >= 0 whichever way the device is driven. ubs is clamped at zero for forward body bias. gds = 1/RDS shunts the channel in every region.

What this model does not have ​

No capacitances, no subthreshold conduction, no channel-length modulation, no velocity saturation. Cut-off current is the RDS shunt alone, so the device is exactly off below threshold. The region seams are C0 but not C1.

Temperature ​

With use_temperature_dependency = true, inert at T = Tnom:

Modes ​

Both flags default to false, which reproduces MSL. use_heat_port couples port; otherwise the device sits at T. MSL ties the two together through ConditionalHeatPort(useHeatPort = useTemperatureDependency), so set both true for a heated device.

Connectors ​

  • d drain, g gate, s source, b bulk

  • port heat port, active when use_heat_port = true

Reference ​

Modelica.Electrical.Analog.Semiconductors.NMOS, Modelica Standard Library. Parameter names and defaults are MSL's, verbatim. Pin names are lower case to match this library; MSL spells them D, G, S, B.

Usage ​

ElectricalComponents.Analog.Semiconductors.NMOS(W=20.0e-6, L=6.0e-6, Beta=0.041e-3, Vt=0.8, K2=1.144, K5=0.7311, dW=-2.5e-6, dL=-1.5e-6, RDS=1.0e7, Tnom=300.15, kvt=-6.96e-3, kk2=6.0e-4, T=293.15, gds=ifelse(abs(RDS) < 1.0e-20, 1.0e20, 1.0 / RDS))

Parameters: ​

NameDescriptionUnitsDefault value
use_heat_portCouple to port; when false the device sits at T and port must be left unconnected–false
use_temperature_dependencyScale Beta, Vt and K2 with temperature, MSL useTemperatureDependency–false
WChannel widthm20.0e-6
LChannel lengthm6.0e-6
BetaTransconductance parameterA/V20.041e-3
VtZero-bias threshold voltageV0.8
K2Bulk threshold (body-effect) parameter–1.144
K5Reduction of the pinch-off region–0.7311
dWNarrowing of the channelm-2.5e-6
dLShortening of the channelm-1.5e-6
RDSDrain-source resistance, shunting the channel in every regionΩ1.0e7
TnomReference temperature at which Beta, Vt and K2 are quotedK300.15
kvtFitting parameter for the Vt temperature drift–-6.96e-3
kk2Fitting parameter for the K2 temperature drift–6.0e-4
TFixed device temperature, used when use_heat_port = falseK293.15

Connectors ​

  • d - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • g - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • s - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • b - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • port - This connector represents a thermal port with temperature and heat flow as the potential and flow variables, respectively. (HeatPort)

Variables ​

NameDescriptionUnits
T_devDevice temperatureK
beta_tTransconductance parameter at the device temperatureA/V2
vt_tThreshold voltage at the device temperatureV
k2_tBulk threshold parameter at the device temperature–
beta_effEffective transconductance, beta_t*(W + dW)/(L + dL); MSL calls this bare vA/V2
udThe higher of the drain and source potentialsV
usThe lower of the drain and source potentialsV
udsDrain-source voltage after the exchange, never negativeV
ubsBulk-source voltage, clamped at zero for forward body biasV
ugstGate overdrive, scaled by K5V
idChannel current, in the exchanged frameA
LossPowerPower dissipated in the deviceW

Behavior ​

Source ​

dyad
"""
N-channel MOSFET with a heat port, translated from MSL. Shichman-Hodges square law.

```math
u_{gst} = (v_G - u_S - V_t + K_2 u_{bs})\, K_5, \qquad
\beta_{eff} = \beta \frac{W + dW}{L + dL}
```
```math
i_d = \begin{cases}
  u_{ds} g_{ds}                                           & u_{gst} \le 0 \\
  \beta_{eff} u_{ds} (u_{gst} - u_{ds}/2) + u_{ds} g_{ds}  & u_{gst} > u_{ds} \\
  \beta_{eff} u_{gst}^2 / 2 + u_{ds} g_{ds}                & \text{otherwise}
\end{cases}
```
`ud`/`us` are the higher and lower of the drain and source potentials, so `uds >= 0`
whichever way the device is driven. `ubs` is clamped at zero for forward body bias.
`gds = 1/RDS` shunts the channel in every region.

## What this model does not have

No capacitances, no subthreshold conduction, no channel-length modulation, no velocity
saturation. Cut-off current is the `RDS` shunt alone, so the device is exactly off below
threshold. The region seams are C0 but not C1.

## Temperature

With `use_temperature_dependency = true`, inert at `T = Tnom`:
```math
\beta(T) = \beta \left(\frac{T}{T_{nom}}\right)^{-1.5}, \quad
V_t(T) = V_t (1 + (T - T_{nom}) k_{vt}), \quad
K_2(T) = K_2 (1 + (T - T_{nom}) k_{k2})
```

## Modes

**Both flags default to `false`, which reproduces MSL.** `use_heat_port` couples `port`;
otherwise the device sits at `T`. MSL ties the two together through
`ConditionalHeatPort(useHeatPort = useTemperatureDependency)`, so set both true for a
heated device.

## Connectors

  * `d` drain, `g` gate, `s` source, `b` bulk
  * `port` heat port, active when `use_heat_port = true`

## Reference

`Modelica.Electrical.Analog.Semiconductors.NMOS`, Modelica Standard Library. Parameter
names and defaults are MSL's, verbatim. Pin names are lower case to match this library;
MSL spells them `D`, `G`, `S`, `B`.
"""
component NMOS
  "Drain pin"
  d = Pin() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50}}}}
  "Gate pin"
  g = Pin() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Source pin"
  s = Pin() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Bulk (substrate) pin"
  b = Pin() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Heat port for thermal-electric simulation"
  port = HeatPort() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 750, "x2": 50, "y2": 850}}}}
  "Couple to `port`; when false the device sits at `T` and `port` must be left unconnected"
  structural parameter use_heat_port::Boolean = false
  "Scale `Beta`, `Vt` and `K2` with temperature, MSL `useTemperatureDependency`"
  structural parameter use_temperature_dependency::Boolean = false
  "Channel width"
  parameter W::Length = 20.0e-6
  "Channel length"
  parameter L::Length = 6.0e-6
  "Transconductance parameter"
  parameter Beta::Transconductance = 0.041e-3
  "Zero-bias threshold voltage"
  parameter Vt::Voltage = 0.8
  "Bulk threshold (body-effect) parameter"
  parameter K2::Real = 1.144
  "Reduction of the pinch-off region"
  parameter K5::Real = 0.7311
  "Narrowing of the channel"
  parameter dW::Length = -2.5e-6
  "Shortening of the channel"
  parameter dL::Length = -1.5e-6
  "Drain-source resistance, shunting the channel in every region"
  parameter RDS::Resistance = 1.0e7
  "Reference temperature at which `Beta`, `Vt` and `K2` are quoted"
  parameter Tnom::Temperature = 300.15
  "Fitting parameter for the `Vt` temperature drift"
  parameter kvt::Real = -6.96e-3
  "Fitting parameter for the `K2` temperature drift"
  parameter kk2::Real = 6.0e-4
  "Fixed device temperature, used when `use_heat_port = false`"
  parameter T::Temperature = 293.15
  "Drain-source conductance, `1/RDS`, clamped for a vanishing `RDS`"
  final parameter gds::Conductance = ifelse(abs(RDS) < 1.0e-20, 1.0e20, 1.0 / RDS)
  "Device temperature"
  variable T_dev::Temperature
  "Transconductance parameter at the device temperature"
  variable beta_t::Transconductance
  "Threshold voltage at the device temperature"
  variable vt_t::Voltage
  "Bulk threshold parameter at the device temperature"
  variable k2_t::Real
  "Effective transconductance, `beta_t*(W + dW)/(L + dL)`; MSL calls this bare `v`"
  variable beta_eff::Transconductance
  "The higher of the drain and source potentials"
  variable ud::Voltage
  "The lower of the drain and source potentials"
  variable us::Voltage
  "Drain-source voltage after the exchange, never negative"
  variable uds::Voltage
  "Bulk-source voltage, clamped at zero for forward body bias"
  variable ubs::Voltage
  "Gate overdrive, scaled by `K5`"
  variable ugst::Voltage
  "Channel current, in the exchanged frame"
  variable id::Current
  "Power dissipated in the device"
  variable LossPower::Power
relations
  assert(L + dL > 0.0, "NMOS: effective length must be positive")
  assert(W + dW > 0.0, "NMOS: effective width must be positive")
  assert(T_dev > 0.0, "NMOS: device temperature must be positive")
  if use_heat_port
    T_dev = port.T
    port.Q_flow = -LossPower
  else
    T_dev = T
    port.T = T
    port.Q_flow = 0
  end
  if use_temperature_dependency
    beta_t = Beta * (T_dev / Tnom) ^ (-1.5)
    vt_t = Vt * (1.0 + (T_dev - Tnom) * kvt)
    k2_t = K2 * (1.0 + (T_dev - Tnom) * kk2)
  else
    beta_t = Beta
    vt_t = Vt
    k2_t = K2
  end
  beta_eff = beta_t * (W + dW) / (L + dL)
  "Drain-source exchange, so `uds >= 0` and the device stays symmetric"
  ud = ifelse(d.v < s.v, s.v, d.v)
  us = ifelse(d.v < s.v, d.v, s.v)
  uds = ud - us
  "Forward body bias is clamped away, as in MSL"
  ubs = ifelse(b.v > us, 0.0, b.v - us)
  ugst = (g.v - us - vt_t + k2_t * ubs) * K5
  """
  Cut-off, triode and saturation. Below threshold the current is the `RDS` shunt alone,
  so the device is exactly off -- there is no subthreshold tail.
  """
  id = ifelse(ugst <= 0.0, uds * gds, ifelse(ugst > uds, beta_eff * uds * (ugst - uds / 2.0) + uds * gds, beta_eff * ugst * ugst / 2.0 + uds * gds))
  g.i = 0
  d.i = ifelse(d.v < s.v, -id, id)
  s.i = ifelse(d.v < s.v, id, -id)
  b.i = 0
  LossPower = d.i * (d.v - s.v)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1200, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/NMOS.svg"}
  }
}
end
Flattened Source
dyad
"""
N-channel MOSFET with a heat port, translated from MSL. Shichman-Hodges square law.

```math
u_{gst} = (v_G - u_S - V_t + K_2 u_{bs})\, K_5, \qquad
\beta_{eff} = \beta \frac{W + dW}{L + dL}
```
```math
i_d = \begin{cases}
  u_{ds} g_{ds}                                           & u_{gst} \le 0 \\
  \beta_{eff} u_{ds} (u_{gst} - u_{ds}/2) + u_{ds} g_{ds}  & u_{gst} > u_{ds} \\
  \beta_{eff} u_{gst}^2 / 2 + u_{ds} g_{ds}                & \text{otherwise}
\end{cases}
```
`ud`/`us` are the higher and lower of the drain and source potentials, so `uds >= 0`
whichever way the device is driven. `ubs` is clamped at zero for forward body bias.
`gds = 1/RDS` shunts the channel in every region.

## What this model does not have

No capacitances, no subthreshold conduction, no channel-length modulation, no velocity
saturation. Cut-off current is the `RDS` shunt alone, so the device is exactly off below
threshold. The region seams are C0 but not C1.

## Temperature

With `use_temperature_dependency = true`, inert at `T = Tnom`:
```math
\beta(T) = \beta \left(\frac{T}{T_{nom}}\right)^{-1.5}, \quad
V_t(T) = V_t (1 + (T - T_{nom}) k_{vt}), \quad
K_2(T) = K_2 (1 + (T - T_{nom}) k_{k2})
```

## Modes

**Both flags default to `false`, which reproduces MSL.** `use_heat_port` couples `port`;
otherwise the device sits at `T`. MSL ties the two together through
`ConditionalHeatPort(useHeatPort = useTemperatureDependency)`, so set both true for a
heated device.

## Connectors

  * `d` drain, `g` gate, `s` source, `b` bulk
  * `port` heat port, active when `use_heat_port = true`

## Reference

`Modelica.Electrical.Analog.Semiconductors.NMOS`, Modelica Standard Library. Parameter
names and defaults are MSL's, verbatim. Pin names are lower case to match this library;
MSL spells them `D`, `G`, `S`, `B`.
"""
component NMOS
  "Drain pin"
  d = Pin() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": -50, "x2": 550, "y2": 50}}}}
  "Gate pin"
  g = Pin() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
  "Source pin"
  s = Pin() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}}
  "Bulk (substrate) pin"
  b = Pin() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
  "Heat port for thermal-electric simulation"
  port = HeatPort() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 750, "x2": 50, "y2": 850}}}}
  "Couple to `port`; when false the device sits at `T` and `port` must be left unconnected"
  structural parameter use_heat_port::Boolean = false
  "Scale `Beta`, `Vt` and `K2` with temperature, MSL `useTemperatureDependency`"
  structural parameter use_temperature_dependency::Boolean = false
  "Channel width"
  parameter W::Length = 20.0e-6
  "Channel length"
  parameter L::Length = 6.0e-6
  "Transconductance parameter"
  parameter Beta::Transconductance = 0.041e-3
  "Zero-bias threshold voltage"
  parameter Vt::Voltage = 0.8
  "Bulk threshold (body-effect) parameter"
  parameter K2::Real = 1.144
  "Reduction of the pinch-off region"
  parameter K5::Real = 0.7311
  "Narrowing of the channel"
  parameter dW::Length = -2.5e-6
  "Shortening of the channel"
  parameter dL::Length = -1.5e-6
  "Drain-source resistance, shunting the channel in every region"
  parameter RDS::Resistance = 1.0e7
  "Reference temperature at which `Beta`, `Vt` and `K2` are quoted"
  parameter Tnom::Temperature = 300.15
  "Fitting parameter for the `Vt` temperature drift"
  parameter kvt::Real = -6.96e-3
  "Fitting parameter for the `K2` temperature drift"
  parameter kk2::Real = 6.0e-4
  "Fixed device temperature, used when `use_heat_port = false`"
  parameter T::Temperature = 293.15
  "Drain-source conductance, `1/RDS`, clamped for a vanishing `RDS`"
  final parameter gds::Conductance = ifelse(abs(RDS) < 1.0e-20, 1.0e20, 1.0 / RDS)
  "Device temperature"
  variable T_dev::Temperature
  "Transconductance parameter at the device temperature"
  variable beta_t::Transconductance
  "Threshold voltage at the device temperature"
  variable vt_t::Voltage
  "Bulk threshold parameter at the device temperature"
  variable k2_t::Real
  "Effective transconductance, `beta_t*(W + dW)/(L + dL)`; MSL calls this bare `v`"
  variable beta_eff::Transconductance
  "The higher of the drain and source potentials"
  variable ud::Voltage
  "The lower of the drain and source potentials"
  variable us::Voltage
  "Drain-source voltage after the exchange, never negative"
  variable uds::Voltage
  "Bulk-source voltage, clamped at zero for forward body bias"
  variable ubs::Voltage
  "Gate overdrive, scaled by `K5`"
  variable ugst::Voltage
  "Channel current, in the exchanged frame"
  variable id::Current
  "Power dissipated in the device"
  variable LossPower::Power
relations
  assert(L + dL > 0.0, "NMOS: effective length must be positive")
  assert(W + dW > 0.0, "NMOS: effective width must be positive")
  assert(T_dev > 0.0, "NMOS: device temperature must be positive")
  if use_heat_port
    T_dev = port.T
    port.Q_flow = -LossPower
  else
    T_dev = T
    port.T = T
    port.Q_flow = 0
  end
  if use_temperature_dependency
    beta_t = Beta * (T_dev / Tnom) ^ (-1.5)
    vt_t = Vt * (1.0 + (T_dev - Tnom) * kvt)
    k2_t = K2 * (1.0 + (T_dev - Tnom) * kk2)
  else
    beta_t = Beta
    vt_t = Vt
    k2_t = K2
  end
  beta_eff = beta_t * (W + dW) / (L + dL)
  "Drain-source exchange, so `uds >= 0` and the device stays symmetric"
  ud = ifelse(d.v < s.v, s.v, d.v)
  us = ifelse(d.v < s.v, d.v, s.v)
  uds = ud - us
  "Forward body bias is clamped away, as in MSL"
  ubs = ifelse(b.v > us, 0.0, b.v - us)
  ugst = (g.v - us - vt_t + k2_t * ubs) * K5
  """
  Cut-off, triode and saturation. Below threshold the current is the `RDS` shunt alone,
  so the device is exactly off -- there is no subthreshold tail.
  """
  id = ifelse(ugst <= 0.0, uds * gds, ifelse(ugst > uds, beta_eff * uds * (ugst - uds / 2.0) + uds * gds, beta_eff * ugst * ugst / 2.0 + uds * gds))
  g.i = 0
  d.i = ifelse(d.v < s.v, -id, id)
  s.i = ifelse(d.v < s.v, id, -id)
  b.i = 0
  LossPower = d.i * (d.v - s.v)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1200, "rot": 0}],
    "icons": {"default": "dyad://ElectricalComponents/NMOS.svg"}
  }
}
end


Test Cases ​

No test cases defined.