Skip to main content

MosfetModel

Struct MosfetModel 

Source
pub struct MosfetModel {
    pub vth: f64,
    pub cox: f64,
    pub mobility: f64,
    pub width: f64,
    pub length: f64,
    pub temperature_k: f64,
    pub n_sub: f64,
    pub lambda: f64,
}
Expand description

MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) model.

Implements the square-law MOSFET model with subthreshold behavior.

Fields§

§vth: f64

Threshold voltage Vth in V.

§cox: f64

Oxide capacitance per unit area Cox in F/cm^2.

§mobility: f64

Channel mobility in cm^2/(V·s).

§width: f64

Channel width in cm.

§length: f64

Channel length in cm.

§temperature_k: f64

Temperature in K.

§n_sub: f64

Subthreshold swing ideality factor (typically 1.0-1.5).

§lambda: f64

Channel-length modulation parameter lambda in V^-1.

Implementations§

Source§

impl MosfetModel

Source

pub fn new( vth: f64, cox: f64, mobility: f64, width: f64, length: f64, temperature_k: f64, n_sub: f64, lambda: f64, ) -> Self

Create a new MOSFET model.

Source

pub fn typical_nmos() -> Self

Typical NMOS transistor parameters.

Source

pub fn transconductance_parameter(&self) -> f64

Transconductance parameter K = mu * Cox * W / L in A/V^2.

Source

pub fn linear_current(&self, vgs: f64, vds: f64) -> f64

Drain current in the linear (triode) region in A.

Id = K * ((Vgs - Vth) * Vds - Vds^2 / 2) * (1 + lambda * Vds)

Source

pub fn saturation_current(&self, vgs: f64, vds: f64) -> f64

Drain current in the saturation region in A.

Id = (K / 2) * (Vgs - Vth)^2 * (1 + lambda * Vds)

Source

pub fn drain_current(&self, vgs: f64, vds: f64) -> f64

Drain current combining linear and saturation regions.

Source

pub fn subthreshold_current(&self, vgs: f64, vds: f64) -> f64

Subthreshold current in A.

I_sub = I0 * exp((Vgs - Vth) / (n * V_T)) * (1 - exp(-Vds / V_T))

Source

pub fn subthreshold_swing(&self) -> f64

Subthreshold swing in mV/decade.

Source

pub fn transconductance(&self, vgs: f64) -> f64

Transconductance gm = dId/dVgs in the saturation region, in A/V.

Source

pub fn output_conductance(&self, vgs: f64) -> f64

Output conductance gds = dId/dVds in saturation, in A/V.

Source

pub fn intrinsic_gain(&self, vgs: f64) -> f64

Intrinsic voltage gain Av = gm / gds.

Source

pub fn body_effect_vth(vth0: f64, gamma: f64, phi_f: f64, vsb: f64) -> f64

Threshold voltage with body effect.

Vth = Vth0 + gamma * (sqrt(2phi_f + Vsb) - sqrt(2phi_f))

Trait Implementations§

Source§

impl Clone for MosfetModel

Source§

fn clone(&self) -> MosfetModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MosfetModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for MosfetModel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.