Skip to content

Commit

Permalink
Bug fix when PMOS is in triode.
Browse files Browse the repository at this point in the history
  • Loading branch information
americodias committed Nov 12, 2018
1 parent 9d8a63a commit 00bcd69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sca_tdf_chargepump.cpp
Expand Up @@ -54,7 +54,7 @@ void sca_tdf_chargepump::processing(void) {
} else {
// Triode
double vds = sca_tdf_in_vcp;
discharge=-((2/(vdd-mosfet_vth))*current_dn*vds-(1/pow(vdd-mosfet_vth,2))*current_dn*pow(vds,2));
discharge=-((2.0/(vdd-mosfet_vth))*current_dn*vds-(1.0/pow(vdd-mosfet_vth,2.0))*current_dn*pow(vds,2.0));
}

// Charge (PMOS)
Expand All @@ -63,8 +63,8 @@ void sca_tdf_chargepump::processing(void) {
charge=current_up;
} else {
// Triode
double vds = vdd-sca_tdf_in_vcp;;
charge=(2/(vdd-mosfet_vth))*current_dn*vds-(1/pow(vdd-mosfet_vth,2))*current_dn*pow(vds,2);
double vds = vdd-sca_tdf_in_vcp;
charge=(2.0/(vdd-mosfet_vth))*current_up*vds-(1.0/pow(vdd-mosfet_vth,2.0))*current_up*pow(vds,2.0);
}

mismatch=charge+discharge;
Expand Down

0 comments on commit 00bcd69

Please sign in to comment.