%%HP:T(3)A(D)F(.);
@
@ HP-48SX CMOS FET EQUATIONS
@ by Preston Brown

@ The following is a set of equations for CMOS field effect transistors.
@ The constants included give a good approximation to common 1.6u processes.
@ The models should be adjusted for your process

@ This file may be downloaded directly into your HP-48SX.

@ The equations contain process information: each equation uses its own Vt
@ and K'.  In addition the effective W and the effective L are calculated.
@ For example in WNEQ 1.52 is subtracted from the width and 0.4 is
@ subtracted from the length. The L effective and W effective terms assume
@ the L and W are entered in microns.

DIR
CST
{
{ "WN" \<< WNEQ.EQ STEQ 30 MENU \>> }
{ "BN" \<< BNEQ.EQ STEQ 30 MENU \>> }
{ "WP" \<< WPEQ.EQ STEQ 30 MENU \>> }
{ "BP" \<< BPEQ.EQ STEQ 30 MENU \>> }
}

WNEQ.EQ
{
 '-(ID-(Wu-1.52)/(Lu-0.41) *
 IFTE( VDS > 0 AND VGS > VTNW,
 IFTE(VDS < VGS-VTNW,
 WNK/2 * ( 2*(VGS-VTNW) * VDS - SQ(VDS)),
 WNK/2 * SQ(VGS-VTNW))
 ,0))'
 { ID Wu Lu VDS VGS { "WN" \<< BNEQ.EQ STEQ 30 MENU \>>}  }
}

BNEQ.EQ
{
 '-(ID-(Wu-1.28)/(Lu-0.69) *
 IFTE( VDS > 0 AND VGS > VTNB,
 IFTE(VDS < VGS-VTNB,
 BNK/2 * ( 2*(VGS-VTNB) * VDS - SQ(VDS)),
 BNK/2 * SQ(VGS-VTNB))
 ,0))'
 { ID Wu Lu VDS VGS { "BN" \<< WNEQ.EQ STEQ 30 MENU \>>}  }
}

WPEQ.EQ
{
 '-(ID-(Wu-1.56)/(Lu-0.50) *
 IFTE( VDS > 0 AND VGS > VTPW,
 IFTE(VDS < VGS-VTPW,
 WPK/2 * ( 2*(VGS-VTPW) * VDS - SQ(VDS)),
 WPK/2 * SQ(VGS-VTPW))
 ,0))'
 { ID Wu Lu VDS VGS { "WP" \<< BPEQ.EQ STEQ 30 MENU \>>}  }

}

BPEQ.EQ
{
 '-(ID-(Wu-1.32)/(Lu-0.35) *
 IFTE( VDS > 0 AND VGS > VTPB,
 IFTE(VDS < VGS-VTPB,
 BPK/2 * ( 2*(VGS-VTPB) * VDS - SQ(VDS)),
 BPK/2 * SQ(VGS-VTPB))
 ,0))'
 { ID Wu Lu VDS VGS { "BP" \<< WPEQ.EQ STEQ 30 MENU \>>}  }

}

@ Some process related constants: the Vt and K' for the different devices.

VTNW            @ Vt for the worst case n-channel device
0.9

WNK             @ K' for the worst case n-channel device
40E-6

VTNB            @ Vt for the best case n-channel device
0.7

BNK             @ K' for the best case n-channel device
66E-6

VTPW            @ Vt for the worst case p-channel device
0.7

WPK             @ K' for the worst case p-channel device
12E-6

VTPB            @ Vt for the best case p-channel device
0.7

BPK             @ K' for the best case p-channel device
22E-6


@ Using the FET models.

@ First, enter the MOS directory by pressing [VAR] {MOS}.  If you are
@ already in the MOS directory that is unnecessary

@ Press [CST] to bring up the custom menu to select your model

@ Pressing {WN} for example puts you in the Solver menu with the following
@ solver variables:

@ {  ID  }  {  Wu  }   {  Lu  }   { VDS  }   {  VGS  }

@ The process related variables VT and K are already stored and need
@ not be worried about.  The other five variables may be stored or solved
@ for.  To solve for any of these variable you must first enter the other
@ four known variables and then solve for the unknown.

@ For example, to solve for Wu given the other values:

@ 1E-3 {ID}  		stores 1mA as the drain current
@ 1.6  {Lu}  		stores 1.6 microns as the gate length
@ 0.5  {VDS} 		stores 0.5V into Vds; the source drain voltage
@ 4.5  {VGS} 		stores 4.5V into Vgs; the gate voltage

@ [SHIFT] {Wu}		solves for the width: 19.28 microns with the
@ 			given process parameters

@ Now to solve for the best case VDS given the size you just solved for
@ press:

@ {WN}  		change to the best case model
@ [SHIFT] {VDS}		solve for the VDS: Vds is now only 0.2V

@ You can also solve for any of the other variables.


@ Advanced Example

@ The power of the 48SX is not just limited to storing values into the
@ variables but you can also store expressions into them. For example,
@ solving a transistor pulling down on
@ a resistor connected from the drain of the transistor to VDD can
@ be handled by storing an expression into ID.
@ In this example ID is also given by: (VDD-VDS)/R

@ To calculate the value of VDS of a 20u wide by 1.6u long transistor
@ with a VGS of 2V and driving a 20Kohm resistor :


@  [CST] {WN} 			select the worst case model

@ '(VDD-VDS)/R  [ENTER]  {ID}	store an expression into ID
@ Press [->] [SOLVE]  		(Blue 7) The 48SX then rearranges the soft keys:
@ 				ID is replaced by VDD and R.

@  5.0  {VDD}			store 5V into VDD (for example)
@  20000  {R}			store 20K into R
@  20  {Wu}			store 20 microns into Wu
@  1.6  {Lu}			store 1.6 microns into Lu
@  2  {VGS}			store 2V into VGS
@  [shift]  {VDS}		solve for VDS
@           			the 48SX returns 0.413V

@  {WN}				switch to best case
@  [shift]  {VDS}		solve for VDS
@           			the 48SX returns 0.145V

@ To return the soft keys to normal store 0 into ID:    0 'ID [STO]
@ and press [->] [SOLVE]

@ Have fun
