home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / n / spice / docs / NSpice < prev    next >
Text File  |  1993-02-11  |  74KB  |  1,723 lines

  1.  
  2.                      SPICE 3A6 User's Guide
  3.                         December 15, 1985
  4.                            T. Quarles
  5.        A.R.Newton, D.O.Pederson, A.Sangiovanni-Vincentelli
  6.    Department of Electrical Engineering and Computer Sciences
  7.                     University of California
  8.                       Berkeley, Ca., 94720
  9.  
  10.       ____________________________________________________
  11.      |                                                   |
  12.      |                    Please Note                    |
  13.      |                                                   |
  14.      |                                                   |
  15.      |      This is an update to  the  first  release  of|
  16.      | SPICE3  and the development of SPICE and its algo-|
  17.      | rithms is ongoing at Berkeley.   We  believe  that|
  18.      | all of the features described here are fully func-|
  19.      | tional; however, not all of the intended capabili-|
  20.      | ties  of the program have been implemented in full|
  21.      | yet.  Please mail any reports of suspected bugs in|
  22.      | the  program or suggested enhancements to the pro-|
  23.      | gram to:                                          |
  24.      |                                                   |
  25.      |     EECS/ERL Industrial Support Office            |
  26.      |     461 Cory Hall                                 |
  27.      |     U.C. Berkeley                                 |
  28.      |     Berkeley, Ca.   94720                         |
  29.      |                                                   |
  30.      |     or by electronic mail to:                     |
  31.      |                                                   |
  32.      |         spice@cad.BERKELEY.EDU  (ARPAnet, CSnet)  |
  33.      |         ucbvax!ucbcad!spice  (UUCPnet)            |
  34.      |                                                   |
  35.      |                                                   |
  36.      |      Please include input to the program, out-    |
  37.      | put,  suggestions  as to where the problem may    |
  38.      | be, and if possible, a suggested fix!             |
  39.      |                                                   |
  40.      |      SPICE3 has been in beta-test since  April    |
  41.      | 1985 and has been in use at over twenty sites.    |
  42.      | This version is the result of our own work  at    |
  43.      | Berkeley  and  the  feedback  we have received    |
  44.      | from our beta sites. We thank them  for  their    |
  45.      | help.                                             |
  46.      |___________________________________________________|
  47.  
  48.      SPICE is a general-purpose circuit  simulation  program  for
  49. nonlinear  dc, nonlinear transient, and linear ac analyses. Cir-
  50. cuits may contain resistors, capacitors, inductors, mutual induc-
  51. tors,  independent  voltage  and  current  sources, four types of
  52. dependent sources, transmission lines, and the four most  common
  53. semiconductor devices:  diodes, BJT's, JFET's, and MOSFET's.
  54.  
  55.      The SPICE3 version is based directly on SPICE  2G.6.   While
  56. SPICE3  is  being developed to include new features, it will con-
  57. tinue to support those capabilities and models  which  remain  in
  58. extensive use in the SPICE2 program.
  59.  
  60.      SPICE has built-in models for the semiconductor devices, and
  61. the  user need specify only the pertinent model parameter values.
  62. The model for the BJT is based on the integral  charge  model  of
  63. Gummel and Poon;  however, if the Gummel- Poon parameters are not
  64. specified, the model reduces to the simpler Ebers-Moll model.  In
  65. either  case,  charge  storage  effects, ohmic resistances, and a
  66. current-dependent output conductance may be included.  The  diode
  67. model  can be used for either junction diodes or Schottky barrier
  68. diodes.  The JFET model is based on the FET model of Shichman and
  69. Hodges.  Four MOSFET models are implemented: MOS1 is described by
  70. a square-law I-V characteristic, MOS2[1] is an analytical  model,
  71. while MOS3[1] is a semi-empirical model, and MOS4[2,3] is the new
  72. BSIM (Berkeley Short-channel IGFET Model).  MOS2, MOS3, and  MOS4
  73. include  second-order  effects such as channel length modulation,
  74. subthreshold conduction, scattering limited velocity  saturation,
  75. small-size effects, and charge-controlled capacitances.
  76.  
  77. 1.  TYPES OF ANALYSIS
  78.  
  79. 1.1.  DC Analysis
  80.  
  81.      The dc analysis portion of SPICE determines the dc operating
  82. point  of  the  circuit  with  inductors  shorted  and capacitors
  83. opened.  A dc analysis is  automatically  performed  prior  to  a
  84. transient analysis to determine the transient initial conditions,
  85. and prior to an ac small-signal analysis to determine the linear-
  86. ized,  small-signal models for nonlinear devices. The dc analysis
  87. can also be used to generate dc  transfer  curves:   a  specified
  88. independent  voltage  or  current  source is stepped over a user-
  89. specified range and the dc output variables are stored  for  each
  90. sequential source value.
  91.  
  92. 1.2.  AC Small-Signal Analysis
  93.  
  94.      The ac small-signal portion of SPICE computes the ac  output
  95. variables as a function of frequency.  The program first computes
  96. the dc operating point of the circuit and determines  linearized,
  97. small-signal  models for all of the nonlinear devices in the cir-
  98. cuit.  The resultant linear  circuit  is  then  analyzed  over  a
  99. user-specified range of frequencies.  The desired output of an ac
  100. small- signal analysis is usually a  transfer  function  (voltage
  101. gain,  transimpedance,  etc).   If  the  circuit  has only one ac
  102. input, it is convenient to set  that  input  to  unity  and  zero
  103. phase,  so  that  output  variables  have  the  same value as the
  104. transfer function of the output  variable  with  respect  to  the
  105. input.
  106.  
  107. 1.3.  Transient Analysis
  108.  
  109.      The transient analysis portion of SPICE computes  the  tran-
  110. sient  output  variables  as  a  function  of  time  over a user-
  111. specified time interval.  The initial  conditions  are  automati-
  112. cally  determined  by  a  dc analysis.  All sources which are not
  113. time dependent (for example, power supplies) are set to their  dc
  114. value.  The  transient time interval is specified on a .TRAN con-
  115. trol line.
  116.  
  117. 2.  CONVERGENCE
  118.  
  119.      Both dc and transient solutions are obtained by an iterative
  120. process which is terminated when both of the following conditions
  121. hold:
  122.  
  123. 1)   The nonlinear branch currents converge to within a tolerance
  124.      of  0.1  percent  or  1  picoamp (1.0E-12 Amp), whichever is
  125.      larger.
  126.  
  127. 2)   The node voltages converge to within a tolerance of 0.1 per-
  128.      cent or 1 microvolt (1.0E-6 Volt), whichever is larger.
  129.  
  130.      Although the algorithm used in SPICE has been  found  to  be
  131. very  reliable, in some cases it will fail to converge to a solu-
  132. tion.  When this failure occurs, the program will  terminate  the
  133. job.
  134.  
  135.      Failure to converge in dc analysis  is  usually  due  to  an
  136. error in specifying circuit connections, element values, or model
  137. parameter values.  Regenerative switching  circuits  or  circuits
  138. with  positive  feedback  probably  will  not  converge in the dc
  139. analysis unless the OFF option is used for some of the devices in
  140. the feedback path, or the .NODESET card is used to force the cir-
  141. cuit to converge to the desired state.
  142.  
  143. 3.  INPUT FORMAT
  144.  
  145.      The input format for SPICE  is  of  the  free  format  type.
  146. Fields on a card are separated by one or more blanks, a comma, an
  147. equal (=) sign, or a left or right parenthesis;  extra spaces are
  148. ignored.   A  card  may  be  continued  by entering a + (plus) in
  149. column 1 of the following card;  SPICE continues  reading  begin-
  150. ning with column 2.
  151.  
  152.      A name field must begin with a letter (A through Z) and can-
  153. not contain any delimiters.
  154.  
  155.      A number field may be an integer field (12, -44), a floating
  156. point field (3.14159), either an integer or floating point number
  157. followed by an integer exponent (1E-14,  2.65E3),  or  either  an
  158. integer or a floating point number followed by one of the follow-
  159. ing scale factors:
  160.  
  161.         T=1E12   G=1E9    MEG=1E6   K=1E3     MIL=25.4E-6
  162.         M=1E-3   U=1E-6   N=1E-9    P=1E-12   F=1E-15
  163.  
  164. Letters immediately following a number that are not scale factors
  165. are ignored, and letters immediately following a scale factor are
  166. ignored.  Hence, 10, 10V, 10VOLTS, and  10HZ  all  represent  the
  167. same  number,  and  M, MA, MSEC, and MMHOS all represent the same
  168. scale factor.  Note that 1000, 1000.0, 1000HZ, 1E3, 1.0E3,  1KHZ,
  169. and 1K all represent the same number.
  170.  
  171. 4.  CIRCUIT DESCRIPTION
  172.  
  173.      The circuit to be analyzed is described to SPICE by a set of
  174. element  cards,  which  define  the  circuit topology and element
  175. values, and a set of control cards, which define the model param-
  176. eters  and  the  run  controls.  The first card in the input deck
  177. must be a title card, and the last card must be a .END card.  The
  178. order  of  the  remaining  cards is arbitrary (except, of course,
  179. that continuation cards must immediately follow  the  card  being
  180. continued).
  181.  
  182.      Each element in the circuit is specified by an element  card
  183. that  contains  the  element name, the circuit nodes to which the
  184. element is connected, and  the  values  of  the  parameters  that
  185. determine  the  electrical  characteristics  of the element.  The
  186. first letter of the element name specifies the element type.  The
  187. format for the SPICE element types is given in what follows.  The
  188. strings  XXXXXXX,   YYYYYYY,   and   ZZZZZZZ   denote   arbitrary
  189. alphanumeric  strings.   For  example, a resistor name must begin
  190. with the letter R and can contain one or more characters.  Hence,
  191. R, R1, RSE, ROUT, and R3AC2ZY are valid resistor names.
  192.  
  193.      Data fields that are enclosed in less than and greater  than
  194. signs   '<   >'   are   optional.    All   indicated  punctuation
  195. (parentheses, equal signs, etc.) is optional and merely  indicate
  196. the  presence  of  any delimiter. A consistent style such as that
  197. shown here will  make  the  input  easier  to  understand.   With
  198. respect to branch voltages and currents, SPICE uniformly uses the
  199. associated reference convention (current flows in  the  direction
  200. of voltage drop).
  201.  
  202.      Nodes names may be arbitrary character strings.   The  datum
  203. (ground)  node  must  be named '0'.  The circuit cannot contain a
  204. loop of voltage sources and/or inductors  and  cannot  contain  a
  205. cutset  of  current  sources and/or capacitors.  Each node in the
  206. circuit must have a dc path to ground.  Every node must  have  at
  207. least two connections except for transmission line nodes (to per-
  208. mit unterminated transmission lines) and MOSFET  substrate  nodes
  209. (which have two internal connections anyway).
  210. 5.  TITLE CARD, COMMENT CARDS AND .END CARD
  211.  
  212. 5.1.  Title Card
  213.  
  214. Examples:
  215.  
  216.     POWER AMPLIFIER CIRCUIT
  217.     TEST OF CAM CELL
  218.  
  219.      This card must be the first card in  the  input  deck.   Its
  220. contents  are printed verbatim as the heading for each section of
  221. output.
  222.  
  223. 5.2.  .END Card
  224. Examples:
  225.  
  226.      .END
  227.  
  228.      This card must always be the last card in  the  input  deck.
  229. Note that the period is an integral part of the name.
  230.  
  231. 5.3.  Comment Card
  232.  
  233. General Form:
  234.  
  235.     * <any comment>
  236.  
  237. Examples:
  238.  
  239.     * RF=1K      GAIN SHOULD BE 100
  240.     * MAY THE FORCE BE WITH MY CIRCUIT
  241.  
  242.      The asterisk in the first column indicates that this card is
  243. a comment card.  Comment cards may be placed anywhere in the cir-
  244. cuit description.
  245. 6.  ELEMENT CARDS
  246.  
  247. 6.1.  Resistors
  248. General form:
  249.  
  250.     RXXXXXXX N1 N2 VALUE
  251.  
  252. Examples:
  253.  
  254.     R1 1 2 100
  255.     RC1 12 17 1K
  256.  
  257.      N1 and N2 are the two element nodes.  VALUE  is  the  resis-
  258. tance (in ohms) and may be positive or negative but not zero.
  259.  
  260. 6.2.  Capacitors and Inductors
  261.  
  262. General form:
  263.  
  264.     CXXXXXXX N+ N- VALUE <IC=INCOND>
  265.     LYYYYYYY N+ N- VALUE <IC=INCOND>
  266.  
  267. Examples:
  268.  
  269.     CBYP 13 0 1UF
  270.     COSC 17 23 10U IC=3V
  271.     LLINK 42 69 1UH
  272.     LSHUNT 23 51 10U IC=15.7MA
  273.  
  274.      N+ and N- are  the  positive  and  negative  element  nodes,
  275. respectively.   VALUE  is the capacitance in Farads or the induc-
  276. tance in Henries.
  277.  
  278.      For the capacitor, the (optional) initial condition  is  the
  279. initial  (time-zero)  value of capacitor voltage (in Volts).  For
  280. the inductor, the (optional) initial  condition  is  the  initial
  281. (time-zero)  value  of inductor current (in Amps) that flows from
  282. N+, through the inductor, to N-.  Note that  the  initial  condi-
  283. tions (if any) apply 'only' if the UIC option is specified on the
  284. .TRAN card.
  285.  
  286. 6.3.  Coupled (Mutual) Inductors
  287. General form:
  288.  
  289.     KXXXXXXX LYYYYYYY LZZZZZZZ VALUE
  290.  
  291. Examples:
  292.  
  293.     K43 LAA LBB 0.999
  294.     KXFRMR L1 L2 0.87
  295.  
  296.      LYYYYYYY and LZZZZZZZ are  the  names  of  the  two  coupled
  297. inductors,  and  VALUE  is  the coefficient of coupling, K, which
  298. must be greater than 0 and less than or equal to  1.   Using  the
  299. 'dot'  convention, place a 'dot' on the first node of each induc-
  300. tor.
  301.  
  302. 6.4.  Transmission Lines (Lossless)
  303.  
  304. General form:
  305.  
  306.     TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE> <F=FREQ <NL=NRMLEN>>
  307.     +                    <IC=V1,I1,V2,I2>
  308.  
  309. Examples:
  310.  
  311.     T1 1 0 2 0 Z0=50 TD=10NS
  312.  
  313.      N1 and N2 are the nodes at port 1;  N3 and N4 are the  nodes
  314. at  port  2.   Z0 is the characteristic impedance.  The length of
  315. the line may be expressed in either of two forms.  The  transmis-
  316. sion  delay, TD, may be specified directly (as TD=10ns, for exam-
  317. ple).  Alternatively, a frequency F may be given,  together  with
  318. NL,  the  normalized  electrical  length of the transmission line
  319. with respect to the wavelength in the line at  the  frequency  F.
  320.  
  321.  
  322. If  a  frequency  is specified but NL is omitted, 0.25 is assumed
  323. (that is, the frequency is assumed to be  the  quarter-wave  fre-
  324. quency).   Note  that although both forms for expressing the line
  325. length are indicated as optional, one of the two must  be  speci-
  326. fied.
  327.  
  328.      Note that this element models only one propagating mode.  If
  329. all four nodes are distinct in the actual circuit, then two modes
  330. may be excited.  To simulate such a situation, two  transmission-
  331. line  elements  are required.  (see the example in Appendix A for
  332. further clarification.)
  333.  
  334.      The (optional) initial condition specification  consists  of
  335. the  voltage  and current at each of the transmission line ports.
  336. Note that the initial conditions (if any) apply 'only' if the UIC
  337. option is specified on the .TRAN card.
  338.  
  339. 6.5.  Linear Dependent Sources
  340.  
  341.      SPICE allows circuits to contain  linear  dependent  sources
  342. characterized by any of the four equations
  343.  
  344.         i=g*v          v=e*v          i=f*i          v=h*i
  345.  
  346. where g, e, f, and h are constants representing transconductance,
  347. voltage gain, current gain, and transresistance, respectively.
  348.  
  349. 6.6.  Linear Voltage-Controlled Current Sources
  350.  
  351. General form:
  352.  
  353.     GXXXXXXX N+ N- NC+ NC- VALUE
  354.  
  355. Examples:
  356.  
  357.     G1 2 0 5 0 0.1MMHO
  358.  
  359.      N+ and N- are the positive and negative nodes, respectively.
  360. Current  flow  is  from the positive node, through the source, to
  361. the negative node.  NC+ and NC- are  the  positive  and  negative
  362. controlling  nodes,  respectively.  VALUE is the transconductance
  363. (in mhos).
  364.  
  365. 6.7.  Linear Voltage-Controlled Voltage Sources
  366. General form:
  367.  
  368.     EXXXXXXX N+ N- NC+ NC- VALUE
  369.  
  370. Examples:
  371.  
  372.     E1 2 3 14 1 2.0
  373.  
  374.      N+ is the positive node, and N- is the negative  node.   NC+
  375. and  NC- are the positive and negative controlling nodes, respec-
  376. tively.  VALUE is the voltage gain.
  377.  
  378. 6.8.  Linear Current-Controlled Current Sources
  379.  
  380. General form:
  381.  
  382.     FXXXXXXX N+ N- VNAM VALUE
  383.  
  384. Examples:
  385.  
  386.     F1 13 5 VSENS 5
  387.  
  388.      N+ and N- are the positive and negative nodes, respectively.
  389. Current  flow  is  from the positive node, through the source, to
  390. the negative node.  VNAM is the name of a voltage source  through
  391. which  the  controlling current flows.  The direction of positive
  392. controlling current flow is from the positive node,  through  the
  393. source, to the negative node of VNAM.  VALUE is the current gain.
  394.  
  395. 6.9.  Linear Current-Controlled Voltage Sources
  396. General form:
  397.  
  398.     HXXXXXXX N+ N- VNAM VALUE
  399.  
  400. Examples:
  401.  
  402.     HX 5 17 VZ 0.5K
  403.  
  404.      N+ and N- are the positive and negative nodes, respectively.
  405. VNAM  is  the name of a voltage source through which the control-
  406. ling  current  flows.   The  direction  of  positive  controlling
  407. current  flow  is  from the positive node, through the source, to
  408. the negative node of VNAM.   VALUE  is  the  transresistance  (in
  409. ohms).
  410.  
  411. 6.10.  Independent Sources
  412.  
  413. General form:
  414.  
  415.     VXXXXXXX N+ N- <<DC> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>
  416.     IYYYYYYY N+ N- <<DC> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>
  417.  
  418. Examples:
  419.  
  420.     VCC 10 0 DC 6
  421.     VIN 13 2 0.001 AC 1 SIN(0 1 1MEG)
  422.     ISRC 23 21 AC 0.333 45.0 SFFM(0 1 10K 5 1K)
  423.     VMEAS 12 9
  424.  
  425.      N+ and N- are the positive and negative nodes, respectively.
  426. Note that voltage sources need not be grounded.  Positive current
  427. is assumed to flow from the positive node, through the source, to
  428. the  negative  node.   A  current  source of positive value, will
  429. force current to flow out of the N+ node, through the source, and
  430. into the N- node.  Voltage sources, in addition to being used for
  431. circuit excitation, are the 'ammeters' for SPICE, that  is,  zero
  432. valued  voltage  sources may be inserted into the circuit for the
  433. purpose of measuring current.  They  will,  of  course,  have  no
  434. effect on circuit operation since they represent short-circuits.
  435.  
  436.      DC/TRAN is the  dc  and  transient  analysis  value  of  the
  437. source.   If  the  source value is zero both for dc and transient
  438. analyses, this value may be omitted.   If  the  source  value  is
  439. time-invariant (e.g., a power supply), then the value may option-
  440. ally be preceded by the letters DC.
  441.  
  442.      ACMAG is the ac magnitude and ACPHASE is the ac phase.   The
  443. source  is  set  to  this  value in the ac analysis.  If ACMAG is
  444. omitted following the keyword AC, a value of  unity  is  assumed.
  445. If ACPHASE is omitted, a value of zero is assumed.  If the source
  446. is not an ac small-signal input, the keyword AC and the ac values
  447. are omitted.
  448.  
  449.      Any independent source  can  be  assigned  a  time-dependent
  450. value  for  transient  analysis.  If a source is assigned a time-
  451. dependent value, the time-zero value is  used  for  dc  analysis.
  452. There are five independent source functions:  pulse, exponential,
  453. sinusoidal,  piece-wise  linear,  and  single-frequency  FM.   If
  454. parameters  other  than source values are omitted or set to zero,
  455. the default values shown will be assumed.  (TSTEP is the printing
  456. increment  and  TSTOP  is  the final time (see the .TRAN card for
  457. explanation)).
  458.  
  459. 1.  Pulse         PULSE(V1 V2 TD TR TF PW PER)
  460.  
  461. Examples:
  462.  
  463.     VIN 3 0 PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)
  464.  
  465.      parameters              default values         units
  466.      V1 (initial value)                       Volts or Amps
  467.      V2 (pulsed value)                        Volts or Amps
  468.      TD (delay time)         0.0              seconds
  469.      TR (rise time)          TSTEP            seconds
  470.      TF (fall time)          TSTEP            seconds
  471.      PW (pulse width)        TSTOP            seconds
  472.      PER(period)             TSTOP            seconds
  473.  
  474.      A single pulse so specified is described  by  the  following
  475. table:
  476.  
  477.                        time          value
  478.                        0             V1
  479.                        TD            V1
  480.                        TD+TR         V2
  481.                        TD+TR+PW      V2
  482.                        TD+TR+PW+TF   V1
  483.                        TSTOP         V1
  484.  
  485. Intermediate points are determined by linear interpolation.
  486.  
  487. 2.  Sinusoidal    SIN(VO VA FREQ TD THETA)
  488. Examples:
  489.  
  490.     VIN 3 0 SIN(0 1 100MEG 1NS 1E10)
  491.      parameters                default value   units
  492.      VO     (offset)                           Volts or Amps
  493.      VA     (amplitude)                        Volts or Amps
  494.      FREQ   (frequency)        1/TSTOP         Hz
  495.      TD     (delay)            0.0             seconds
  496.      THETA  (damping factor)   0.0             1/seconds
  497.  
  498.      The shape of the waveform  is  described  by  the  following
  499. table:
  500.  
  501. time          value
  502. 0 to TD       VO
  503. TD to TSTOP   VO + VA*exp(-(time-TD)*THETA)*sine(twopi*FREQ*(time+TD))
  504.  
  505. 3.  Exponential  EXP(V1 V2 TD1 TAU1 TD2 TAU2)
  506.  
  507. Examples:
  508.  
  509.     VIN 3 0 EXP(-4 -1 2NS 30NS 60NS 40NS)
  510.  
  511.    parameters                  default values   units
  512.    V1   (initial value)                         Volts or Amps
  513.    V2   (pulsed value)                          Volts or Amps
  514.    TD1  (rise delay time)      0.0              seconds
  515.    TAU1 (rise time constant)   TSTEP            seconds
  516.    TD2  (fall delay time)      TD1+TSTEP        seconds
  517.    TAU2 (fall time constant)   TSTEP            seconds
  518.  
  519.      The shape of the waveform  is  described  by  the  following
  520. table:
  521.  
  522.        time           value
  523.        0 to TD1       V1
  524.        TD1 to TD2     V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
  525.        TD2 to TSTOP   V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
  526.                       +(V1-V2)*(1-exp(-(time-TD2)/TAU2))
  527.  
  528. 4.  Piece-Wise Linear  PWL(T1 V1 <T2 V2 T3 V3 T4 V4 ...>)
  529.  
  530. Examples:
  531.  
  532.     VCLOCK 7 5 PWL(0 -7 10NS -7 11NS -3 17NS -3 18NS -7 50NS -7)
  533.  
  534. Parameters and default values
  535.  
  536.     Each pair of values (Ti, Vi) specifies that the value of the source is Vi
  537.     (in Volts or Amps) at time=Ti.  The value of the source at intermediate values
  538.     of time is determined by using linear interpolation on the input values.
  539.  
  540. 5.  Single-Frequency FM   SFFM(VO VA FC MDI FS)
  541. Examples:
  542.  
  543.     V1 12 0 SFFM(0 1M 20K 5 1K)
  544.     parameters                default values   units
  545.     VO  (offset)                               Volts or Amps
  546.     VA  (amplitude)                            Volts or Amps
  547.     FC  (carrier frequency)   1/TSTOP          Hz
  548.     MDI (modulation index)
  549.     FS  (signal frequency)    1/TSTOP          Hz
  550.  
  551.      The shape of the waveform  is  described  by  the  following
  552. equation:
  553.  
  554.     value = VO + VA*sine((twopi*FC*time) + MDI*sine(twopi*FS*time))
  555. 6.11.  Switches
  556.  
  557. General form:
  558.  
  559.     SXXXXXXX N+ N- NC+ NC- MODEL <ON><OFF>
  560.     WYYYYYYY N+ N- VNAM MODEL <ON><OFF>
  561.  
  562. Examples:
  563.  
  564.     s1 1 2 3 4 switch1 ON
  565.     s2 5 6 3 0 sm2 off
  566.     Switch1 1 2 10 0 smodel1
  567.     w1 1 2 vclock switchmod1
  568.     W2 3 0 vramp sm1 ON
  569.     wreset 5 6 vclck lossyswitch OFF
  570.  
  571.      Nodes 1 and 2 are the nodes between which the switch  termi-
  572. nals  are  connected.  The model name is mandatory while the ini-
  573. tial conditions are optional.  For the voltage controlled switch,
  574. nodes  3  and  4  are the positive and negative controlling nodes
  575. respectively.  For the current controlled switch, the controlling
  576. current  is that through the specified voltage source. The direc-
  577. tion of positive controlling current flow is  from  the  positive
  578. node, through the source, to the negative node.
  579.  
  580. 7.  SEMICONDUCTOR DEVICES
  581.  
  582.      The elements described to this point typically require  only
  583. a  few parameter values.  However, the models for the semiconduc-
  584. tor devices that are included in the SPICE program  require  many
  585. parameter  values.   Often, many devices in a circuit are defined
  586. by the same set of device model parameters.  For these reasons, a
  587. set  of  device  model parameters is defined on a separate .MODEL
  588. card and assigned a unique model name.  The device element  cards
  589. in  SPICE  then  refer to the model name.  This scheme alleviates
  590. the need to specify all of the model parameters  on  each  device
  591. element card.
  592.  
  593.      Each device element card contains the device name, the nodes
  594. to  which the device is connected, and the device model name.  In
  595. addition, other optional parameters may  be  specified  for  some
  596. devices:  geometric factors and an initial condition.
  597.  
  598.      The area factor used on the diode, BJT and JFET device cards
  599. determines  the number of equivalent parallel devices of a speci-
  600. fied model.  The affected parameters are marked with an  asterisk
  601. under  the  heading  'area'  in  the  model  descriptions  below.
  602. Several geometric factors associated with  the  channel  and  the
  603. drain and source diffusions can be specified on the MOSFET device
  604. card.
  605.  
  606.      Two different forms of initial conditions may  be  specified
  607. for  some  devices.  The first form is included to improve the dc
  608. convergence for circuits that contain more than one stable state.
  609. If  a  device  is specified OFF, the dc operating point is deter-
  610. mined with the terminal voltages for that  device  set  to  zero.
  611. After  convergence  is obtained, the program continues to iterate
  612. to obtain the exact value for the terminal voltages.  If  a  cir-
  613. cuit  has  more  than  one dc stable state, the OFF option can be
  614. used to force the solution to correspond to a desired state.   If
  615. a  device is specified OFF when in reality the device is conduct-
  616. ing, the program will still obtain the correct solution (assuming
  617. the  solutions  converge)  but  more  iterations will be required
  618. since the program must independently  converge  to  two  separate
  619. solutions.  The .NODESET card serves a similar purpose as the OFF
  620. option.  The .NODESET option is easier to apply and is  the  pre-
  621. ferred means to aid convergence.
  622.  
  623.      The second form of initial conditions are specified for  use
  624. with the transient analysis.  These are true 'initial conditions'
  625. as opposed to the convergence aids above.  See the description of
  626. the  .IC  card  and  the .TRAN card for a detailed explanation of
  627. initial conditions.
  628.  
  629. 7.1.  Semiconductor Resistors
  630.  
  631. General form:
  632.  
  633.     RXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH>
  634.  
  635. Examples:
  636.  
  637.     RLOAD 2 10 10K
  638.     RMOD 3 7 RMODEL L=10u W=1u
  639.  
  640.      This is the more general form of the resistor  presented  in
  641. section  6.1,  and allows the modeling of temperature effects and
  642. for the calculation of the actual resistance value from  strictly
  643. geometric  information and the specifications of the process.  If
  644. VALUE is specified, it overrides the  geometric  information  and
  645. defines  the  resistance.  If MNAME is specified, then the resis-
  646. tance may be calculated from the process information in the model
  647. MNAME and the given LENGTH and WIDTH.  If VALUE is not specified,
  648. then MNAME and LENGTH must be specified.  If WIDTH is not  speci-
  649. fied,  then  it will be taken from the default width given in the
  650. model.
  651.  
  652. 7.2.  Semiconductor Capacitors
  653.  
  654. General form:
  655.  
  656.     CXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH> <IC=VAL>
  657.  
  658. Examples:
  659.  
  660.     CLOAD 2 10 10P
  661.     CMOD 3 7 CMODEL L=10u W=1u
  662.  
  663.      This is the more general form of the Capacitor presented  in
  664. section 6.2, and allows for the calculation of the actual capaci-
  665. tance value from strictly geometric information and the  specifi-
  666. cations  of  the  process.  If VALUE is specified, it defines the
  667. capacitance.  If MNAME is specified, then the capacitance is cal-
  668. culated  from  the process information in the model MNAME and the
  669. given LENGTH and WIDTH.  If VALUE is not  specified,  then  MNAME
  670. and LENGTH must be specified.  If WIDTH is not specified, then it
  671. will be taken from the default width given in the model.   Either
  672. VALUE  or MNAME, LENGTH, and WIDTH may be specified, but not both
  673. sets.
  674.  
  675. 7.3.  Uniform Distributed RC Lines (Lossy)
  676.  
  677. General form:
  678.  
  679.     UXXXXXXX N1 N2 N3 MNAME L=LEN <N=LUMPS>
  680.  
  681. Examples:
  682.  
  683.     U1 1 2 0 URCMOD L=50U
  684.     URC2 1 12 2 UMODL l=1MIL N=6
  685.  
  686.      N1 and N2 are the two element nodes the  RC  line  connects,
  687. while  N3  is  the  node to which the capacitances are connected.
  688. MNAME is the model name, LEN is the length  of  the  RC  line  in
  689. meters.  LUMPS, if specified, is the number of lumped segments to
  690. use in modeling the RC line (see the model  description  for  the
  691. action taken if this parameter is omitted).
  692.  
  693. 7.4.  Junction Diodes
  694.  
  695. General form:
  696.  
  697.     DXXXXXXX N+ N- MNAME <AREA> <OFF> <IC=VD>
  698.  
  699. Examples:
  700.  
  701.     DBRIDGE 2 10 DIODE1
  702.     DCLMP 3 7 DMOD 3.0 IC=0.2
  703.  
  704.      N+ and N- are the positive and negative nodes, respectively.
  705. MNAME  is  the model name, AREA is the area factor, and OFF indi-
  706. cates an (optional) starting  condition  on  the  device  for  dc
  707. analysis.   If  the  area  factor  is  omitted, a value of 1.0 is
  708. assumed.  The (optional) initial  condition  specification  using
  709. IC=VD  is intended for use with the UIC option on the .TRAN card,
  710. when a transient analysis is desired starting from other than the
  711. quiescent operating point.
  712.  
  713. 7.5.  Bipolar Junction Transistors (BJT's)
  714. General form:
  715.  
  716.     QXXXXXXX NC NB NE <NS> MNAME <AREA> <OFF> <IC=VBE,VCE>
  717.  
  718. Examples:
  719.  
  720.     Q23 10 24 13 QMOD IC=0.6,5.0
  721.  
  722.  
  723.     Q50A 11 26 4 20 MOD1
  724.  
  725.      NC, NB, and NE are the collector, base, and  emitter  nodes,
  726. respectively.   NS is the (optional) substrate node.  If unspeci-
  727. fied, ground is used.  MNAME is the model name, AREA is the  area
  728. factor,  and OFF indicates an (optional) initial condition on the
  729. device for the dc analysis.  If the area  factor  is  omitted,  a
  730. value  of  1.0  is  assumed.   The  (optional)  initial condition
  731. specification using IC=VBE,VCE is intended for use with  the  UIC
  732. option  on  the  .TRAN card, when a transient analysis is desired
  733. starting from other than the quiescent operating point.  See  the
  734. .IC  card  description  for a better way to set transient initial
  735. conditions.
  736.  
  737. 7.6.  Junction Field-Effect Transistors (JFET's)
  738.  
  739. General form:
  740.  
  741.     JXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS,VGS>
  742.  
  743. Examples:
  744.  
  745.     J1 7 2 3 JM1 OFF
  746.  
  747.      ND, NG, and NS  are  the  drain,  gate,  and  source  nodes,
  748. respectively.   MNAME is the model name, AREA is the area factor,
  749. and OFF indicates an (optional) initial condition on  the  device
  750. for  dc  analysis.  If the area factor is omitted, a value of 1.0
  751. is assumed.   The  (optional)  initial  condition  specification,
  752. using  IC=VDS,VGS  is intended for use with the UIC option on the
  753. .TRAN card, when a transient analysis is  desired  starting  from
  754. other than the quiescent operating point.  See the .IC card for a
  755. better way to set initial conditions.
  756.  
  757. 7.7.  MOSFET's
  758.  
  759. General form:
  760.  
  761.     MXXXXXXX ND NG NS NB MNAME <L=VAL> <W=VAL> <AD=VAL> <AS=VAL>
  762.     + <PD=VAL> <PS=VAL> <NRD=VAL> <NRS=VAL> <OFF> <IC=VDS,VGS,VBS>
  763.  
  764. Examples:
  765.  
  766.     M1 24 2 0 20 TYPE1
  767.     M31 2 17 6 10 MODM L=5U W=2U
  768.     M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
  769.  
  770. ND, NG, NS, and NB are the drain, gate, source,  and  bulk  (sub-
  771. strate)  nodes,  respectively.  MNAME is the model name.  L and W
  772. are the channel length and width, in meters.  AD and AS  are  the
  773. areas  of  the  drain  and source diffusions, in sq-meters.  Note
  774. that the suffix U specifies microns (1E-6  m)  and  P  sq-microns
  775. (1E-12  sq-m).  If  any  of  L,  W,  AD, or AS are not specified,
  776. default values are used. The use  of  defaults  simplifies  input
  777. deck  preparation,  as  well  as  the  editing required if device
  778. geometries are to be changed.  PD and PS are  the  perimeters  of
  779. the drain and source junctions, in meters.  NRD and NRS designate
  780. the  equivalent  number  of  squares  of  the  drain  and  source
  781. diffusions; these values multiply the sheet resistance RSH speci-
  782. fied on the .MODEL card for an  accurate  representation  of  the
  783. parasitic  series drain and source resistance of each transistor.
  784. PD and PS default to 0.0 while NRD and NRS to 1.0.  OFF indicates
  785. an  (optional)  initial  condition on the device for dc analysis.
  786. The   (optional)   initial    condition    specification    using
  787. IC=VDS,VGS,VBS  is  intended  for  use with the UIC option on the
  788. .TRAN card, when a transient analysis is  desired  starting  from
  789. other than the quiescent operating point.  See the .IC card for a
  790. better and more convenient way to specify transient initial  con-
  791. ditions.
  792.  
  793. 7.8.  .MODEL Card
  794.  
  795. General form:
  796.  
  797.      .MODEL MNAME TYPE(PNAME1=PVAL1 PNAME2=PVAL2 ... )
  798.  
  799. Examples:
  800.  
  801.      .MODEL MOD1 NPN (BF=50 IS=1E-13 VBF=50)
  802.  
  803.      The .MODEL card specifies a set  of  model  parameters  that
  804. will  be  used  by one or more devices.  MNAME is the model name,
  805. and type is one of the following ten types:
  806.  
  807.                R      resistor model
  808.                C      capacitor model
  809.                URC    Uniform Distributed RC model
  810.                D      diode model
  811.                NPN    NPN BJT model
  812.                PNP    PNP BJT model
  813.                NJF    N-channel JFET model
  814.                PJF    P-channel JFET model
  815.                NMOS   N-channel MOSFET model
  816.                PMOS   P-channel MOSFET model
  817.                SW     voltage controlled switch
  818.                CSW    current controlled switch
  819.  
  820.      Parameter values are  defined  by  appending  the  parameter
  821. name,  as  given  below for each model type, followed by an equal
  822. sign and the parameter value.   Model  parameters  that  are  not
  823. given  a  value  are  assigned the default values given below for
  824. each model type.
  825.  
  826. 7.9.  Resistor Model
  827.  
  828.      The resistor model consists of process-related  device  data
  829. that  allow the resistance to be calculated from geometric infor-
  830. mation and to  be  corrected  for  temperature.   The  parameters
  831. available are:
  832.  
  833. name     parameter                         units    default   example
  834.                                              o
  835. TC1      first order temperature coeff.    Z/oC2    0.0       -
  836. TC2      second order temperature coeff.   Z/ C     0.0       -
  837. RSH      sheet resistance                  Z/[]     -         50
  838. DEFW     default width                     meters   1e-6      2e-6
  839. NARROW   narrowing due to side etching     meters   0.0       1e-7
  840.  
  841.  
  842.      The sheet resistance is used with  the  narrowing  parameter
  843. and  L  and  W  from  the  resistor card to determine the nominal
  844. resistance by the formula
  845.  
  846.                                L-NARROW
  847.                          R=RSHx
  848.                                W-NARROW
  849. Defw is used to supply a default value for W if one is not speci-
  850. fied  on  the  device card.  If either RSH or L is not specified,
  851. then the standard default resistance  value  of  1k  Z  is  used.
  852. After  the  nominal  resistance is calculated, it is adjusted for
  853. temperature by the formula:
  854.  
  855.     RES(temp)=RES(tnom)x(1+TC1x(temp-tnom)+TC2*(temp-tnom)2)
  856.  
  857. 7.10.  Capacitor Model
  858.  
  859.      The capacitor model contains process information that may be
  860. used  to compute the capacitance from strictly geometric informa-
  861. tion.
  862.  
  863. name     parameter                       units       default   example
  864.                                                  2
  865. CJ       junction bottom capacitance     F/meters    -         5e-5
  866. CJSW     junction sidewall capacitance   F/meters    -         2e-11
  867. DEFW     default device width            meters      1e-6      2e-6
  868. NARROW   narrowing due to side etching   meters      0.0       1e-7
  869.  
  870.      The capacitor has a capacitance computed as
  871.  
  872. CAP=CJx(LENGTH-NARROW)x(WIDTH-NARROW)+2xCJSWx(LENGTH+WIDTH-2*NARROW)
  873.  
  874. 7.11.  Uniform Distributed RC Model
  875.  
  876.      The URC model  is  derived  from  a  model  proposed  by  L.
  877. Gertzberrg  in  1974.   The model is accomplished by a subcircuit
  878. type expansion of the URC line into a network of lumped  RC  seg-
  879. ments  with internally generated nodes.  The RC segments are in a
  880. geometric progression, increasing toward the middle  of  the  URC
  881. line, with K as a proportionality constant.  The number of lumped
  882. segments used, if not specified on the URC line card,  is  deter-
  883. mined by the following formula:
  884.                                               2
  885.                       |     R C      2 |(K-1)| |
  886.                    log|Fmaxx x x2xJxl x|     | |
  887.                       |     L L        |  K  | |
  888.                 N= _____________________________
  889.                                logK
  890.  
  891.      The URC line will be made up strictly of resistor and  capa-
  892. citor  segments  unless  the ISPERL parameter is given a non-zero
  893. value, in which case the capacitors  are  replaced  with  reverse
  894. biased diodes with a zero-bias junction capacitance equivalent to
  895. the capacitance replaced, and with a saturation current of ISPERL
  896. amps per meter of transmission line and an optional series resis-
  897. tance equivalent to RSPERL ohms per meter.
  898.  
  899.      name     parameter                            units   default   example   area
  900.  
  901.  
  902.  
  903.  1   K        Propagation Constant                 -       2.0       1.2       -
  904.  2   FMAX     Maximum Frequency of interest        Hz      1.0G      6.5MEG    -
  905.  3   RPERL    Resistance per unit length           Ohm/m   1000      10        -
  906.  4   CPERL    Capacitance per unit length          F/m     1.0E-15   1PF       -
  907.  5   ISPERL   Saturation Current per unit length   Amp/m   0         -         -
  908.  6   RSPERL   Diode Resistance per unit length     Ohm/m   0         -         -
  909.  
  910. 7.12.  Switch Model
  911.  
  912.      The switch  model  allows  an  almost  ideal  switch  to  be
  913. described  in  SPICE.  The switch is not quite ideal, in that the
  914. resistance can not change from 0 to  infinity,  but  must  always
  915. have  a finite positive value.  By proper selection of the on and
  916. off resistances, they can be effectively  zero  and  infinity  in
  917. comparison  to  other circuit elements.  The parameters available
  918. are:
  919.  
  920.       name   parameter            units   default   switch
  921.       VT     threshold voltage    Volts   0.0       S
  922.       IT     threshold current    Amps    0.0       W
  923.       VH     hysteresis voltage   Volts   0.0       S
  924.       IH     hysteresis current   Amps    0.0       W
  925.       RON    on resistance        Z       1.0       both
  926.       ROFF   off resistance       Z       1/GMIN*   both
  927.  
  928.      *(See the .OPTIONS card  for  a  description  of  GMIN,  its
  929. default value results is a off resistance of 1.0e+12 ohms.)
  930.  
  931.      The use of an ideal element that is highly  non-linear  such
  932. as  a switch can cause large discontinuities to occur in the cir-
  933. cuit node voltages.  A rapid change such as that associated  with
  934. a switch changing state can cause numerical roundoff or tolerance
  935. problems leading to erroneous results or  timestep  difficulties.
  936. The user of switches can improve the situation by taking the fol-
  937. lowing steps:
  938.  
  939.      First of all it is wise to set ideal switch impedences  only
  940. high  and  low enough to be negligible with respect to other cir-
  941. cuit elements.  Using switch impedences that are close to "ideal"
  942. in  all  cases will aggravate the problem of discontinuities men-
  943. tioned above.  Of cource, when modeling real devices such as MOS-
  944. FETS,  the  on resistance should be adjusted to a realistic level
  945. depending on the size of the device being modelled.
  946.  
  947.      If a wide rango of ON to OFF resistance must be used in  the
  948. switched  (ROFF/RON >1e+12), then the tolerance on errors allowed
  949. during transient  analysis  should  be  decreased  by  using  the
  950. .OPTIONS  card  and  specifying TRTOL to be less than the default
  951. value of 7.0.  When switches are placed around  capacitors,  then
  952. the  option  CHGTOL should also be reduced.  Suggested values for
  953. these two options are 1.0 and 1e-16 respectively.  These  changes
  954. inform SPICE3 to be more careful around the switch points so that
  955. no errors are made due to the rapid change in the circuit.
  956.  
  957. 7.13.  Diode Model
  958.  
  959.      The dc characteristics of the diode are  determined  by  the
  960. parameters  IS  and  N.   An  ohmic  resistance, RS, is included.
  961. Charge storage effects are modeled by a transit time, TT,  and  a
  962. nonlinear  depletion layer capacitance which is determined by the
  963. parameters CJO, VJ, and M.  The  temperature  dependence  of  the
  964. saturation  current  is  defined by the parameters EG, the energy
  965. and XTI, the saturation current  temperature  exponent.   Reverse
  966. breakdown  is  modeled  by an exponential increase in the reverse
  967. diode current and is determined by  the  parameters  BV  and  IBV
  968. (both of which are positive numbers).
  969.  
  970.      name   parameter                        units   default    example    area
  971.  1   IS     saturation current               A       1.0E-14    1.0E-14    *
  972.  2   RS     ohmic resistance                 Ohm     0          10         *
  973.  3   N      emission coefficient             -       1          1.0
  974.  4   TT     transit-time                     sec     0          0.1Ns
  975.  5   CJO    zero-bias junction capacitance   F       0          2PF        *
  976.  6   VJ     junction potential               V       1          0.6
  977.  7   M      grading coefficient              -       0.5        0.5
  978.  8   EG     activation energy                eV      1.11       1.11 Si
  979. .69 Sbd
  980. .67 Ge
  981.  9   XTI    saturation-current temp. exp     -       3.0        3.0 jn
  982. .0 Sbd
  983. 10   KF     flicker noise coefficient        -       0
  984. 11   AF     flicker noise exponent           -       1
  985. 12   FC     coefficient for forward-bias     -       0.5
  986.             depletion capacitance formula
  987. 13   BV     reverse breakdown voltage        V       infinite   40.0
  988. 14   IBV    current at breakdown voltage     A       1.0E-3
  989.  
  990. 7.14.  BJT Models (both NPN and PNP)
  991.  
  992.      The bipolar junction transistor model in SPICE is an adapta-
  993. tion  of  the  integral  charge control model of Gummel and Poon.
  994. This modified Gummel-Poon model extends  the  original  model  to
  995. include  several  effects  at  high  bias levels.  The model will
  996. automatically simplify to the simpler Ebers-Moll model when  cer-
  997. tain  parameters  are  not specified. The parameter names used in
  998. the modified Gummel-Poon model have been chosen to be more easily
  999. understood by the program user, and to reflect better both physi-
  1000. cal and circuit design thinking.
  1001.  
  1002.      The dc model is defined by the parameters IS, BF,  NF,  ISE,
  1003. IKF, and NE which determine the forward current gain characteris-
  1004. tics, IS, BR, NR, ISC, IKR, and NC which  determine  the  reverse
  1005. current gain characteristics, and VAF and VAR which determine the
  1006. output conductance for forward and reverse regions.  Three  ohmic
  1007. resistances  RB,  RC,  and  RE are included, where RB can be high
  1008. current dependent.  Base charge storage is modeled by forward and
  1009. reverse  transit  times,  TF  and TR, the forward transit time TF
  1010. being bias dependent if desired, and  nonlinear  depletion  layer
  1011. capacitances  which  are  determined by CJE, VJE, and MJE for the
  1012. B-E junction , CJC, VJC, and MJC for the B-C  junction  and  CJS,
  1013. VJS,  and  MJS  for  the C-S (Collector-Substrate) junction.  The
  1014. temperature dependence of the saturation current, IS,  is  deter-
  1015. mined  by the energy-gap, EG, and the saturation current tempera-
  1016. ture exponent, XTI.  Additionally base current temperature depen-
  1017. dence  is modeled by the beta temperature exponent XTB in the new
  1018. model.
  1019.  
  1020.      The  BJT parameters used in the modified  Gummel-Poon  model
  1021. are listed below. The parameter names used in earlier versions of
  1022. SPICE2 are still accepted.
  1023.  
  1024.         Modified Gummel-Poon BJT Parameters.
  1025.  
  1026.      name   parameter                               units   default    example   area
  1027. 1    IS     transport saturation current            A       1.0E-16    1.0E-15   *
  1028. 2    BF     ideal maximum forward beta              -       100        100
  1029. 3    NF     forward current emission coefficient    -       1.0        1
  1030. 4    VAF    forward Early voltage                   V       infinite   200
  1031. 5    IKF    corner for forward beta
  1032.             high current roll-off                   A       infinite   0.01      *
  1033. 6    ISE    B-E leakage saturation current          A       0          1.0E-13   *
  1034. 7    NE     B-E leakage emission coefficient        -       1.5        2
  1035. 8    BR     ideal maximum reverse beta              -       1          0.1
  1036. 9    NR     reverse current emission coefficient    -       1          1
  1037. 10   VAR    reverse Early voltage                   V       infinite   200
  1038. 11   IKR    corner for reverse beta
  1039.             high current roll-off                   A       infinite   0.01      *
  1040. 12   ISC    B-C leakage saturation current          A       0          1.0E-13   *
  1041. 13   NC     B-C leakage emission coefficient        -       2          1.5
  1042. 14   RB     zero bias base resistance               Ohms    0          100       *
  1043. 15   IRB    current where base resistance
  1044.             falls halfway to its min value          A       infinite   0.1       *
  1045. 16   RBM    minimum base resistance
  1046.             at high currents                        Ohms    RB         10        *
  1047. 17   RE     emitter resistance                      Ohms    0          1         *
  1048. 18   RC     collector resistance                    Ohms    0          10        *
  1049. 19   CJE    B-E zero-bias depletion capacitance     F       0          2PF       *
  1050. 20   VJE    B-E built-in potential                  V       0.75       0.6
  1051. 21   MJE    B-E junction exponential factor         -       0.33       0.33
  1052. 22   TF     ideal forward transit time              sec     0          0.1Ns
  1053. 23   XTF    coefficient for bias dependence of TF   -       0
  1054. 24   VTF    voltage describing VBC
  1055.             dependence of TF                        V       infinite
  1056. 25   ITF    high-current parameter
  1057.             for effect on TF                        A       0                    *
  1058. 26   PTF    excess phase at freq=1.0/(TF*2PI) Hz    deg     0
  1059. 27   CJC    B-C zero-bias depletion capacitance     F       0          2PF       *
  1060. 28   VJC    B-C built-in potential                  V       0.75       0.5
  1061. 29   MJC    B-C junction exponential factor         -       0.33       0.5
  1062. 30   XCJC   fraction of B-C depletion capacitance   -       1
  1063.             connected to internal base node
  1064. 31   TR     ideal reverse transit time              sec     0          10Ns
  1065. 32   CJS    zero-bias collector-substrate
  1066.             capacitance                             F       0          2PF       *
  1067. 33   VJS    substrate junction built-in potential   V       0.75
  1068. 34   MJS    substrate junction exponential factor   -       0          0.5
  1069. 35   XTB    forward and reverse beta
  1070.             temperature exponent                    -       0
  1071. 36   EG     energy gap for temperature
  1072.             effect on IS                            eV      1.11
  1073. 37   XTI    temperature exponent for effect on IS   -       3
  1074. 38   KF     flicker-noise coefficient               -       0
  1075. 39   AF     flicker-noise exponent                  -       1
  1076. 40   FC     coefficient for forward-bias
  1077.             depletion capacitance formula           -       0.5
  1078.  
  1079. 7.15.  JFET Models (both N and P Channel)
  1080.  
  1081.      The JFET model is derived from the FET model of Shichman and
  1082. Hodges.  The dc characteristics are defined by the parameters VTO
  1083. and BETA, which determine the variation  of  drain  current  with
  1084. gate  voltage,  LAMBDA,  which determines the output conductance,
  1085. and IS, the saturation current of the two  gate  junctions.   Two
  1086. ohmic  resistances,  RD  and RS, are included.  Charge storage is
  1087. modeled by nonlinear depletion layer capacitances for  both  gate
  1088. junctions  which  vary  as the -1/2 power of junction voltage and
  1089. are defined by the parameters CGS, CGD, and PB.
  1090.  
  1091.      name     parameter                            units    default   example   area
  1092.  1   VTO      threshold voltage                    V        -2.0      -2.0
  1093.  2   BETA     transconductance parameter           A/V**2   1.0E-4    1.0E-3    *
  1094.  3   LAMBDA   channel length modulation
  1095.               parameter                            1/V      0         1.0E-4
  1096.  4   RD       drain ohmic resistance               Ohm      0         100       *
  1097.  5   RS       source ohmic resistance              Ohm      0         100       *
  1098.  6   CGS      zero-bias G-S junction capacitance   F        0         5PF       *
  1099.  7   CGD      zero-bias G-D junction capacitance   F        0         1PF       *
  1100.  8   PB       gate junction potential              V        1         0.6
  1101.  9   IS       gate junction saturation current     A        1.0E-14   1.0E-14   *
  1102. 10   KF       flicker noise coefficient            -        0
  1103. 11   AF       flicker noise exponent               -        1
  1104. 12   FC       coefficient for forward-bias         -        0.5
  1105.               depletion capacitance formula
  1106.  
  1107. 7.16.  MOSFET Models (both N and P channel)
  1108.  
  1109.      SPICE provides four MOSFET device models,  which  differ  in
  1110. the  formulation  of  the I-V characteristic.  The variable LEVEL
  1111. specifies the model to be used:
  1112.  
  1113.        LEVEL=1 ->    Shichman-Hodges
  1114.        LEVEL=2 ->    MOS2 (as described in [1])
  1115.        LEVEL=3 ->    MOS3, a semi-empirical model(see [1])
  1116.        LEVEL=4 ->    BSIM (as described in [2])
  1117.  
  1118. The dc characteristics of the level 1 through level 3 MOSFETs are
  1119. defined  by the device parameters VTO, KP, LAMBDA, PHI and GAMMA.
  1120. These parameters are computed  by  SPICE  if  process  parameters
  1121. (NSUB,  TOX,  ...)  are  given,  but user-specified values always
  1122. override.  VTO is positive (negative) for  enhancement  mode  and
  1123. negative (positive) for depletion mode N-channel (P-channel) dev-
  1124. ices. Charge storage is modeled  by  three  constant  capacitors,
  1125. CGSO, CGDO, and CGBO which represent overlap capacitances, by the
  1126. nonlinear thin-oxide capacitance which is distributed  among  the
  1127. gate,  source,  drain,  and  bulk  regions,  and by the nonlinear
  1128. depletion-layer capacitances for both substrate junctions divided
  1129. into bottom and periphery, which vary as the MJ and MJSW power of
  1130. junction voltage respectively, and are determined by the  parame-
  1131. ters CBD, CBS, CJ, CJSW, MJ, MJSW and PB.  Charge storage effects
  1132. are modeled by the piecewise linear voltags-dependent capacitance
  1133. model  proposed  by Meyer.  The thin-oxide charge storage effects
  1134. are treated slightly different  for  the  LEVEL=1  model.   These
  1135. voltage-dependent capacitances are included only if TOX is speci-
  1136. fied in the input description  and  they  are  represented  using
  1137. Meyer's formulation.
  1138.  
  1139.      There is some overlap among the  parameters  describing  the
  1140. junctions, e.g. the reverse current can be input either as IS (in
  1141. A) or as JS (in A/m**2). Whereas the first is an  absolute  value
  1142. the second is multiplied by AD and AS to give the reverse current
  1143. of the drain and source junctions respectively. This  methodology
  1144. has  been chosen since there is no sense in relating always junc-
  1145. tion characteristics with AD and AS entered on the  device  card;
  1146. the  areas  can  be defaulted.  The same idea applies also to the
  1147. zero-bias junction capacitances CBD and CBS (in F) on  one  hand,
  1148. and  CJ (in F/m**2) on the other.  The parasitic drain and source
  1149. series resistance can be expressed as either RD and RS (in  ohms)
  1150. or  RSH  (in ohms/sq.), the latter being multiplied by the number
  1151. of squares NRD and NRS input on the device card.
  1152.  
  1153. SPICE level 1 to level 3 parameters.
  1154.  
  1155.      name     parameter                               units       default          example
  1156. 1    LEVEL    model index                             -           1
  1157. 2    VTO      zero-bias threshold voltage             V           0.0              1.0
  1158. 3    KP       transconductance parameter              A/V**2      2.0E-5           3.1E-5
  1159. 4    GAMMA    bulk threshold parameter                V**0.5      0.0              0.37
  1160. 5    PHI      surface potential                       V           0.6              0.65
  1161. 6    LAMBDA   channel-length modulation
  1162.               (MOS1 and MOS2 only)                    1/V         0.0              0.02
  1163. 7    RD       drain ohmic resistance                  Ohm         0.0              1.0
  1164. 8    RS       source ohmic resistance                 Ohm         0.0              1.0
  1165. 9    CBD      zero-bias B-D junction capacitance      F           0.0              20FF
  1166. 10   CBS      zero-bias B-S junction capacitance      F           0.0              20FF
  1167. 11   IS       bulk junction saturation current        A           1.0E-14          1.0E-15
  1168. 12   PB       bulk junction potential                 V           0.8              0.87
  1169. 13   CGSO     gate-source overlap capacitance
  1170.               per meter channel width                 F/m         0.0              4.0E-11
  1171. 14   CGDO     gate-drain overlap capacitance
  1172.               per meter channel width                 F/m         0.0              4.0E-11
  1173. 15   CGBO     gate-bulk overlap capacitance
  1174.               per meter channel length                F/m         0.0              2.0E-10
  1175. 16   RSH      drain and source diffusion
  1176.               sheet resistance                        Ohm/sq.     0.0              10.0
  1177. 17   CJ       zero-bias bulk junction bottom cap.
  1178.               per sq-meter of junction area           F/m**2      0.0              2.0E-4
  1179. 18   MJ       bulk junction bottom grading coef.      -           0.5              0.5
  1180. 19   CJSW     zero-bias bulk junction sidewall cap.
  1181.               per meter of junction perimeter         F/m         0.0              1.0E-9
  1182. 20   MJSW     bulk junction sidewall grading coef.    -           0.50(level1)
  1183.  0.33(level2,3)
  1184. 21   JS       bulk junction saturation current
  1185.               per sq-meter of junction area           A/m**2                       1.0E-8
  1186. 22   TOX      oxide thickness                         meter       1.0E-7           1.0E-7
  1187. 23   NSUB     substrate doping                        1/cm**3     0.0              4.0E15
  1188. 24   NSS      surface state density                   1/cm**2     0.0              1.0E10
  1189. 25   NFS      fast surface state density              1/cm**2     0.0              1.0E10
  1190. 26   TPG      type of gate material:                  -           1.0
  1191.                   +1 opp. to substrate
  1192.                   -1 same as substrate
  1193.                    0  Al gate
  1194. 27   XJ       metallurgical junction depth            meter       0.0              1U
  1195. 28   LD       lateral diffusion                       meter       0.0              0.8U
  1196. 29   UO       surface mobility                        cm**2/V-s   600              700
  1197. 30   UCRIT    critical field for mobility
  1198.               degradation (MOS2 only)                 V/cm        1.0E4            1.0E4
  1199. 31   UEXP     critical field exponent in
  1200.               mobility degradation (MOS2 only)        -           0.0              0.1
  1201. 32   UTRA     transverse field coef (mobility)
  1202.               (deleted for MOS2)                      -           0.0              0.3
  1203. 33   VMAX     maximum drift velocity of carriers      m/s         0.0              5.0E4
  1204. 34   NEFF     total channel charge (fixed and
  1205.               mobile) coefficient (MOS2 only)         -           1.0              5.0
  1206. 35   KF       flicker noise coefficient               -           0.0              1.0E-26
  1207. 36   AF       flicker noise exponent                  -           1.0              1.2
  1208. 37   FC       coefficient for forward-bias
  1209.               depletion capacitance formula           -           0.5
  1210. 38   DELTA    width effect on threshold voltage
  1211.               (MOS2 and MOS3)                         -           0.0              1.0
  1212. 39   THETA    mobility modulation (MOS3 only)         1/V         0.0              0.1
  1213. 40   ETA      static feedback (MOS3 only)             -           0.0              1.0
  1214. 41   KAPPA    saturation field factor (MOS3 only)     -           0.2              0.5
  1215.  
  1216.      The level 4 parameters are all values obtained from  process
  1217. characterization, and can be generated automatically.  J. Pierret
  1218. [3] describes a means of generating a  'process'  file,  and  the
  1219. program Proc2Mod provided with SPICE3 will convert this file into
  1220. a sequence of .MODEL cards suitable  for  inclusion  in  a  SPICE
  1221. deck.   Parameters  marked below with an * in the l/w column also
  1222. have corresponding parameters with a length and width dependency.
  1223. For  example, VFB is the basic parameter with units of Volts, and
  1224. LVFB and WVFB also exist and have units of Volt-Mmeter  The  for-
  1225. mula
  1226.  
  1227.                             P          P
  1228.                    P=P +_____L____+_____W____
  1229.                       0 L          W
  1230.                          effective  effective
  1231. is used to evaluate the parameter for the actual device specified
  1232. with
  1233.  
  1234.                       L         =L     -DL
  1235.                        effective  input
  1236. and
  1237.  
  1238.                       W         =W     -DW
  1239.                        effective  input
  1240.      Note that unlike the other models in SPICE, the  BSIM  model
  1241. is  designed  for use with a process characterization system that
  1242. provides all the parameters, thus there are no defaults  for  the
  1243. parameters,  and  leaving one out is considered an error.  For an
  1244. example set of parameters and the format of a process  file,  see
  1245. the SPICE2 implementation notes[2].
  1246.  
  1247. SPICE BSIM (level 4) parameters.
  1248.  
  1249. name    parameterunits      l/w
  1250. VFB     flat-band voltage                                                         V          *
  1251. PHI     surface inversion potential                                               V          *
  1252. K1      body effect coefficient                                                   V1/2       *
  1253. K2      drain/source depletion charge sharing coefficient                         -          *
  1254. ETA     zero-bias drain-induced barrier lowering coefficient                      -          *
  1255. MUZ     zero-bias mobility                                                        cm2/V-s
  1256. DL      shortening of channel                                                     Mm
  1257. DW      narrowing of channel                                                      Mm
  1258. U0      zero-bias transverse-field mobility degradation coefficient               V-1        *
  1259. U1      zero-bias velocity saturation coefficient                                 Mm/V       *
  1260. X2MZ    sens. of mobility to substrate bias at v  =0                              cm2/V2-s   *
  1261. X2E     sens. of drain-induced barrier lowering dsfect to substrate bias          V-1        *
  1262. X3E     sens. of drain-induced barrier lowering effect to drain bias at V  =V     V-1        *
  1263. X2U0    sens. of transverse field mobility degradation effect to substratdsbidd   V-2        *
  1264. X2U1    sens. of velocity saturation effect to substrate bias                     MmV-2      *
  1265. MUS     mobility at zero substrate bias and at V  =V                              cm2/V2-s
  1266. X2MS    sens. of mobility to substrate bias at Vds=Vdd                            cm2/V2-s   *
  1267. X3MS    sens. of mobility to drain bias at V  =Vds  dd                            cm2/V2-s   *
  1268. X3U1    sens. of velocity saturation effect ds dddin bias at V  =V                MmV-2      *
  1269. TOX     gate oxide thickness                                  ds  dd              Mm
  1270. TEMP    temperature at which parameters were measured                             oC
  1271. VDD     measurement bias range                                                    V
  1272. CGDO    gate-drain overlap capacitance per meter channel width                    F/m
  1273. CGSO    gate-source overlap capacitance per meter channel width                   F/m
  1274. CGBO    gate-bulk overlap capacitance per meter channel length                    F/m
  1275. XPART   gate-oxide capacitance charge model flag                                  -
  1276. N0      zero-bias subthreshold slope coefficient                                  -          *
  1277. NB      sens. of subthreshold slope to substrate bias                             -          *
  1278. ND      sens. of subthreshold slope to drain bias                                 -          *
  1279.      XPART = 0 selects a 40/60 drain/source charge  partition  in
  1280. saturation,  while  XPART=1  selects  a 0/100 drain/source charge
  1281. partition.  XPART=1 is recommended.
  1282.  
  1283. [1] A. Vladimirescu and S. Liu, "The Simulation of MOS Integrated
  1284. Circuits  Using  SPICE2",  ERL  Memo  No.  ERL M80/7, Electronics
  1285. Research Laboratory, University  of  California,  Berkeley,  Oct.
  1286. 1980.
  1287. [2] B. J. Sheu, D. L. Scharfetter, and P. K. Ko,  "SPICE2  Imple-
  1288. mentation  of BSIM" ERL Memo No. ERL M85/42, Electronics Research
  1289. Laboratory, University of California, Berkeley, May 1985.
  1290. [3] J. R. Pierret, "A MOS Parameter Extraction  Program  for  the
  1291. BSIM  Model"  ERL  Memo  Nos. ERL M84/99 and M84/100, Electronics
  1292. Research Laboratory, University  of  California,  Berkeley,  Nov.
  1293. 1984.
  1294.  
  1295. 8.  SUBCIRCUITS
  1296.  
  1297.      A subcircuit that consists of SPICE elements can be  defined
  1298. and  referenced  in a fashion similar to device models.  The sub-
  1299. circuit is defined in the input deck by  a  grouping  of  element
  1300. cards;   the program then automatically inserts the group of ele-
  1301. ments wherever the subcircuit is referenced.  There is  no  limit
  1302. on  the  size  or  complexity of subcircuits, and subcircuits may
  1303. contain other subcircuits.  An example  of  subcircuit  usage  is
  1304. given in Appendix A.
  1305.  
  1306.  
  1307. 8.1.  .SUBCKT Card
  1308.  
  1309. General form:
  1310. Examples:
  1311.      A circuit definition is begun with a .SUBCKT  card.   SUBNAM
  1312. is  the  subcircuit name, and N1, N2, ... are the external nodes,
  1313. which cannot be zero.  The group of element cards  which  immedi-
  1314. ately  follow  the  .SUBCKT card define the subcircuit.  The last
  1315. card in a subcircuit definition is the .ENDS  card  (see  below).
  1316. Control  cards  may  not  appear  within a subcircuit definition;
  1317. however,  subcircuit  definitions  may  contain  anything   else,
  1318. including  other  subcircuit definitions, device models, and sub-
  1319. circuit calls (see below).  Note that any device models  or  sub-
  1320. circuit  definitions  included as part of a subcircuit definition
  1321. are strictly local (i.e., such models  and  definitions  are  not
  1322. known  outside  the  subcircuit  definition).   Also, any element
  1323. nodes not included on the .SUBCKT card are strictly  local,  with
  1324. the exception of 0 (ground) which is always global.
  1325.  
  1326. 8.2.  .ENDS Card
  1327.  
  1328. General form:
  1329.  
  1330.      .ENDS <SUBNAM>
  1331.  
  1332. Examples:
  1333.  
  1334.      .ENDS OPAMP
  1335.  
  1336.      This card must be the last one for  any  subcircuit  defini-
  1337. tion.   The subcircuit name, if included, indicates which subcir-
  1338. cuit definition is being terminated;  if omitted, all subcircuits
  1339. being  defined  are  terminated.   The  name  is needed only when
  1340. nested subcircuit definitions are being made.
  1341.  
  1342. 8.3.  Subcircuit Calls
  1343.  
  1344. General form:
  1345.  
  1346.     XYYYYYYY N1 <N2 N3 ...> SUBNAM
  1347.  
  1348. Examples:
  1349.  
  1350.     X1 2 4 17 3 1 MULTI
  1351.  
  1352.      Subcircuits are used in SPICE by specifying  pseudo-elements
  1353. beginning  with the letter X, followed by the circuit nodes to be
  1354. used in expanding the subcircuit.
  1355.  
  1356. 9.  CONTROL CARDS
  1357.  
  1358. 9.1.  .OPTIONS Card
  1359.  
  1360. General form:
  1361.  
  1362.      .OPTIONS OPT1 OPT2 ... (or OPT=OPTVAL ...)
  1363.  
  1364. Examples:
  1365.  
  1366.      .OPTIONS RELTOL=.005 TRTOL=8
  1367.  
  1368.      This card allows the user to reset program control and  user
  1369. options for specific simulation purposes.  Any combination of the
  1370. following options may be included, in  any  order.   'x'  (below)
  1371. represents some positive number.
  1372.  
  1373. option     effect
  1374. GMIN=x     resets the value of GMIN, the minimum conductance
  1375.            allowed by the program.  The default value is 1.0E-12.
  1376. RELTOL=x   resets the relative error tolerance of the program.  The
  1377.            default value is 0.001 (0.1 percent).
  1378. ABSTOL=x   resets the absolute current error tolerance of the
  1379.            program.  The default value is 1 picoamp.
  1380. VNTOL=x    resets the absolute voltage error tolerance of the
  1381.            program.  The default value is 1 microvolt.
  1382. TRTOL=x    resets the transient error tolerance.  The default value
  1383.            is 7.0.  This parameter is an estimate of the factor by
  1384.            which SPICE overestimates the actual truncation error.
  1385. CHGTOL=x   resets the charge tolerance of the program.  The default
  1386.            value is 1.0E-14.
  1387. PIVTOL=x   resets the absolute minimum value for a matrix entry
  1388.            to be accepted as a pivot.  The default value is 1.0E-13.
  1389. PIVREL=x   resets the relative ratio between the largest column entry
  1390.            and an acceptable pivot value. The default value is 1.0E-3.
  1391.            In the numerical pivoting algorithm the allowed minimum
  1392.            pivot value is determined by
  1393.            EPSREL=AMAX1(PIVREL*MAXVAL,PIVTOL)
  1394.            where MAXVAL is the maximum element in the column where
  1395.            a pivot is sought (partial pivoting).
  1396. TNOM=x     resets the nominal temperature.  The default value is
  1397.            27 deg C (300 deg K).
  1398. ITL1=x     resets the dc iteration limit.  The default is 100.
  1399. ITL2=x     resets the dc transfer curve iteration limit.  The
  1400.            default is 50.
  1401. ITL5=x     resets the transient analysis total iteration limit.
  1402.            the default is 5000.  Set ITL5=0 to omit this test.
  1403. DEFL=x     resets the value for MOS channel length; the default
  1404.            is 100.0 micrometer.
  1405. DEFW=x     resets the value for MOS channel width; the default
  1406.            is 100.0 micrometer.
  1407. DEFAD=x    resets the value for MOS drain diffusion area; the
  1408.            default is 0.0.
  1409. DEFAS=x    resets the value for MOS source diffusion area; the
  1410.            default is 0.0.
  1411.  
  1412. 9.2.  .OP Card
  1413.  
  1414. General form:
  1415.  
  1416.      .OP
  1417.      The inclusion of this card in an input deck will force SPICE
  1418. to determine the dc operating point of the circuit with inductors
  1419. shorted and capacitors opened.  Note:  a dc analysis is automati-
  1420. cally  performed  prior  to a transient analysis to determine the
  1421. transient initial conditions, and prior  to  an  ac  small-signal
  1422. analysis  to  determine  the  linearized, small-signal models for
  1423. nonlinear devices.
  1424.  
  1425.      SPICE performs a dc operating point  analysis  if  no  other
  1426. analyses are requested.
  1427.  
  1428. 9.3.  .DC Card
  1429.  
  1430. General form:
  1431.  
  1432.      .DC SRCNAM VSTART VSTOP VINCR [SRC2 START2 STOP2 INCR2]
  1433.  
  1434. Examples:
  1435.  
  1436.      .DC VIN 0.25 5.0 0.25
  1437.      .DC VDS 0 10 .5 VGS 0 5 1
  1438.      .DC VCE 0 10 .25 IB 0 10U 1U
  1439.  
  1440.      This card defines the dc transfer  curve  source  and  sweep
  1441. limits.   SRCNAM is the name of an independent voltage or current
  1442. source.  VSTART, VSTOP, and VINCR are the  starting,  final,  and
  1443. incrementing  values  respectively.  The first example will cause
  1444. the value of the voltage source VIN to be swept from  0.25  Volts
  1445. to 5.0 Volts in increments of 0.25 Volts.  A second source (SRC2)
  1446. may optionally be specified with associated sweep parameters.  In
  1447. this case, the first source will be swept over its range for each
  1448. value of the second  source.   This  option  can  be  useful  for
  1449. obtaining  semiconductor  device output characteristics.  See the
  1450. second example data deck in that section of the guide.
  1451.  
  1452. 9.4.  .NODESET Card
  1453.  
  1454. General form:
  1455.  
  1456.      .NODESET V(NODNUM)=VAL V(NODNUM)=VAL ...
  1457.  
  1458. Examples:
  1459.  
  1460.      .NODESET V(12)=4.5 V(4)=2.23
  1461.  
  1462.      This card helps the program find the dc or initial transient
  1463. solution  by  making  a preliminary pass with the specified nodes
  1464. held to the given voltages.  The restriction is then released and
  1465. the  iteration continues to the true solution.  The .NODESET card
  1466. may be necessary for convergence on bistable or astable circuits.
  1467. In general, this card should not be necessary.
  1468.  
  1469. 9.5.  .IC Card
  1470. General form:
  1471.  
  1472.      .IC V(NODNUM)=VAL V(NODNUM)=VAL ...
  1473.  
  1474. Examples:
  1475.  
  1476.      .IC V(11)=5 V(4)=-5 V(2)=2.2
  1477.  
  1478.      This card is for setting transient initial  conditions.   It
  1479. has  two  different interpretations, depending on whether the UIC
  1480. parameter is specified on the .TRAN card.  Also, one  should  not
  1481.  
  1482. confuse  this  card with the .NODESET card.  The .NODESET card is
  1483. only to help dc convergence, and does not affect final bias solu-
  1484. tion (except for multi-stable circuits).  The two interpretations
  1485. of this card are as follows:
  1486.  
  1487.  1.  When the UIC parameter is specified on the .TRAN card,  then
  1488. the  node  voltages specified on the .IC card are used to compute
  1489. the capacitor, diode, BJT, JFET, and MOSFET  initial  conditions.
  1490. This  is  equivalent  to  specifying the IC=... parameter on each
  1491. device card, but is much more convenient.  The  IC=...  parameter
  1492. can  still  be  specified  and  will take precedence over the .IC
  1493. values.  Since no dc bias (initial transient)  solution  is  com-
  1494. puted  before  the  transient  analysis,  one should take care to
  1495. specify all dc source voltages on the .IC card if they are to  be
  1496. used to compute device initial conditions.
  1497.  
  1498.  2.  When the UIC parameter is not specified on the  .TRAN  card,
  1499. the  dc bias (initial transient) solution will be computed before
  1500. the transient analysis.  In this case, the node  voltages  speci-
  1501. fied on the .IC card will be forced to the desired initial values
  1502. during the bias solution.  During transient  analysis,  the  con-
  1503. straint on these node voltages is removed.
  1504.  
  1505. 9.6.  .AC Card
  1506.  
  1507. General form:
  1508.  
  1509.      .AC DEC ND FSTART FSTOP
  1510.  
  1511.  
  1512.      .AC OCT NO FSTART FSTOP
  1513.      .AC LIN NP FSTART FSTOP
  1514.  
  1515. Examples:
  1516.  
  1517.      .AC DEC 10 1 10K
  1518.      .AC DEC 10 1K 100MEG
  1519.      .AC LIN 100 1 100HZ
  1520.      DEC stands for decade variation, and ND  is  the  number  of
  1521. points  per  decade.   OCT stands for octave variation, and NO is
  1522. the number of points per octave.  LIN stands  for  linear  varia-
  1523. tion,  and  NP  is  the number of points.  FSTART is the starting
  1524. frequency, and FSTOP is the final frequency.   If  this  card  is
  1525. included  in  the  deck, SPICE will perform an ac analysis of the
  1526. circuit over the specified frequency range.  Note that  in  order
  1527. for  this  analysis  to  be  meaningful, at least one independent
  1528. source must have been specified with an ac value.
  1529.  
  1530. 9.7.  .TRAN Card
  1531.  
  1532. General form:
  1533.  
  1534.      .TRAN TSTEP TSTOP <TSTART <TMAX>>
  1535.  
  1536. Examples:
  1537.  
  1538.      .TRAN 1NS 100NS
  1539.      .TRAN 1NS 1000NS 500NS
  1540.      .TRAN 10NS 1US
  1541.  
  1542.      TSTEP is the printing or plotting increment for line-printer
  1543. output.   For use with the post-processor, TSTEP is the suggested
  1544. computing increment.  TSTOP is the final time, and TSTART is  the
  1545. initial  time.   If  TSTART is omitted, it is assumed to be zero.
  1546. The transient analysis always begins at time zero.  In the inter-
  1547. val  <zero,  TSTART>,  the circuit is analyzed (to reach a steady
  1548. state), but no outputs are  stored.   In  the  interval  <TSTART,
  1549. TSTOP>,  the circuit is analyzed and outputs are stored.  TMAX is
  1550. the maximum stepsize that SPICE will use (for default,  the  pro-
  1551. gram  chooses  either  TSTEP or (TSTOP-TSTART)/50.0, whichever is
  1552. smaller.  TMAX is useful when one wishes to guarantee a computing
  1553. interval which is smaller than the printer increment, TSTEP.
  1554.  
  1555.      UIC (use initial conditions) is an  optional  keyword  which
  1556. indicates  that  the  user  does  not want SPICE to solve for the
  1557. quiescent  operating  point  before   beginning   the   transient
  1558. analysis.   If  this  keyword is specified, SPICE uses the values
  1559. specified using IC=... on the various  elements  as  the  initial
  1560. transient  condition  and proceeds with the analysis.  If the .IC
  1561. card has been specified, then the node voltages on the  .IC  card
  1562. are  used  to  compute  the  intitial conditions for the devices.
  1563. Look at the description on the .IC card  for  its  interpretation
  1564. when UIC is not specified.
  1565.  
  1566. 9.8.  .FOUR Card
  1567.  
  1568.      The .FOUR card used by SPICE2 to request fourier analysis of
  1569. outputs  has  been  replaced by the fourier command in nutmeg and
  1570. the interactive SPICE3 front end. For details  of  this  command,
  1571. see the manuals for these interfaces.
  1572. 10.  APPENDIX A:  EXAMPLE DATA DECKS
  1573.  
  1574. 10.1.  Circuit 1
  1575.  
  1576.      The following deck determines the dc operating  point  of  a
  1577. simple  differential  pair.  In  addition,  the  ac  small-signal
  1578. response is computed over the frequency range 1Hz to 100MEGHz.
  1579.  
  1580.     SIMPLE DIFFERENTIAL PAIR
  1581.     VCC 7 0 12
  1582.     VEE 8 0 -12
  1583.     VIN 1 0 AC 1
  1584.     RS1 1 2 1K
  1585.     RS2 6 0 1K
  1586.     Q1 3 2 4 MOD1
  1587.     Q2 5 6 4 MOD1
  1588.     RC1 7 3 10K
  1589.     RC2 7 5 10K
  1590.     RE 4 8 10K
  1591.      .MODEL MOD1 NPN BF=50 VAF=50 IS=1.E-12 RB=100 CJC=.5PF TF=.6NS
  1592.      .AC DEC 10 1 100MEG
  1593.      .END
  1594.  
  1595. 10.2.  Circuit 2
  1596.  
  1597. The following deck computes the output characteristics of a  MOS-
  1598. FET device over the range 0-10V for VDS and 0-5V for VGS.
  1599.  
  1600.      MOS OUTPUT CHARACTERISTICS
  1601.      .OPTIONS NODE NOPAGE
  1602.      VDS 3 0
  1603.      VGS 2 0
  1604.      M1 1 2 0 0 MOD1 L=4U W=6U AD=10P AS=10P
  1605.      .MODEL MOD1 NMOS VTO=-2 NSUB=1.0E15 UO=550
  1606.      * VIDS MEASURES ID, WE COULD HAVE USED VDS, BUT ID WOULD BE NEGATIVE
  1607.      VIDS 3 1
  1608.      .DC VDS 0 10 .5 VGS 0 5 1
  1609.      .END
  1610.  
  1611. 10.3.  Circuit 3
  1612.  
  1613.      The following deck determines the dc transfer curve and  the
  1614. transient  pulse response of a simple RTL inverter.  The input is
  1615. a pulse from 0 to 5 Volts with delay, rise, and fall times of 2ns
  1616. and a pulse width of 30ns.  The transient interval is 0 to 100ns,
  1617. with printing to be done every nanosecond.
  1618.  
  1619.      SIMPLE RTL INVERTER
  1620.      VCC 4 0 5
  1621.      VIN 1 0 PULSE 0 5 2NS 2NS 2NS 30NS
  1622.      RB 1 2 10K
  1623.      Q1 3 2 0 Q1
  1624.      RC 3 4 1K
  1625.      .MODEL Q1 NPN BF 20 RB 100 TF .1NS CJC 2PF
  1626.      .DC VIN 0 5 0.1
  1627.      .TRAN 1NS 100NS
  1628.      .END
  1629.  
  1630. 10.4.  Circuit 4
  1631.  
  1632.      The following deck simulates a four-bit binary adder,  using
  1633. several  subcircuits  to  describe  various pieces of the overall
  1634. circuit.
  1635.  
  1636.     ADDER - 4 BIT ALL-NAND-GATE BINARY ADDER
  1637.          *** SUBCIRCUIT DEFINITIONS
  1638.      .SUBCKT NAND 1 2 3 4
  1639.           *   NODES:  INPUT(2), OUTPUT, VCC
  1640.      Q1 9 5 1 QMOD
  1641.      D1CLAMP 0 1 DMOD
  1642.      Q2 9 5 2 QMOD
  1643.      D2CLAMP 0 2 DMOD
  1644.      RB 4 5 4K
  1645.      R1 4 6 1.6K
  1646.      Q3 6 9 8 QMOD
  1647.      R2 8 0 1K
  1648.      RC 4 7 130
  1649.      Q4 7 6 10 QMOD
  1650.      DVBEDROP 10 3 DMOD
  1651.      Q5 3 8 0 QMOD
  1652.      .ENDS NAND
  1653.      .SUBCKT ONEBIT 1 2 3 4 5 6
  1654.           *   NODES:  INPUT(2), CARRY-IN, OUTPUT, CARRY-OUT, VCC
  1655.      X1 1 2 7 6 NAND
  1656.      X2 1 7 8 6 NAND
  1657.      X3 2 7 9 6 NAND
  1658.      X4 8 9 10 6 NAND
  1659.      X5 3 10 11 6 NAND
  1660.      X6 3 11 12 6 NAND
  1661.      X7 10 11 13 6 NAND
  1662.      X8 12 13 4 6 NAND
  1663.      X9 11 7 5 6 NAND
  1664.      .ENDS ONEBIT
  1665.      .SUBCKT TWOBIT 1 2 3 4 5 6 7 8 9
  1666.           *   NODES:  INPUT - BIT0(2) / BIT1(2), OUTPUT - BIT0 / BIT1,
  1667.           *           CARRY-IN, CARRY-OUT, VCC
  1668.      X1 1 2 7 5 10 9 ONEBIT
  1669.      X2 3 4 10 6 8 9 ONEBIT
  1670.      .ENDS TWOBIT
  1671.      .SUBCKT FOURBIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  1672.  
  1673.  
  1674.          *   NODES:  INPUT - BIT0(2) / BIT1(2) / BIT2(2) / BIT3(2),
  1675.          *           OUTPUT - BIT0 / BIT1 / BIT2 / BIT3, CARRY-IN, CARRY-OUT, VCC
  1676.      X1 1 2 3 4 9 10 13 16 15 TWOBIT
  1677.      X2 5 6 7 8 11 12 16 14 15 TWOBIT
  1678.      .ENDS FOURBIT
  1679.          *** DEFINE NOMINAL CIRCUIT
  1680.      .MODEL DMOD D
  1681.      .MODEL QMOD NPN(BF=75 RB=100 CJE=1PF CJC=3PF)
  1682.      VCC 99 0 DC 5V
  1683.      VIN1A 1 0 PULSE(0 3 0 10NS 10NS   10NS   50NS)
  1684.      VIN1B 2 0 PULSE(0 3 0 10NS 10NS   20NS  100NS)
  1685.      VIN2A 3 0 PULSE(0 3 0 10NS 10NS   40NS  200NS)
  1686.      VIN2B 4 0 PULSE(0 3 0 10NS 10NS   80NS  400NS)
  1687.      VIN3A 5 0 PULSE(0 3 0 10NS 10NS  160NS  800NS)
  1688.      VIN3B 6 0 PULSE(0 3 0 10NS 10NS  320NS 1600NS)
  1689.      VIN4A 7 0 PULSE(0 3 0 10NS 10NS  640NS 3200NS)
  1690.      VIN4B 8 0 PULSE(0 3 0 10NS 10NS 1280NS 6400NS)
  1691.      X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 FOURBIT
  1692.      RBIT0 9 0 1K
  1693.      RBIT1 10 0 1K
  1694.      RBIT2 11 0 1K
  1695.      RBIT3 12 0 1K
  1696.      RCOUT 13 0 1K
  1697.          *** (FOR THOSE WITH MONEY (AND MEMORY) TO BURN)
  1698.      .TRAN 1NS 6400NS
  1699.      .END
  1700.  
  1701. 10.5.  Circuit 5
  1702.  
  1703.      The following deck simulates a  transmission-line  inverter.
  1704. Two transmission-line elements are required since two propagation
  1705. modes are excited.  In the case of a coaxial line, the first line
  1706. (T1)  models  the inner conductor with respect to the shield, and
  1707. the second line (T2) models the shield with respect to  the  out-
  1708. side world.
  1709.  
  1710.  
  1711.  
  1712.     TRANSMISSION-LINE INVERTER
  1713.     V1 1 0 PULSE(0 1 0 0.1N)
  1714.     R1 1 2 50
  1715.     X1 2 0 0 4 TLINE
  1716.     R2 4 0 50
  1717.      .SUBCKT TLINE 1 2 3 4
  1718.     T1 1 2 3 4 Z0=50 TD=1.5NS
  1719.     T2 2 0 4 0 Z0=100 TD=1NS
  1720.      .ENDS TLINE
  1721.      .TRAN 0.1NS 20NS
  1722.      .END
  1723.