home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / education / n / spice / docs / SPICE3 / GUIDE < prev    next >
Text File  |  1988-01-27  |  88KB  |  2,427 lines

  1. .\" needs tbl, eqn and -me  
  2. .ll 6.5i
  3. .he '''%'
  4. .m1 1i
  5. .nr ?t 1
  6. .po 1i
  7. .if n \
  8. .      ls 2
  9. .if t \
  10. \{\
  11. .      nr $r 15p/10
  12. .      sz 10
  13. .\}
  14. .EQ
  15. delim $$
  16. gfont R
  17. .EN
  18. .(l C
  19. .b "SPICE 3A6 User's Guide"
  20. .sp 0.1i
  21. \*(td
  22. .sp 0.2i
  23. T. Quarles
  24. A.R.Newton, D.O.Pederson, A.Sangiovanni-Vincentelli
  25. .sp 0.2i
  26. Department of Electrical Engineering and Computer Sciences
  27. University of California
  28. Berkeley, Ca., 94720
  29. .sp 0.2i
  30. .)l
  31. .TS
  32. center box;
  33. cw(5i) .
  34. T{
  35. .(l C
  36. .b "Please Note"
  37. .)l
  38. .pp
  39. This 
  40. is the second release
  41. of SPICE3
  42. and the
  43. development of SPICE and its algorithms is ongoing
  44. at Berkeley.
  45. We believe that all of the features described here are
  46. fully functional; however, 
  47. not all of the intended capabilities of the program have been
  48. implemented in full yet.
  49. Please mail any reports of suspected bugs in the program
  50. or suggested enhancements to the program to:
  51. .(l
  52. EECS/ERL Industrial Support Office
  53. 461 Cory Hall
  54. U.C. Berkeley
  55. Berkeley, Ca.   94720
  56. .)l
  57. or by electronic mail to:
  58. .(l
  59. spice@cad.BERKELEY.EDU  (ARPAnet, CSnet)
  60. ucbvax!ucbcad!spice  (UUCPnet)
  61. .)l
  62. .pp
  63. Please include input to the program, output, suggestions
  64. as to where the problem may be, and if possible, a suggested fix!
  65. .pp
  66. SPICE3 has been in beta-test since April 1985 and
  67. has been in use at over twenty sites.
  68. This version is the result of our own work at Berkeley and the feedback
  69. we have received from our beta sites.  
  70. We thank them for their help.
  71. .sp .1i
  72. T}
  73. .TE
  74. .sp .2i
  75. .pp
  76. SPICE is a general-purpose circuit simulation program for nonlinear dc,
  77. nonlinear transient, and linear ac analyses.  Circuits may contain resistors,
  78. capacitors, inductors, mutual inductors, independent voltage and current
  79. sources, four types of dependent sources, transmission lines, and the four most
  80. common semiconductor devices:  diodes, BJT's, JFET's, and MOSFET's.
  81. .pp
  82. The SPICE3 version is based directly on SPICE 2G.6.
  83. While SPICE3 is being developed to include new features, 
  84. it will continue to support those capabilities and models
  85. which remain in extensive use in the SPICE2 program.
  86. .pp
  87. SPICE has built-in models for the semiconductor devices, and the user need
  88. specify only the pertinent model parameter values.  The model for the BJT is
  89. based on the integral charge model of Gummel and Poon;  however, if the Gummel-
  90. Poon parameters are not specified, the model reduces to the simpler Ebers-Moll
  91. model.  In either case, charge storage effects, ohmic resistances, and a
  92. current-dependent output conductance may be included.  The diode model can be
  93. used for either junction diodes or Schottky barrier diodes.  The JFET model is
  94. based on the FET model of Shichman and Hodges. 
  95. Four MOSFET models are implemented:
  96. MOS1 is described by a square-law I-V characteristic,
  97. MOS2[1] is an analytical model,
  98. while MOS3[1] is a semi-empirical 
  99. model,
  100. and MOS4[2,3] is the new BSIM (Berkeley Short-channel IGFET Model).
  101. MOS2, MOS3, and MOS4 include second-order effects such as
  102. channel length modulation, subthreshold conduction,
  103. scattering limited velocity saturation, small-size effects,
  104. and charge-controlled capacitances.
  105. .sp 0.5i
  106. .sh 1 "TYPES OF ANALYSIS"
  107. .sp 0.2i
  108. .sh 2 "DC Analysis"
  109. .sp 0.1i
  110. .pp
  111. The dc analysis portion of SPICE determines the dc operating point of the
  112. circuit with inductors shorted and capacitors opened.  A dc analysis is
  113. automatically performed prior to a transient analysis to determine the transient
  114. initial conditions, and prior to an ac small-signal analysis to determine the
  115. linearized, small-signal models for nonlinear devices.  
  116. .\"If requested, the dc
  117. .\"small-signal value of a transfer function (ratio of output variable to input
  118. .\"source), input resistance, and output resistance will also be computed as a
  119. .\"part of the dc solution.  
  120. The dc analysis can also be used to generate dc
  121. transfer curves:  a specified independent voltage or current source is stepped
  122. over a user-specified range and the dc output variables are stored for each
  123. sequential source value.  
  124. .\"If requested, SPICE also will determine the dc
  125. .\"small-signal sensitivities of specified output variables with respect to circuit
  126. .\"parameters.  The dc analysis options are specified on the .DC, .TF, .OP,
  127. .\"and .SENS control cards.
  128. .\".pp
  129. .\"If one desires to see the small-signal models for nonlinear devices
  130. .\"in conjunction with a transient analysis operating point, then the .OP
  131. .\"card must be provided.  The dc bias conditions will be identical for each
  132. .\"case, but the more comprehensive operating point information is not available
  133. .\"to be printed when transient initial conditions are computed.
  134. .sp 0.2i
  135. .sh 2 "AC Small-Signal Analysis"
  136. .sp 0.1i
  137. .pp
  138. The ac small-signal portion of SPICE computes the ac output variables as a
  139. function of frequency.  The program first computes the dc operating point of
  140. the circuit and determines linearized, small-signal models for all of the
  141. nonlinear devices in the circuit.  The resultant linear circuit is then analyzed
  142. over a user-specified range of frequencies.  The desired output of an ac small-
  143. signal analysis is usually a transfer function (voltage gain, transimpedance,
  144. etc).  If the circuit has only one ac input, it is convenient to set that input
  145. to unity and zero phase, so that output variables have the same value as the
  146. transfer function of the output variable with respect to the input.
  147. .sp 0.2i
  148. .sh 2 "Transient Analysis"
  149. .sp 0.1i
  150. .pp
  151. The transient analysis portion of SPICE computes the transient output
  152. variables as a function of time over a user-specified time interval.  The
  153. initial conditions are automatically determined by a dc analysis.  All sources
  154. which are not time dependent (for example, power supplies) are set to their dc
  155. value.  
  156. The transient time interval is
  157. specified on a .TRAN control line.
  158. .sp 0.5i
  159. .sh 1 "CONVERGENCE"
  160. .sp 0.2i
  161. .pp
  162. Both dc and transient solutions are obtained by an iterative process which
  163. is terminated when both of the following conditions hold:
  164. .sp 0.1i
  165. .ip 1)
  166. The nonlinear branch currents converge to within a tolerance of
  167. 0.1 percent or 1 picoamp (1.0E-12 Amp), whichever is larger.
  168. .ip 2)
  169. The node voltages converge to within a tolerance of 0.1 percent
  170. or 1 microvolt (1.0E-6 Volt), whichever is larger.
  171. .pp
  172. Although the algorithm used in SPICE has been found to be very reliable, in
  173. some cases it will fail to converge to a solution.  When this failure occurs,
  174. the program will terminate the job. 
  175. .pp
  176. Failure to converge in dc analysis is usually due to an error in
  177. specifying circuit connections, element values, or model parameter values.
  178. Regenerative switching circuits or circuits with positive feedback probably
  179. will not converge in the dc analysis unless the OFF option is used for some
  180. of the devices in the feedback path, or the .NODESET card is used to force the
  181. circuit to converge to the desired state.
  182. .sp 0.5i
  183. .sh 1 "INPUT FORMAT"
  184. .sp 0.2i
  185. .pp
  186. The input format for SPICE is of the free format type.  Fields on a card
  187. are separated by one or more blanks, a comma, an equal (=) sign, or a left or
  188. right parenthesis;  extra spaces are ignored.  A card may be continued by
  189. entering a + (plus) in column 1 of the following card;  SPICE continues reading
  190. beginning with column 2.
  191. .pp
  192. A name field must begin with a letter (A through Z) and cannot contain
  193. any delimiters. 
  194. .pp
  195. A number field may be an integer field (12, -44), a floating point field
  196. (3.14159), either an integer or floating point number followed by an integer
  197. exponent (1E-14, 2.65E3), or either an integer or a floating point number
  198. followed by one of the following scale factors:
  199. .sp 0.1i
  200. .TS
  201. center;
  202. l l l l l.
  203. T=1E12    G=1E9    MEG=1E6    K=1E3    MIL=25.4E-6
  204. M=1E-3    U=1E-6    N=1E-9    P=1E-12    F=1E-15
  205. .TE
  206. .sp 0.1i
  207. Letters immediately following a number that are not scale factors are ignored,
  208. and letters immediately following a scale factor are ignored.  Hence, 10, 10V,
  209. 10VOLTS, and 10HZ all represent the same number, and M, MA, MSEC, and MMHOS all
  210. represent the same scale factor.  Note that 1000, 1000.0, 1000HZ, 1E3, 1.0E3,
  211. 1KHZ, and 1K all represent the same number.
  212. .sp 0.5i
  213. .sh 1 "CIRCUIT DESCRIPTION"
  214. .sp 0.2i
  215. .pp
  216. The circuit to be analyzed is described to SPICE by a set of element
  217. cards, which define the circuit topology and element values, and a set of
  218. control cards, which define the model parameters and the run controls.  The
  219. first card in the input deck must be a title card, and the last card must be
  220. a .END card.  The order of the remaining cards is arbitrary (except, of course,
  221. that continuation cards must immediately follow the card being continued).
  222. .pp
  223. Each element in the circuit is specified by an element card that contains
  224. the element name, the circuit nodes to which the element is connected, and the
  225. values of the parameters that determine the electrical characteristics of the
  226. element.  The first letter of the element name specifies the element type.
  227. The format for the SPICE element types is given in what follows.  The strings
  228. XXXXXXX, YYYYYYY, and ZZZZZZZ denote arbitrary alphanumeric strings.  For
  229. example, a resistor name must begin with the letter R and can contain one
  230. or more characters.  Hence, R, R1, RSE, ROUT, and R3AC2ZY are valid resistor
  231. names.
  232. .pp
  233. Data fields that are enclosed in less than and greater than
  234. signs '< >' are optional.
  235. All indicated punctuation (parentheses, equal signs, etc.) 
  236. is optional and merely indicate the presence of any delimiter. 
  237. A consistent style such as
  238. that shown here will make the input easier to understand.
  239. With
  240. respect to branch voltages and currents, SPICE uniformly uses the associated
  241. reference convention (current flows in the direction of voltage drop).
  242. .pp
  243. Nodes names may be arbitrary character strings.
  244. The datum (ground) node must be named '0'.  The circuit cannot contain a
  245. loop of voltage sources and/or inductors and cannot contain a cutset of current
  246. sources and/or capacitors.  Each node in the circuit must have a dc path to
  247. ground.  Every node must have at least two connections except for transmission
  248. line nodes (to permit unterminated transmission lines) and MOSFET substrate
  249. nodes (which have two internal connections anyway).
  250. .sp 0.5i
  251. .sh 1 "TITLE CARD, COMMENT CARDS AND .END CARD"
  252. .sp 0.2i
  253. .sh 2 "Title Card"
  254. .sp 0.1i
  255. .b "Examples:"
  256. .(l
  257. POWER AMPLIFIER CIRCUIT
  258. TEST OF CAM CELL
  259. .)l
  260. .pp
  261. This card must be the first card in the input deck.  Its contents are
  262. printed verbatim as the heading for each section of output.
  263. .sp 0.2i
  264. .sh 2 ".END Card"
  265. .sp 0.1i
  266. .b "Examples:"
  267. .(l
  268.  .END
  269. .)l
  270. .pp
  271. This card must always be the last card in the input deck.  Note that the
  272. period is an integral part of the name.
  273. .sp 0.2i
  274. .sh 2 "Comment Card"
  275. .sp 0.1i
  276. .b "General Form:"
  277. .(l
  278. * <any comment>
  279. .)l
  280. .b "Examples:"
  281. .(l
  282. * RF=1K      GAIN SHOULD BE 100
  283. * MAY THE FORCE BE WITH MY CIRCUIT
  284. .)l
  285. .pp
  286. The asterisk in the first column indicates that this card is a
  287. comment card.  Comment cards may be placed anywhere in the circuit description.
  288. .sp 0.5i
  289. .sh 1 "ELEMENT CARDS"
  290. .sp 0.2i
  291. .sh 2 "Resistors"
  292. .sp 0.1i
  293. .b "General form:"
  294. .(l
  295. RXXXXXXX N1 N2 VALUE
  296. .)l
  297. .b "Examples:"
  298. .(l
  299. R1 1 2 100
  300. RC1 12 17 1K
  301. .)l
  302. .pp
  303. N1 and N2 are the two element nodes.  VALUE is the resistance (in ohms)
  304. and may be positive or negative but not zero.  
  305. .sp 0.2i
  306. .sh 2 "Capacitors and Inductors"
  307. .sp 0.1i
  308. .b "General form:"
  309. .(l
  310. CXXXXXXX N+ N- VALUE <IC=INCOND>
  311. LYYYYYYY N+ N- VALUE <IC=INCOND>
  312. .)l
  313. .b "Examples:"
  314. .(l
  315. CBYP 13 0 1UF
  316. COSC 17 23 10U IC=3V
  317. LLINK 42 69 1UH
  318. LSHUNT 23 51 10U IC=15.7MA
  319. .)l
  320. .pp
  321. N+ and N- are the positive and negative element nodes, respectively.
  322. VALUE is the capacitance in Farads or the inductance in Henries.
  323. .pp
  324. For the capacitor, the (optional) initial condition is the initial
  325. (time-zero) value of capacitor voltage (in Volts).  For the inductor,
  326. the (optional)
  327. initial condition is the initial (time-zero) value of inductor current (in
  328. Amps) that flows from N+, through the inductor, to N-.  Note that the initial
  329. conditions (if any) apply 'only' if the UIC option is specified on the .TRAN
  330. card.
  331. .sp 0.2i
  332. .sh 2 "Coupled (Mutual) Inductors"
  333. .sp 0.1i
  334. .b "General form:"
  335. .(l
  336. KXXXXXXX LYYYYYYY LZZZZZZZ VALUE
  337. .)l
  338. .b "Examples:"
  339. .(l
  340. K43 LAA LBB 0.999
  341. KXFRMR L1 L2 0.87
  342. .)l
  343. .pp
  344. LYYYYYYY and LZZZZZZZ are the names of the two coupled inductors, and
  345. VALUE is the coefficient of coupling, K, which must be greater than 0 and less
  346. than or equal to 1.  Using the 'dot' convention, place a 'dot' on the first
  347. node of each inductor.
  348. .sp 0.2i
  349. .sh 2 "Transmission Lines (Lossless)"
  350. .sp 0.1i
  351. .b "General form:"
  352. .(l
  353. TXXXXXXX N1 N2 N3 N4 Z0=VALUE <TD=VALUE> <F=FREQ <NL=NRMLEN>>
  354. +                    <IC=V1,I1,V2,I2>
  355. .)l
  356. .b "Examples:"
  357. .(l
  358. T1 1 0 2 0 Z0=50 TD=10NS
  359. .)l
  360. .pp
  361. N1 and N2 are the nodes at port 1;  N3 and N4 are the nodes at port 2.
  362. Z0 is the characteristic impedance.  The length of the line may be expressed in
  363. either of two forms.  The transmission delay, TD, may be specified directly (as
  364. TD=10ns, for example).  Alternatively, a frequency F may be given, together
  365. with NL, the normalized electrical length of the transmission line with respect
  366. to the wavelength in the line at the frequency F.  If a frequency is specified
  367. but NL is omitted, 0.25 is assumed (that is, the frequency is assumed to be the
  368. quarter-wave frequency).  Note that although both forms for expressing the line
  369. length are indicated as optional, one of the two must be specified.
  370. .pp
  371. Note that this element models only one propagating mode.  If all four
  372. nodes are distinct in the actual circuit, then two modes may be excited.  To
  373. simulate such a situation, two transmission-line elements are required.  (see
  374. the example in Appendix A for further clarification.)
  375. .pp
  376. The (optional) initial condition specification consists of the voltage
  377. and current at each of the transmission line ports.  Note that the initial
  378. conditions (if any) apply 'only' if the UIC option is specified on the .TRAN
  379. card.
  380. .sp 0.2i
  381. .sh 2 "Linear Dependent Sources"
  382. .sp 0.1i
  383. .pp
  384. SPICE allows circuits to contain linear dependent sources characterized by
  385. any of the four equations
  386. .sp 0.2i
  387.         i=g*v          v=e*v          i=f*i          v=h*i
  388. .sp 0.2i
  389. where g, e, f, and h are constants representing transconductance, voltage gain,
  390. current gain, and transresistance, respectively.  
  391. .sp 0.2i
  392. .sh 2 "Linear Voltage-Controlled Current Sources"
  393. .sp 0.1i
  394. .b "General form:"
  395. .(l
  396. GXXXXXXX N+ N- NC+ NC- VALUE
  397. .)l
  398. .b "Examples:"
  399. .(l
  400. G1 2 0 5 0 0.1MMHO
  401. .)l
  402. .pp
  403. N+ and N- are the positive and negative nodes, respectively.  Current flow
  404. is from the positive node, through the source, to the negative node.  NC+ and
  405. NC- are the positive and negative controlling nodes, respectively.  VALUE is
  406. the transconductance (in mhos).
  407. .sp 0.2i
  408. .sh 2 "Linear Voltage-Controlled Voltage Sources"
  409. .sp 0.1i
  410. .b "General form:"
  411. .(l
  412. EXXXXXXX N+ N- NC+ NC- VALUE
  413. .)l
  414. .b "Examples:"
  415. .(l
  416. E1 2 3 14 1 2.0
  417. .)l
  418. .pp
  419. N+ is the positive node, and N- is the negative node.  NC+ and NC- are the
  420. positive and negative controlling nodes, respectively.  VALUE is the voltage
  421. gain.
  422. .sp 0.2i
  423. .sh 2 "Linear Current-Controlled Current Sources"
  424. .sp 0.1i
  425. .b "General form:"
  426. .(l
  427. FXXXXXXX N+ N- VNAM VALUE
  428. .)l
  429. .b "Examples:"
  430. .(l
  431. F1 13 5 VSENS 5
  432. .)l
  433. .pp
  434. N+ and N- are the positive and negative nodes, respectively.  Current flow
  435. is from the positive node, through the source, to the negative node.  VNAM is
  436. the name of a voltage source through which the controlling current flows.  The
  437. direction of positive controlling current flow is from the positive node,
  438. through the source, to the negative node of VNAM.  VALUE is the current gain.
  439. .sp 0.2i
  440. .sh 2 "Linear Current-Controlled Voltage Sources"
  441. .sp 0.1i
  442. .b "General form:"
  443. .(l
  444. HXXXXXXX N+ N- VNAM VALUE
  445. .)l
  446. .b "Examples:"
  447. .(l
  448. HX 5 17 VZ 0.5K
  449. .)l
  450. .pp
  451. N+ and N- are the positive and negative nodes, respectively.  VNAM is the
  452. name of a voltage source through which the controlling current flows.  The
  453. direction of positive controlling current flow is from the positive node,
  454. through the source, to the negative node of VNAM.  VALUE is the transresistance
  455. (in ohms).
  456. .sp 0.2i
  457. .sh 2 "Independent Sources"
  458. .sp 0.1i
  459. .b "General form:"
  460. .(l
  461. VXXXXXXX N+ N- <<DC> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>
  462. IYYYYYYY N+ N- <<DC> DC/TRAN VALUE> <AC <ACMAG <ACPHASE>>>
  463. .)l
  464. .b "Examples:"
  465. .(l
  466. VCC 10 0 DC 6
  467. VIN 13 2 0.001 AC 1 SIN(0 1 1MEG)
  468. ISRC 23 21 AC 0.333 45.0 SFFM(0 1 10K 5 1K)
  469. VMEAS 12 9
  470. .)l
  471. .pp
  472. N+ and N- are the positive and negative nodes, respectively.  Note that
  473. voltage sources need not be grounded.  Positive current is assumed to flow from
  474. the positive node, through the source, to the negative node.
  475. A current source of positive value, will force current to flow out of
  476. the N+ node, through the source, and into the N- node.
  477. Voltage sources, in addition to being
  478. used for circuit excitation, are the 'ammeters' for SPICE,
  479. that is, zero valued voltage sources may be inserted into the circuit 
  480. for the purpose
  481. of measuring current.  They will, of course, have no effect on circuit
  482. operation since they represent short-circuits.
  483. .sp 0.2i
  484. .pp
  485. DC/TRAN is the dc and transient analysis value of the source.  If the
  486. source value is zero both for dc and transient analyses, this value may be
  487. omitted.  If the source value is time-invariant (e.g., a power supply), then
  488. the value may optionally be preceded by the letters DC.
  489. .sp 0.2i
  490. .pp
  491. ACMAG is the ac magnitude and ACPHASE is the ac phase.  The source is set
  492. to this value in the ac analysis.  If ACMAG is omitted following the keyword
  493. AC, a value of unity is assumed.  If ACPHASE is omitted, a value of zero is
  494. assumed.  If the source is not an ac small-signal input, the keyword AC and the
  495. ac values are omitted.
  496. .sp 0.2i
  497. .pp
  498. Any independent source can be assigned a time-dependent value for
  499. transient analysis.  If a source is assigned a time-dependent value, the
  500. time-zero value is used for dc analysis.  There are five independent source
  501. functions:  pulse, exponential, sinusoidal, piece-wise linear, and
  502. single-frequency FM.  If parameters other than source values are omitted or set
  503. to zero, the default values shown will be assumed.  (TSTEP is the printing
  504. increment and TSTOP is the final time (see the .TRAN card for explanation)).
  505. .sp 0.2i
  506. 1.  Pulse         PULSE(V1 V2 TD TR TF PW PER)
  507. .sp 0.1i
  508. .b "Examples:"
  509. .(l
  510. VIN 3 0 PULSE(-1 1 2NS 2NS 2NS 50NS 100NS)
  511. .)l
  512. .TS
  513. center;
  514. l l l.
  515. parameters    default values          units
  516. .sp 0.2i
  517. V1 (initial value)                 Volts or Amps
  518. V2 (pulsed value)        Volts or Amps
  519. TD (delay time)    0.0    seconds
  520. TR (rise time)    TSTEP    seconds
  521. TF (fall time)    TSTEP    seconds
  522. PW (pulse width)    TSTOP    seconds
  523. PER(period)              TSTOP      seconds
  524. .TE
  525. .pp
  526. A single pulse so specified is described by the following table:
  527. .sp 0.1i
  528. .TS
  529. center;
  530. l l.
  531. time    value
  532. .sp 0.2i
  533. 0    V1
  534. TD    V1
  535. TD+TR    V2
  536. TD+TR+PW    V2
  537. TD+TR+PW+TF    V1
  538. TSTOP    V1
  539. .TE
  540. Intermediate points are determined by linear interpolation.
  541. .sp 0.2i
  542. 2.  Sinusoidal    SIN(VO VA FREQ TD THETA)
  543. .sp 0.1i
  544. .b "Examples:"
  545. .(l
  546. VIN 3 0 SIN(0 1 100MEG 1NS 1E10)
  547. .)l
  548. .sp .1i
  549. .TS
  550. center;
  551. l l l.
  552. parameters    default value    units
  553. .sp 0.2i
  554. VO     (offset)               Volts or Amps
  555. VA     (amplitude)        Volts or Amps
  556. FREQ   (frequency)    1/TSTOP    Hz
  557. TD     (delay)    0.0    seconds
  558. THETA  (damping factor)    0.0    1/seconds
  559. .TE
  560. .pp
  561. The shape of the waveform is described by the following table:
  562. .TS
  563. center;
  564. l l.
  565. .sp 0.2i
  566. time    value
  567. .sp 0.2i
  568. 0 to TD    VO
  569. TD to TSTOP    VO + VA*exp(-(time-TD)*THETA)*sine(twopi*FREQ*(time+TD))
  570. .TE
  571. .sp 0.2i
  572. 3.  Exponential  EXP(V1 V2 TD1 TAU1 TD2 TAU2)
  573. .sp 0.1i
  574. .b "Examples:"
  575. .(l
  576. VIN 3 0 EXP(-4 -1 2NS 30NS 60NS 40NS)
  577. .)l
  578. .TS
  579. center;
  580. l l l.
  581. parameters    default values    units
  582. .sp 0.1i
  583. V1   (initial value)        Volts or Amps
  584. V2   (pulsed value)        Volts or Amps
  585. TD1  (rise delay time)    0.0    seconds
  586. TAU1 (rise time constant)    TSTEP    seconds
  587. TD2  (fall delay time)    TD1+TSTEP    seconds
  588. TAU2 (fall time constant)    TSTEP    seconds
  589. .TE
  590. .pp
  591. The shape of the waveform is described by the following table:
  592. .sp 0.1i
  593. .TS
  594. center;
  595. l l.
  596. time    value
  597. .sp 0.1i
  598. 0 to TD1    V1
  599. TD1 to TD2    V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
  600. TD2 to TSTOP    V1+(V2-V1)*(1-exp(-(time-TD1)/TAU1))
  601.     +(V1-V2)*(1-exp(-(time-TD2)/TAU2))
  602. .TE
  603. .sp .2i
  604. 4.  Piece-Wise Linear  PWL(T1 V1 <T2 V2 T3 V3 T4 V4 ...>)
  605. .sp 0.1i
  606. .b "Examples:"
  607. .(l
  608. VCLOCK 7 5 PWL(0 -7 10NS -7 11NS -3 17NS -3 18NS -7 50NS -7)
  609. .)l
  610. .sp 0.2i
  611. Parameters and default values
  612. .sp 0.2i
  613. .(l
  614. Each pair of values (Ti, Vi) specifies that the value of the source is Vi
  615. (in Volts or Amps) at time=Ti.  The value of the source at intermediate values
  616. of time is determined by using linear interpolation on the input values.
  617. .)l
  618. .sp 0.2i
  619. 5.  Single-Frequency FM   SFFM(VO VA FC MDI FS)
  620. .sp 0.1i
  621. .b "Examples:"
  622. .(l
  623. V1 12 0 SFFM(0 1M 20K 5 1K)
  624. .)l
  625. .sp 0.1i
  626. .TS
  627. center;
  628. l l l.
  629. parameters    default values    units
  630. .sp 0.2i
  631. VO  (offset)        Volts or Amps
  632. VA  (amplitude)        Volts or Amps
  633. FC  (carrier frequency)    1/TSTOP    Hz
  634. MDI (modulation index)        
  635. FS  (signal frequency)    1/TSTOP    Hz
  636. .TE
  637. .pp
  638. The shape of the waveform is described by the following equation:
  639. .sp 0.2i
  640. .(l
  641. value = VO + VA*sine((twopi*FC*time) + MDI*sine(twopi*FS*time))
  642. .)l
  643. .sp 0.2i
  644. .sh 2 "Switches"
  645. .sp 0.1i
  646. .b "General form:"
  647. .(l
  648. SXXXXXXX N+ N- NC+ NC- MODEL <ON><OFF>
  649. WYYYYYYY N+ N- VNAM MODEL <ON><OFF>
  650. .)l
  651. .b "Examples:"
  652. .(l
  653. s1 1 2 3 4 switch1 ON
  654. s2 5 6 3 0 sm2 off
  655. Switch1 1 2 10 0 smodel1
  656. w1 1 2 vclock switchmod1
  657. W2 3 0 vramp sm1 ON
  658. wreset 5 6 vclck lossyswitch OFF
  659. .)l
  660. .pp
  661. Nodes 1 and 2 are the nodes between which the switch terminals are connected.
  662. The model name is mandatory while the initial conditions are optional.
  663. For the voltage controlled switch,
  664. nodes 3 and 4 are the positive and negative controlling 
  665. nodes respectively.
  666. For the current controlled switch, the controlling current is that through
  667. the specified voltage source.  
  668. The direction of positive controlling current flow is from
  669. the positive node, through the source, to the
  670. negative node.
  671. .sp 0.5i
  672. .sh 1 "SEMICONDUCTOR DEVICES"
  673. .sp 0.2i
  674. .pp
  675. The elements described to this point typically require only
  676. a few parameter values.
  677. However, the models for the semiconductor devices that are
  678. included in the SPICE program require many parameter values.
  679. Often, many
  680. devices in a circuit are defined by the same set of device model
  681. parameters.  For these reasons, a set of device model parameters is defined on a
  682. separate .MODEL card and assigned a unique model name.  The device element
  683. cards in SPICE then refer to the model name.  This scheme alleviates the need
  684. to specify all of the model parameters on each device element card.
  685. .pp
  686. Each device element card contains the device name, the nodes to which the
  687. device is connected, and the device model name.  In addition, other optional
  688. parameters may be specified for some devices:  geometric factors and an initial
  689. condition.
  690. .pp
  691. The area factor used on the diode, BJT and JFET device cards
  692. determines the number of equivalent parallel devices of a
  693. specified model.  The affected parameters are marked with an asterisk under the
  694. heading 'area' in the model descriptions below.
  695. Several geometric factors associated with the channel and the drain and source
  696. diffusions can be specified on the MOSFET device card.
  697. .pp
  698. Two different forms of initial conditions may be specified for some devices.
  699. The first form is included to improve the dc convergence for circuits that
  700. contain more than one stable state.  If a device is specified OFF, the dc
  701. operating point is determined with the terminal voltages for that device set to
  702. zero.  After convergence is obtained, the program continues to iterate to
  703. obtain the exact value for the terminal voltages.  If a circuit has more than
  704. one dc stable state, the OFF option can be used to force the solution to
  705. correspond to a desired state.  If a device is specified OFF when in reality
  706. the device is conducting, the program will still obtain the correct solution
  707. (assuming the solutions converge) but more iterations will be required since
  708. the program must independently converge to two separate solutions.
  709. The .NODESET card serves a similar purpose as the OFF option.  The .NODESET
  710. option is easier to apply and is the preferred means to aid convergence.
  711. .pp
  712. The second form of initial conditions are specified for use with
  713. the transient analysis.  These are true 'initial conditions' as opposed
  714. to the convergence aids above.  See the description of the .IC card and
  715. the .TRAN card for a detailed explanation of initial conditions.
  716. .sp 0.2i
  717. .sh 2 "Semiconductor Resistors"
  718. .sp 0.1i
  719. .b "General form:"
  720. .(l
  721. RXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH>
  722. .)l
  723. .b "Examples:"
  724. .(l
  725. RLOAD 2 10 10K
  726. RMOD 3 7 RMODEL L=10u W=1u
  727. .)l
  728. .pp
  729. This is the more general form of the resistor presented in section 6.1,
  730. and allows the modeling of temperature effects and for the calculation
  731. of the actual resistance value from strictly geometric information and
  732. the specifications of the process.
  733. If VALUE is specified, it overrides the geometric information
  734. and defines the resistance.
  735. If MNAME is specified, then the resistance may be calculated from
  736. the process information in the model MNAME and the given LENGTH and WIDTH.
  737. If VALUE is not specified, then MNAME and LENGTH \fBmust\fP be specified.
  738. If WIDTH is not specified, then it will be taken from the default width
  739. given in the model.
  740. .sp 0.2i
  741. .sh 2 "Semiconductor Capacitors"
  742. .sp 0.1i
  743. .b "General form:"
  744. .(l
  745. CXXXXXXX N1 N2 <VALUE> <MNAME> <L=LENGTH> <W=WIDTH> <IC=VAL>
  746. .)l
  747. .b "Examples:"
  748. .(l
  749. CLOAD 2 10 10P
  750. CMOD 3 7 CMODEL L=10u W=1u
  751. .)l
  752. .pp
  753. This is the more general form of the Capacitor presented in section 6.2,
  754. and allows for the calculation
  755. of the actual capacitance value from strictly geometric information and
  756. the specifications of the process.
  757. If VALUE is specified, it defines the capacitance.
  758. If MNAME is specified, then the capacitance is calculated from
  759. the process information in the model MNAME and the given LENGTH and WIDTH.
  760. If VALUE is not specified, then MNAME and LENGTH \fBmust\fP be specified.
  761. If WIDTH is not specified, then it will be taken from the default width
  762. given in the model.
  763. Either VALUE or MNAME, LENGTH, and WIDTH may be specified, but not both
  764. sets.
  765. .sp 0.2i
  766. .sh 2 "Uniform Distributed RC Lines (Lossy)"
  767. .sp 0.1i
  768. .b "General form:"
  769. .(l
  770. UXXXXXXX N1 N2 N3 MNAME L=LEN <N=LUMPS>
  771. .)l
  772. .b "Examples:"
  773. .(l
  774. U1 1 2 0 URCMOD L=50U
  775. URC2 1 12 2 UMODL l=1MIL N=6
  776. .)l
  777. .pp
  778. N1 and N2 are the two element nodes the RC line connects, while N3 is the
  779. node to which the capacitances are connected.  
  780. MNAME is the model name, LEN is the length of the RC line in meters. 
  781. LUMPS, if specified, is the number of lumped segments to use in
  782. modeling the RC line (see the model description for the action
  783. taken if this parameter is omitted).  
  784. .sp 0.2i
  785. .sh 2 "Junction Diodes"
  786. .sp 0.1i
  787. .b "General form:"
  788. .(l
  789. DXXXXXXX N+ N- MNAME <AREA> <OFF> <IC=VD>
  790. .)l
  791. .b "Examples:"
  792. .(l
  793. DBRIDGE 2 10 DIODE1
  794. DCLMP 3 7 DMOD 3.0 IC=0.2
  795. .)l
  796. .pp
  797. N+ and N- are the positive and negative nodes, respectively.  MNAME is the
  798. model name, AREA is the area factor, and OFF indicates an (optional) starting
  799. condition on the device for dc analysis.  If the area factor is omitted, a
  800. value of 1.0 is assumed.  The (optional) initial condition specification using
  801. IC=VD is intended for use with the UIC option on the .TRAN card, when a
  802. transient analysis is desired starting from other than the quiescent operating
  803. point.
  804. .sp 0.2i
  805. .sh 2 "Bipolar Junction Transistors (BJT's)"
  806. .sp 0.1i
  807. .b "General form:"
  808. .(l
  809. QXXXXXXX NC NB NE <NS> MNAME <AREA> <OFF> <IC=VBE,VCE>
  810. .)l
  811. .b "Examples:"
  812. .(l
  813. Q23 10 24 13 QMOD IC=0.6,5.0
  814. Q50A 11 26 4 20 MOD1
  815. .)l
  816. .pp
  817. NC, NB, and NE are the collector, base, and emitter nodes, respectively.
  818. NS is the (optional) substrate node.  If unspecified, ground is used.
  819. MNAME is the model name, AREA is the area factor, and OFF indicates an
  820. (optional) initial condition on the device for the dc analysis.  If the area
  821. factor is omitted, a value of 1.0 is assumed.  The (optional) initial condition
  822. specification using IC=VBE,VCE is intended for use with the UIC option on
  823. the .TRAN card, when a transient analysis is desired starting from other than
  824. the
  825. quiescent operating point.  See the .IC card description for a better way to
  826. set transient initial conditions.
  827. .sp 0.2i
  828. .sh 2 "Junction Field-Effect Transistors (JFET's)"
  829. .sp 0.1i
  830. .b "General form:"
  831. .(l
  832. JXXXXXXX ND NG NS MNAME <AREA> <OFF> <IC=VDS,VGS>
  833. .)l
  834. .b "Examples:"
  835. .(l
  836. J1 7 2 3 JM1 OFF
  837. .)l
  838. .pp
  839. ND, NG, and NS are the drain, gate, and source nodes, respectively.  MNAME
  840. is the model name, AREA is the area factor, and OFF indicates an (optional)
  841. initial condition on the device for dc analysis.  If the area factor is
  842. omitted, a value of 1.0 is assumed.  The (optional) initial condition specification,
  843. using IC=VDS,VGS is intended for use with the UIC option on the .TRAN card,
  844. when a transient analysis is desired starting from other than the quiescent
  845. operating point.
  846. See the .IC card for a better way to set initial conditions.
  847. .sp 0.2i
  848. .sh 2 "MOSFET's"
  849. .sp 0.1i
  850. .b "General form:"
  851. .(l
  852. MXXXXXXX ND NG NS NB MNAME <L=VAL> <W=VAL> <AD=VAL> <AS=VAL>
  853. + <PD=VAL> <PS=VAL> <NRD=VAL> <NRS=VAL> <OFF> <IC=VDS,VGS,VBS>
  854. .)l
  855. .b "Examples:"
  856. .(l
  857. M1 24 2 0 20 TYPE1
  858. M31 2 17 6 10 MODM L=5U W=2U
  859. M1 2 9 3 0 MOD1 L=10U W=5U AD=100P AS=100P PD=40U PS=40U
  860. .)l
  861. ND, NG, NS, and NB are the drain, gate, source, and bulk (substrate)
  862. nodes, respectively.  MNAME is the model name.  L and W are the channel length
  863. and width, in meters.  AD and AS are the areas of the drain and source
  864. diffusions, in sq-meters.  Note that the suffix U specifies microns (1E-6 m)
  865. and P sq-microns (1E-12 sq-m). If any of L, W, AD, or AS are not specified,
  866. default values are used.  
  867. The use of defaults simplifies
  868. input deck preparation, as well as the editing required if device geometries
  869. are to be changed.
  870. PD and PS are the perimeters of the drain and source junctions, in meters.
  871. NRD and NRS designate the equivalent number of squares of the drain and
  872. source diffusions; these values multiply the sheet resistance RSH
  873. specified on the .MODEL card for an accurate representation of the
  874. parasitic series drain and source resistance of each transistor.
  875. PD and PS default to 0.0 while NRD and NRS to 1.0.
  876. OFF indicates an (optional) initial condition
  877. on the device for dc analysis.  The (optional) initial condition
  878. specification using IC=VDS,VGS,VBS is intended for use with the UIC option
  879. on the .TRAN card, when a transient analysis is desired starting from other
  880. than the quiescent operating point.  See the .IC card for a better and
  881. more convenient way to specify transient initial conditions.
  882. .sp 0.2i
  883. .sh 2 ".MODEL Card"
  884. .sp 0.1i
  885. .b "General form:"
  886. .(l
  887.  .MODEL MNAME TYPE(PNAME1=PVAL1 PNAME2=PVAL2 ... )
  888. .)l
  889. .b "Examples:"
  890. .(l
  891.  .MODEL MOD1 NPN (BF=50 IS=1E-13 VBF=50)
  892. .)l
  893. .pp
  894. The .MODEL card specifies a set of model parameters that will be used by
  895. one or more devices.  MNAME is the model name, and type is one of the following
  896. ten types:
  897. .TS
  898. center;
  899. l l.
  900. R    resistor model
  901. C    capacitor model
  902. URC    Uniform Distributed RC model
  903. D    diode model
  904. NPN    NPN BJT model
  905. PNP    PNP BJT model
  906. NJF    N-channel JFET model
  907. PJF    P-channel JFET model
  908. NMOS    N-channel MOSFET model
  909. PMOS    P-channel MOSFET model
  910. SW    voltage controlled switch
  911. CSW    current controlled switch
  912. .TE
  913. .pp
  914. Parameter values are defined by appending the parameter name, as given
  915. below for each model type, followed by an equal sign and the parameter value.
  916. Model parameters that are not given a value are assigned the default values
  917. given below for each model type.
  918. .sp 0.2i
  919. .sh 2 "Resistor Model"
  920. .sp 0.1i
  921. .pp
  922. The resistor model consists of process-related device data that allow
  923. the resistance to be calculated from geometric information and to be
  924. corrected for temperature.
  925. The parameters available are:
  926. .TS
  927. center;
  928. l l l l l.
  929. name    parameter    units    default    example
  930. .sp .2i
  931. TC1    first order temperature coeff.    \(*W/\(de$C$    0.0    -
  932. TC2    second order temperature coeff.    \(*W/\(de$C sup 2$    0.0    -
  933. RSH    sheet resistance    \(*W/\(sq    -    50
  934. DEFW    default width    meters    1e-6    2e-6
  935. NARROW    narrowing due to side etching    meters    0.0    1e-7
  936. .TE
  937. .sp .1i
  938. .pp
  939. The sheet resistance is used with the narrowing
  940. parameter and L and W from the
  941. resistor card to determine the nominal resistance by the
  942. formula
  943. .EQ
  944. R = RSH times { L - NARROW } over { W - NARROW }
  945. .EN
  946. Defw is used to supply a default value for W if one is
  947. not specified on the device card.
  948. If either RSH or L is not specified, then the standard default
  949. resistance value of 1k \(*W is used.
  950. After the nominal resistance is calculated, it is adjusted for
  951. temperature by the formula:
  952. .EQ
  953. RES(temp) = RES(tnom) times ( 1 + TC1 times ( temp - tnom ) + TC2 * { ( temp - tnom) } sup 2 )
  954. .EN
  955. .sp 0.2i
  956. .sh 2 "Capacitor Model"
  957. .sp 0.1i
  958. .pp
  959. The capacitor model contains process information that may be used to
  960. compute the capacitance from strictly geometric information.
  961. .sp 0.2i
  962. .TS
  963. center;
  964. l l l l l.
  965. name    parameter    units    default    example
  966. .sp .2i
  967. CJ    junction bottom capacitance    F/$meters sup 2$    -    5e-5
  968. CJSW    junction sidewall capacitance    F/meters    -    2e-11
  969. DEFW    default device width    meters    1e-6    2e-6
  970. NARROW    narrowing due to side etching    meters    0.0    1e-7
  971. .TE
  972. .sp 0.1i
  973. .pp
  974. The capacitor has a capacitance computed as
  975. .EQ
  976. CAP = CJ times ( LENGTH - NARROW ) times ( WIDTH - NARROW ) + 2 times CJSW times ( LENGTH + WIDTH - 2 * NARROW )
  977. .EN
  978. .sp 0.2i
  979. .sh 2 "Uniform Distributed RC Model"
  980. .sp 0.1i
  981. .pp
  982. The URC model is derived from a model proposed by L. Gertzberrg in
  983. 1974.
  984. The model is accomplished by a subcircuit type expansion of the
  985. URC line into a network of lumped RC segments with internally
  986. generated nodes.  The RC segments are in a geometric
  987. progression, increasing toward the middle of the URC line, with
  988. K as a proportionality constant.  The number of lumped segments
  989. used, if not specified on the URC line card, is determined by the
  990. following formula:
  991. .EQ
  992. N = {log left [ {F sub max} times {R over L} times {C over L} times 2 times pi times {l sup 2} times left ( { { ( K - 1 ) } over K} right ) sup 2 right ]} over { log K }
  993. .EN
  994. .pp
  995. The URC line will be made up strictly of resistor and capacitor
  996. segments unless the ISPERL parameter is given a non-zero value,
  997. in which case the capacitors are replaced with reverse biased
  998. diodes with a zero-bias junction capacitance equivalent to the
  999. capacitance replaced, and with a saturation current of ISPERL
  1000. amps per meter of transmission line and an optional series
  1001. resistance equivalent to RSPERL ohms per meter.
  1002. .TS
  1003. center;
  1004. l l l l l l l.
  1005.     name    parameter    units    default    example    area
  1006. .sp 0.2i
  1007.  1    K    Propagation Constant    -    2.0    1.2    -
  1008.  2    FMAX    Maximum Frequency of interest    Hz    1.0G    6.5MEG    -
  1009.  3    RPERL    Resistance per unit length    Ohm/m    1000    10    -
  1010.  4    CPERL    Capacitance per unit length    F/m    1.0E-15    1PF    -
  1011.  5    ISPERL    Saturation Current per unit length    Amp/m    0    -    -
  1012.  6    RSPERL    Diode Resistance per unit length    Ohm/m    0    -    -
  1013. .TE
  1014. .sp 0.2i
  1015. .sh 2 "Switch Model"
  1016. .sp 0.1i
  1017. .pp
  1018. The switch model allows an almost ideal switch to be described in SPICE.
  1019. The switch is not quite ideal, in that the resistance can not
  1020. change from 0 to infinity, but must always have a finite positive value.
  1021. By proper selection of the on and off resistances, they can
  1022. be effectively zero and infinity in comparison to other circuit elements.
  1023. The parameters available are:
  1024. .TS
  1025. center;
  1026. l l l l l.
  1027. name    parameter    units    default    switch
  1028. .sp .2i
  1029. VT    threshold voltage    Volts    0.0    S
  1030. IT    threshold current    Amps    0.0    W
  1031. VH    hysteresis voltage    Volts    0.0    S
  1032. IH    hysteresis current    Amps    0.0    W
  1033. RON    on resistance    \(*W    1.0    both
  1034. ROFF    off resistance    \(*W    1/GMIN*    both
  1035. .TE
  1036. .sp .1i
  1037. .pp
  1038. *(See the .OPTIONS card for a description of GMIN, its default value
  1039. results is a off resistance of 1.0e+12 ohms.)
  1040. .sp .2i
  1041. .pp
  1042. The use of an ideal element that is highly non-linear such as a switch 
  1043. can cause large discontinuities to occur
  1044. in the circuit node voltages.
  1045. A rapid change such as that associated
  1046. with a switch changing state can cause
  1047. numerical roundoff or tolerance problems
  1048. leading to erroneous results or timestep
  1049. difficulties.
  1050. The user of switches can improve the
  1051. situation by taking the following
  1052. steps:
  1053. .pp
  1054. First of all it is wise to set ideal
  1055. switch impedences only high and low
  1056. enough to be negligible with respect to
  1057. other circuit elements.
  1058. Using switch impedences that are close
  1059. to "ideal" in all cases will aggravate
  1060. the problem of discontinuities mentioned
  1061. above.
  1062. Of cource, when modeling real devices
  1063. such as MOSFETS, the on resistance
  1064. should be adjusted to a realistic level
  1065. depending on the size of the device
  1066. being modelled.
  1067. .pp
  1068. If a wide rango of ON to OFF resistance
  1069. must be used in the switched (ROFF/RON >1e+12), then the
  1070. tolerance on errors allowed during
  1071. transient analysis should be decreased
  1072. by using the .OPTIONS card and
  1073. specifying TRTOL to be less than the
  1074. default value of 7.0.
  1075. When switches are placed around
  1076. capacitors, then the option CHGTOL
  1077. should also be reduced.
  1078. Suggested values for these two options
  1079. are 1.0 and 1e-16 respectively.
  1080. These changes inform SPICE3 to be more
  1081. careful around the switch points so that
  1082. no errors are made due to the rapid
  1083. change in the circuit.
  1084. .sp 0.2i
  1085. .sh 2 "Diode Model"
  1086. .sp 0.1i
  1087. .pp
  1088. The dc characteristics of the diode are determined by the parameters IS
  1089. and N.  An ohmic resistance, RS, is included.  Charge storage effects are
  1090. modeled by a transit time, TT, and a nonlinear depletion layer capacitance
  1091. which is determined by the parameters CJO, VJ, and M.  The temperature
  1092. dependence of the saturation current is defined by the parameters EG, the energy
  1093. and XTI, the saturation current temperature exponent.  Reverse breakdown is
  1094. modeled by an exponential increase in the reverse diode current and is
  1095. determined by the parameters BV and IBV (both of which are positive numbers).
  1096. .sp 0.1i
  1097. .TS
  1098. center;
  1099. l l l l l l l.
  1100.     name    parameter    units    default    example    area
  1101. .sp 0.2i
  1102.  1    IS    saturation current    A    1.0E-14    1.0E-14    *
  1103.  2    RS    ohmic resistance    Ohm    0    10    *
  1104.  3    N    emission coefficient    -    1    1.0
  1105.  4    TT    transit-time    sec    0    0.1Ns
  1106.  5    CJO    zero-bias junction capacitance    F    0    2PF    *
  1107.  6    VJ    junction potential    V    1    0.6
  1108.  7    M    grading coefficient    -    0.5    0.5
  1109.  8    EG    activation energy    eV    1.11    1.11 Si
  1110.                     0.69 Sbd
  1111.                     0.67 Ge
  1112.  9    XTI    saturation-current temp. exp    -    3.0    3.0 jn
  1113.                     2.0 Sbd
  1114. 10    KF    flicker noise coefficient    -    0
  1115. 11    AF    flicker noise exponent    -    1
  1116. 12    FC    coefficient for forward-bias    -    0.5
  1117.         depletion capacitance formula
  1118. 13    BV    reverse breakdown voltage    V    infinite    40.0
  1119. 14    IBV    current at breakdown voltage    A    1.0E-3
  1120. .TE
  1121. .sp 0.2i
  1122. .sh 2 "BJT Models (both NPN and PNP)"
  1123. .sp 0.1i
  1124. .pp
  1125. The bipolar junction transistor model in SPICE is an adaptation of
  1126. the integral charge control model of Gummel and Poon.  This modified
  1127. Gummel-Poon model extends the original model to include several effects
  1128. at high bias levels.  The model will automatically simplify to the simpler
  1129. Ebers-Moll model when certain parameters are not specified.  
  1130. The parameter names
  1131. used in the modified Gummel-Poon model have been chosen to be more easily
  1132. understood by the program user, and to reflect better both physical and
  1133. circuit design thinking.  
  1134. .pp
  1135. The dc model is defined by the parameters
  1136. IS, BF, NF, ISE, IKF, and NE which determine 
  1137. the forward current gain characteristics,
  1138. IS, BR, NR, ISC, IKR, and NC which determine 
  1139. the reverse current gain characteristics,
  1140. and VAF and VAR which determine the output conductance for forward and reverse
  1141. regions.  Three ohmic resistances RB, RC, and
  1142. RE are included, where RB can be high current dependent.
  1143. Base charge storage
  1144. is modeled by forward and reverse transit times, TF and TR, the forward transit
  1145. time TF being bias dependent if desired, and nonlinear depletion layer
  1146. capacitances which are determined by
  1147. CJE, VJE, and MJE for the B-E junction ,
  1148. CJC, VJC, and MJC for the B-C junction and
  1149. CJS, VJS, and MJS for the C-S (Collector-Substrate) junction.
  1150. The temperature
  1151. dependence of the saturation current, IS, is determined by the energy-gap, EG,
  1152. and the saturation current temperature exponent, XTI.
  1153. Additionally base current temperature
  1154. dependence is modeled by the beta temperature exponent XTB in the new
  1155. model.
  1156. .pp
  1157. The  BJT parameters used in the modified Gummel-Poon model
  1158. are listed below. The parameter names used in earlier versions of SPICE2
  1159. are still accepted.
  1160. .sp 0.2i
  1161.     Modified Gummel-Poon BJT Parameters.
  1162. .sp 0.2i
  1163. .TS
  1164. center;
  1165. l l l l l l l.
  1166.     name    parameter    units    default    example    area
  1167. .sp 0.2i
  1168. 1    IS    transport saturation current    A    1.0E-16    1.0E-15    *
  1169. 2    BF    ideal maximum forward beta    -    100    100
  1170. 3    NF    forward current emission coefficient    -    1.0    1
  1171. 4    VAF    forward Early voltage    V    infinite    200
  1172. 5    IKF    corner for forward beta 
  1173.         high current roll-off    A    infinite    0.01    *
  1174. 6    ISE    B-E leakage saturation current    A    0    1.0E-13    *
  1175. 7    NE    B-E leakage emission coefficient    -    1.5    2
  1176. 8    BR    ideal maximum reverse beta    -    1    0.1
  1177. 9    NR    reverse current emission coefficient    -    1    1
  1178. 10    VAR    reverse Early voltage    V    infinite    200
  1179. 11    IKR    corner for reverse beta 
  1180.         high current roll-off    A    infinite    0.01    *
  1181. 12    ISC    B-C leakage saturation current    A    0    1.0E-13    *
  1182. 13    NC    B-C leakage emission coefficient    -    2    1.5
  1183. 14    RB    zero bias base resistance    Ohms    0    100    *
  1184. 15    IRB    current where base resistance 
  1185.         falls halfway to its min value    A    infinite    0.1    *
  1186. 16    RBM    minimum base resistance 
  1187.         at high currents    Ohms    RB    10    *
  1188. 17    RE    emitter resistance    Ohms    0    1    *
  1189. 18    RC    collector resistance    Ohms    0    10    *
  1190. 19    CJE    B-E zero-bias depletion capacitance    F    0    2PF    *
  1191. 20    VJE    B-E built-in potential    V    0.75    0.6
  1192. 21    MJE    B-E junction exponential factor    -    0.33    0.33
  1193. 22    TF    ideal forward transit time    sec    0    0.1Ns
  1194. 23    XTF    coefficient for bias dependence of TF    -    0
  1195. 24    VTF    voltage describing VBC 
  1196.         dependence of TF    V    infinite
  1197. 25    ITF    high-current parameter 
  1198.         for effect on TF    A    0        *
  1199. 26    PTF    excess phase at freq=1.0/(TF*2PI) Hz    deg    0
  1200. 27    CJC    B-C zero-bias depletion capacitance    F    0    2PF    *
  1201. 28    VJC    B-C built-in potential    V    0.75    0.5
  1202. 29    MJC    B-C junction exponential factor    -    0.33    0.5
  1203. 30    XCJC    fraction of B-C depletion capacitance    -    1
  1204.         connected to internal base node
  1205. 31    TR    ideal reverse transit time    sec    0    10Ns
  1206. 32    CJS    zero-bias collector-substrate 
  1207.         capacitance    F    0    2PF    *
  1208. 33    VJS    substrate junction built-in potential    V    0.75
  1209. 34    MJS    substrate junction exponential factor    -    0    0.5
  1210. 35    XTB    forward and reverse beta 
  1211.         temperature exponent    -    0
  1212. 36    EG    energy gap for temperature 
  1213.         effect on IS    eV    1.11
  1214. 37    XTI    temperature exponent for effect on IS    -    3
  1215. 38    KF    flicker-noise coefficient    -    0
  1216. 39    AF    flicker-noise exponent    -    1
  1217. 40    FC    coefficient for forward-bias
  1218.         depletion capacitance formula    -    0.5
  1219. .TE
  1220. .sp 0.2i
  1221. .sh 2 "JFET Models (both N and P Channel)"
  1222. .sp 0.1i
  1223. .pp
  1224. The JFET model is derived from the FET model of Shichman and Hodges.  The
  1225. dc characteristics are defined by the parameters VTO and BETA, which determine
  1226. the variation of drain current with gate voltage, LAMBDA, which determines the
  1227. output conductance, and IS, the saturation current of the two gate junctions.
  1228. Two ohmic resistances, RD and RS, are included.  Charge storage is modeled by
  1229. nonlinear depletion layer capacitances for both gate junctions which vary as
  1230. the -1/2 power of junction voltage and are defined by the parameters CGS, CGD,
  1231. and PB.
  1232. .sp 0.1i
  1233. .TS
  1234. center;
  1235. l l l l l l l.
  1236.     name    parameter    units    default    example    area
  1237. .sp 0.2i
  1238.  1    VTO    threshold voltage    V    -2.0    -2.0
  1239.  2    BETA    transconductance parameter    A/V**2    1.0E-4    1.0E-3    *
  1240.  3    LAMBDA    channel length modulation 
  1241.         parameter    1/V    0    1.0E-4
  1242.  4    RD    drain ohmic resistance    Ohm    0    100    *
  1243.  5    RS    source ohmic resistance    Ohm    0    100    *
  1244.  6    CGS    zero-bias G-S junction capacitance    F    0    5PF    *
  1245.  7    CGD    zero-bias G-D junction capacitance    F    0    1PF    *
  1246.  8    PB    gate junction potential    V    1    0.6
  1247.  9    IS    gate junction saturation current    A    1.0E-14    1.0E-14    *
  1248. 10    KF    flicker noise coefficient    -    0
  1249. 11    AF    flicker noise exponent    -    1
  1250. 12    FC    coefficient for forward-bias    -    0.5
  1251.         depletion capacitance formula
  1252. .TE
  1253. .sp 0.1i
  1254. .sh 2 "MOSFET Models (both N and P channel)"
  1255. .sp 0.1i
  1256. .pp
  1257. SPICE provides four MOSFET device models,
  1258. which differ in the formulation of the I-V characteristic.
  1259. The variable LEVEL specifies the model to be used:
  1260. .sp 0.1i
  1261. .TS
  1262. center;
  1263. l l.
  1264. LEVEL=1 ->     Shichman-Hodges
  1265. LEVEL=2 ->     MOS2 (as described in [1])
  1266. LEVEL=3 ->     MOS3, a semi-empirical model(see [1])
  1267. LEVEL=4 ->     BSIM (as described in [2])
  1268. .TE
  1269. .sp 0.1i
  1270. The dc characteristics of the level 1 through level 3 MOSFETs
  1271. are defined by the device
  1272. parameters VTO, KP, LAMBDA, PHI and GAMMA. These parameters are
  1273. computed by SPICE if process parameters (NSUB, TOX, ...) are
  1274. given, but user-specified values always override.
  1275. VTO is positive (negative) for enhancement mode and negative
  1276. (positive) for depletion mode N-channel (P-channel) devices. Charge storage is
  1277. modeled by three constant capacitors, CGSO, CGDO, and CGBO 
  1278. which represent overlap capacitances,
  1279. by the nonlinear
  1280. thin-oxide capacitance which is distributed among the gate, source, drain, and
  1281. bulk regions, and by the nonlinear
  1282. depletion-layer capacitances for both substrate junctions
  1283. divided into bottom and periphery,
  1284. which vary as
  1285. the MJ and MJSW power of junction voltage respectively,
  1286. and are determined by the parameters CBD, CBS, CJ, CJSW, MJ, MJSW and PB.
  1287. .\"There are two built-in models of the charge storage effects
  1288. .\"associated with the thin-oxide.
  1289. .\"The default is the piecewise linear voltage-dependent 
  1290. .\"capacitance model proposed by Meyer.
  1291. Charge storage effects are modeled by the piecewise linear voltags-dependent
  1292. capacitance model proposed by Meyer.
  1293. .\"The second choice is the charge-controlled capacitance model
  1294. .\"of Ward and Dutton [1].
  1295. .\"The XQC model parameter acts as a flag and a coefficient
  1296. .\"at the same time.
  1297. .\"As the former it causes the program to use Meyer's model whenever
  1298. .\"larger than 0.5 or not specified, and the charge-controlled 
  1299. .\"model when between 0 and 0.5.
  1300. .\"In the latter case its value defines the share of the
  1301. .\"channel charge associated with the drain terminal in
  1302. .\"the saturation region.
  1303. The thin-oxide charge storage effects are treated slightly
  1304. different for the LEVEL=1 model.
  1305. These voltage-dependent capacitances are included only if
  1306. TOX is specified in the input description and they are
  1307. represented using Meyer's formulation.
  1308. .pp
  1309. There is some overlap among the parameters describing the junctions,
  1310. e.g. the reverse current can be input either as IS (in A) or as
  1311. JS (in A/m**2). Whereas the first is an absolute value the second 
  1312. is multiplied by AD and AS to give the reverse current of the drain
  1313. and source junctions respectively. This methodology has been chosen
  1314. since there is no sense in relating always junction characteristics
  1315. with AD and AS entered on the device card; the areas can be defaulted.
  1316. The same idea applies also to the zero-bias junction capacitances 
  1317. CBD and CBS (in F) on one hand, and CJ (in F/m**2) on the other.
  1318. The parasitic drain and source series resistance can be expressed
  1319. as either RD and RS (in ohms) or RSH (in ohms/sq.), the latter 
  1320. being multiplied by the number of squares NRD and NRS input
  1321. on the device card.
  1322. .sp 0.2i
  1323. SPICE level 1 to level 3 parameters.
  1324. .sp 0.2i
  1325. .TS
  1326. center;
  1327. l l l l l l.
  1328.     name    parameter    units    default    example
  1329. .sp 0.2i
  1330. 1    LEVEL    model index         -    1
  1331. 2    VTO    zero-bias threshold voltage    V    0.0    1.0
  1332. 3    KP    transconductance parameter    A/V**2    2.0E-5    3.1E-5
  1333. 4    GAMMA    bulk threshold parameter    V**0.5    0.0    0.37
  1334. 5    PHI    surface potential    V    0.6    0.65
  1335. 6    LAMBDA    channel-length modulation    
  1336.         (MOS1 and MOS2 only)    1/V    0.0    0.02
  1337. 7    RD    drain ohmic resistance    Ohm    0.0    1.0
  1338. 8    RS    source ohmic resistance    Ohm    0.0    1.0
  1339. 9    CBD    zero-bias B-D junction capacitance    F    0.0    20FF
  1340. 10    CBS    zero-bias B-S junction capacitance    F    0.0    20FF
  1341. 11    IS    bulk junction saturation current    A    1.0E-14    1.0E-15
  1342. 12    PB    bulk junction potential    V    0.8    0.87
  1343. 13    CGSO    gate-source overlap capacitance
  1344.         per meter channel width    F/m    0.0    4.0E-11
  1345. 14    CGDO    gate-drain overlap capacitance            
  1346.         per meter channel width    F/m    0.0    4.0E-11
  1347. 15    CGBO    gate-bulk overlap capacitance            
  1348.         per meter channel length    F/m    0.0    2.0E-10
  1349. 16    RSH    drain and source diffusion
  1350.         sheet resistance    Ohm/sq.    0.0    10.0
  1351. 17    CJ    zero-bias bulk junction bottom cap.
  1352.         per sq-meter of junction area    F/m**2    0.0    2.0E-4
  1353. 18    MJ    bulk junction bottom grading coef.    -    0.5    0.5
  1354. 19    CJSW    zero-bias bulk junction sidewall cap.
  1355.         per meter of junction perimeter    F/m    0.0    1.0E-9
  1356. 20    MJSW    bulk junction sidewall grading coef.    -    0.50(level1)
  1357.                 0.33(level2,3)
  1358. 21    JS    bulk junction saturation current
  1359.         per sq-meter of junction area    A/m**2        1.0E-8    1.0E-9
  1360. 22    TOX    oxide thickness    meter    1.0E-7    1.0E-7
  1361. 23    NSUB    substrate doping    1/cm**3    0.0    4.0E15
  1362. 24    NSS    surface state density    1/cm**2    0.0    1.0E10
  1363. 25    NFS    fast surface state density    1/cm**2    0.0    1.0E10
  1364. 26    TPG    type of gate material:    -    1.0
  1365.             +1 opp. to substrate
  1366.             -1 same as substrate
  1367.              0  Al gate
  1368. 27    XJ    metallurgical junction depth    meter    0.0    1U
  1369. 28    LD    lateral diffusion    meter    0.0    0.8U
  1370. 29    UO    surface mobility    cm**2/V-s    600    700
  1371. 30    UCRIT    critical field for mobility
  1372.         degradation (MOS2 only)    V/cm    1.0E4    1.0E4
  1373. 31    UEXP    critical field exponent in
  1374.         mobility degradation (MOS2 only)    -    0.0    0.1
  1375. 32    UTRA    transverse field coef (mobility)    
  1376.         (deleted for MOS2)    -    0.0    0.3
  1377. 33    VMAX    maximum drift velocity of carriers    m/s    0.0    5.0E4
  1378. 34    NEFF    total channel charge (fixed and
  1379.         mobile) coefficient (MOS2 only)         -    1.0    5.0
  1380. .\"35    XQC    thin-oxide capacitance model flag
  1381. .\"        and coefficient of channel charge
  1382. .\"        share attributed to drain (0-0.5)    -    1.0    0.4
  1383. 35    KF    flicker noise coefficient    -    0.0    1.0E-26
  1384. 36    AF    flicker noise exponent    -    1.0    1.2
  1385. 37    FC    coefficient for forward-bias    
  1386.         depletion capacitance formula    -    0.5
  1387. 38    DELTA    width effect on threshold voltage
  1388.         (MOS2 and MOS3)    -    0.0    1.0
  1389. 39    THETA    mobility modulation (MOS3 only)    1/V    0.0    0.1
  1390. 40    ETA    static feedback (MOS3 only)    -    0.0    1.0
  1391. 41    KAPPA    saturation field factor (MOS3 only)    -    0.2    0.5
  1392. .TE
  1393. .sp 0.2i
  1394. .pp
  1395. The level 4 parameters are all values obtained from process characterization,
  1396. and can be generated automatically.
  1397. J. Pierret [3] describes a means of generating a 'process' file, and the program
  1398. Proc2Mod provided with SPICE3 will convert this file into a sequence
  1399. of .MODEL cards suitable for inclusion in a SPICE deck.
  1400. Parameters marked below with an * in the l/w column also have
  1401. corresponding parameters with a length and width dependency.
  1402. For example, VFB is the basic parameter with units of Volts,
  1403. and LVFB and WVFB also exist and have units of Volt-\(*mmeter
  1404. The formula 
  1405. .EQ
  1406. P = P sub 0 + { P sub L } over { L sub effective } + { P sub W } over { W sub effective }
  1407. .EN
  1408. is used to evaluate the parameter for the actual device specified with
  1409. .EQ
  1410. L sub effective = L sub input - DL
  1411. .EN
  1412. and
  1413. .EQ
  1414. W sub effective = W sub input - DW
  1415. .EN
  1416. .pp
  1417. Note that unlike the other models in SPICE, the BSIM model is
  1418. designed for use with a process characterization system that
  1419. provides all the parameters, thus there are no defaults
  1420. for the parameters, and leaving one out is considered an error.
  1421. For an example set of parameters and the format of a process file,
  1422. see the SPICE2 implementation notes[2].
  1423. .sp 0.2i
  1424. SPICE BSIM (level 4) parameters.
  1425. .sp 0.2i
  1426. .TS
  1427. center delim($$);
  1428. l l l l.
  1429. name    parameter    units    l/w
  1430. .sp 0.2i
  1431. VFB    flat-band voltage    V    *
  1432. PHI    surface inversion potential    V    *
  1433. K1    body effect coefficient    $V sup {1/2}$    *
  1434. K2    drain/source depletion charge sharing coefficient    -    *
  1435. ETA    zero-bias drain-induced barrier lowering coefficient    -    *
  1436. MUZ    zero-bias mobility    $cm sup 2 / V-s$
  1437. DL    shortening of channel    \(*mm
  1438. DW    narrowing of channel    \(*mm
  1439. U0    zero-bias transverse-field mobility degradation coefficient    $V sup {-1}$    *
  1440. U1    zero-bias velocity saturation coefficient    \(*mm/V    *
  1441. X2MZ    sens. of mobility to substrate bias at $v sub ds = 0$    $cm sup 2 /V sup 2 -s$    *
  1442. X2E    sens. of drain-induced barrier lowering effect to substrate bias    $V sup {-1}$    *
  1443. X3E    sens. of drain-induced barrier lowering effect to drain bias at $V sub ds = V sub dd$    $V sup {-1}$    *
  1444. X2U0    sens. of transverse field mobility degradation effect to substrate bias    $V sup {-2}$    *
  1445. X2U1    sens. of velocity saturation effect to substrate bias    $\(*mm V sup {-2}$    *
  1446. MUS    mobility at zero substrate bias and at $V sub ds = V sub dd$    $cm sup 2 /V sup 2 -s$    
  1447. X2MS    sens. of mobility to substrate bias at $V sub ds = V sub dd$    $cm sup 2 /V sup 2 -s$    *
  1448. X3MS    sens. of mobility to drain bias at $V sub ds = V sub dd$    $cm sup 2 /V sup 2 -s$    *
  1449. X3U1    sens. of velocity saturation effect on drain bias at $V sub ds = V sub dd$    $\(*mm V sup {-2}$    *
  1450. TOX    gate oxide thickness    \(*mm
  1451. TEMP    temperature at which parameters were measured    \(deC
  1452. VDD    measurement bias range    V
  1453. CGDO    gate-drain overlap capacitance per meter channel width    F/m
  1454. CGSO    gate-source overlap capacitance per meter channel width    F/m
  1455. CGBO    gate-bulk overlap capacitance per meter channel length    F/m
  1456. XPART    gate-oxide capacitance charge model flag    -
  1457. N0    zero-bias subthreshold slope coefficient    -    *
  1458. NB    sens. of subthreshold slope to substrate bias    -    *
  1459. ND    sens. of subthreshold slope to drain bias    -    *
  1460. .TE
  1461. .sp 0.1i
  1462. .pp
  1463. XPART = 0 selects a 40/60 drain/source charge partition in saturation,
  1464. while XPART=1 selects a 0/100 drain/source charge partition.
  1465. XPART=1 is recommended.
  1466. .sp 0.1i
  1467. [1] A. Vladimirescu and S. Liu, "The Simulation of MOS Integrated Circuits 
  1468. Using SPICE2",
  1469. ERL Memo No. ERL M80/7, Electronics Research Laboratory,
  1470. University of California, Berkeley, Oct. 1980.
  1471. .br
  1472. [2] B. J. Sheu, D. L. Scharfetter, and P. K. Ko, 
  1473. "SPICE2 Implementation of BSIM"
  1474. ERL Memo No. ERL M85/42, Electronics Research Laboratory,
  1475. University of California, Berkeley, May 1985.
  1476. .br
  1477. [3] J. R. Pierret, "A MOS Parameter Extraction Program for the BSIM Model"
  1478. ERL Memo Nos. ERL M84/99 and M84/100, Electronics Research Laboratory,
  1479. University of California, Berkeley, Nov. 1984.
  1480. .sp .3i
  1481. .sh 1 "SUBCIRCUITS"
  1482. .sp 0.2i
  1483. .pp
  1484. A subcircuit that consists of SPICE elements can be defined and referenced
  1485. in a fashion similar to device models.  The subcircuit is defined in the input
  1486. deck by a grouping of element cards;  the program then automatically inserts
  1487. the group of elements wherever the subcircuit is referenced.  There is no limit
  1488. on the size or complexity of subcircuits, and subcircuits may contain other
  1489. subcircuits.  An example of subcircuit usage is given in Appendix A.
  1490. .sp 0.2i
  1491. .sh 2 ".SUBCKT Card"
  1492. .sp 0.1i
  1493. .b "General form:"
  1494. .(l
  1495. .SUBCKT subnam N1 <N2 N3 ...>
  1496. .)l
  1497. .b "Examples:"
  1498. .(l
  1499. .SUBCKT OPAMP 1 2 3 4
  1500. .)l
  1501. .pp
  1502. A circuit definition is begun with a .SUBCKT card.  SUBNAM is the
  1503. subcircuit name, and N1, N2, ... are the external nodes, which cannot be zero.
  1504. The group of element cards which immediately follow the .SUBCKT card define the
  1505. subcircuit.  The last card in a subcircuit definition is the .ENDS card (see
  1506. below).  Control cards may not appear within a subcircuit definition;  however,
  1507. subcircuit definitions may contain anything else, including other subcircuit
  1508. definitions, device models, and subcircuit calls (see below).  Note that any
  1509. device models or subcircuit definitions included as part of a subcircuit
  1510. definition are strictly local (i.e., such models and definitions are not known
  1511. outside the subcircuit definition).  Also, any element nodes not included on
  1512. the .SUBCKT card are strictly local, with the exception of 0 (ground) which is
  1513. always global.
  1514. .sp 0.2i
  1515. .sh 2 ".ENDS Card"
  1516. .sp 0.1i
  1517. .b "General form:"
  1518. .(l
  1519.  .ENDS <SUBNAM>
  1520. .)l
  1521. .b "Examples:"
  1522. .(l
  1523.  .ENDS OPAMP
  1524. .)l
  1525. .pp
  1526. This card must be the last one for any subcircuit definition.  The 
  1527. subcircuit name, if included, indicates which subcircuit definition is being
  1528. terminated;  if omitted, all subcircuits being defined are terminated.  The
  1529. name is needed only when nested subcircuit definitions are being made.
  1530. .sp .2i
  1531. .sh 2 "Subcircuit Calls"
  1532. .sp 0.1i
  1533. .b "General form:"
  1534. .(l
  1535. XYYYYYYY N1 <N2 N3 ...> SUBNAM
  1536. .)l
  1537. .b "Examples:"
  1538. .(l
  1539. X1 2 4 17 3 1 MULTI
  1540. .)l
  1541. .pp
  1542. Subcircuits are used in SPICE by specifying pseudo-elements beginning with
  1543. the letter X, followed by the circuit nodes to be used in expanding the 
  1544. subcircuit.
  1545. .bp
  1546. .sp .5i
  1547. .sh 1 "CONTROL CARDS"
  1548. .sp 0.2i
  1549. .\".sh 2 ".TEMP Card"
  1550. .\".sp 0.1i
  1551. .\".b "General form:"
  1552. .\".(l
  1553. .\" .TEMP T1 <T2 <T3 ...>>
  1554. .\".)l
  1555. .\".b "Examples:"
  1556. .\".(l
  1557. .\" .TEMP -55.0 25.0 125.0
  1558. .\".)l
  1559. .\".pp
  1560. .\"This card specifies the temperatures at which the circuit is to be
  1561. .\"simulated.  T1, T2, ... Are the different temperatures, in degrees C.
  1562. .\"Temperatures less than -223.0 deg C are ignored.  Model data are specified at
  1563. .\"TNOM degrees (see the .OPTIONS card for TNOM);  if the .TEMP card is omitted,
  1564. .\"the simulation will also be performed at a temperature equal to TNOM.
  1565. .\".sp 0.2i
  1566. .\".sh 2 ".WIDTH Card"
  1567. .\".sp 0.1i
  1568. .\".b "General form:"
  1569. .\".(l
  1570. .\" .WIDTH IN=COLNUM OUT=COLNUM
  1571. .\".)l
  1572. .\".b "Examples:"
  1573. .\".(l
  1574. .\" .WIDTH IN=72 OUT=133
  1575. .\".)l
  1576. .\".pp
  1577. .\"COLNUM is the last column read from each line of input;  the setting takes
  1578. .\"effect with the next line read.  The default value for COLNUM is 80.
  1579. .\"The out parameter specifies the output print width.  Permissible values for
  1580. .\"the output print width are 80 and 133.
  1581. .\".sp 0.2i
  1582. .sh 2 ".OPTIONS Card"
  1583. .sp 0.1i
  1584. .b "General form:"
  1585. .(l
  1586.  .OPTIONS OPT1 OPT2 ... (or OPT=OPTVAL ...)
  1587. .)l
  1588. .b "Examples:"
  1589. .(l
  1590.  .OPTIONS RELTOL=.005 TRTOL=8
  1591. .)l
  1592. .pp
  1593. This card allows the user to reset program control and user options for
  1594. specific simulation purposes.  Any combination of the following options may be
  1595. included, in any order.  'x' (below) represents some positive number.
  1596. .TS
  1597. center;
  1598. l l.
  1599. option    effect
  1600. .sp 0.2i
  1601. .\"ACCT    causes accounting and run time statistics to be printed
  1602. .\"LIST    causes the summary listing of the input data to be printed
  1603. .\"NOMOD    suppresses the printout of the model parameters.
  1604. .\"NOPAGE    suppresses page ejects
  1605. .\"NODE    causes the printing of the node table.
  1606. .\"OPTS    causes the option values to be printed.
  1607. GMIN=x    resets the value of GMIN, the minimum conductance
  1608.     allowed by the program.  The default value is 1.0E-12.
  1609. RELTOL=x    resets the relative error tolerance of the program.  The
  1610.     default value is 0.001 (0.1 percent).
  1611. ABSTOL=x    resets the absolute current error tolerance of the
  1612.     program.  The default value is 1 picoamp.
  1613. VNTOL=x    resets the absolute voltage error tolerance of the
  1614.     program.  The default value is 1 microvolt.
  1615. TRTOL=x    resets the transient error tolerance.  The default value
  1616.     is 7.0.  This parameter is an estimate of the factor by
  1617.     which SPICE overestimates the actual truncation error.
  1618. CHGTOL=x    resets the charge tolerance of the program.  The default
  1619.     value is 1.0E-14.
  1620. PIVTOL=x    resets the absolute minimum value for a matrix entry 
  1621.     to be accepted as a pivot.  The default value is 1.0E-13.
  1622. PIVREL=x    resets the relative ratio between the largest column entry
  1623.     and an acceptable pivot value. The default value is 1.0E-3.
  1624.     In the numerical pivoting algorithm the allowed minimum 
  1625.     pivot value is determined by
  1626.     EPSREL=AMAX1(PIVREL*MAXVAL,PIVTOL)
  1627.     where MAXVAL is the maximum element in the column where
  1628.     a pivot is sought (partial pivoting).
  1629. .\"NUMDGT=x    resets the number of significant digits printed for
  1630. .\"    output variable values.  X must satisfy the relation
  1631. .\"    0 < x < 8.  The default value is 4.  Note:  this option is
  1632. .\"    independent of the error tolerance used by SPICE (i.e., if
  1633. .\"    the values of options RELTOL, ABSTOL, etc., are not changed
  1634. .\"    then one may be printing numerical 'noise' for NUMDGT > 4.
  1635. TNOM=x    resets the nominal temperature.  The default value is
  1636.     27 deg C (300 deg K).
  1637. ITL1=x    resets the dc iteration limit.  The default is 100.
  1638. ITL2=x    resets the dc transfer curve iteration limit.  The
  1639.     default is 50.
  1640. .\"ITL3=x    resets the lower transient analysis iteration limit.
  1641. .\"    the default value is 4.
  1642. .\"ITL4=x    resets the transient analysis timepoint iteration limit.
  1643. .\"    the default is 10.
  1644. ITL5=x    resets the transient analysis total iteration limit.
  1645.     the default is 5000.  Set ITL5=0 to omit this test.
  1646. .\"CPTIME=x    the maximum cpu-time in seconds allowed for this job.
  1647. .\"LIMTIM=x    resets the amount of cpu time reserved by SPICE for
  1648. .\"    generating plots should a cpu time-limit cause job
  1649. .\"    termination.  The default value is 2 (seconds).
  1650. .\"LIMPTS=x    resets the total number of points that can be printed
  1651. .\"    or plotted in a dc, ac, or transient analysis.  The
  1652. .\"    default value is 201.
  1653. .\"LVLCOD=x    if x is 2 (two), then machine code for the matrix
  1654. .\"    solution will be generated.  Otherwise, no machine code is
  1655. .\"    generated.  The default value is 2.  Applies only to CDC
  1656. .\"    computers.
  1657. .\"LVLTIM=x    if x is 1 (one), the iteration timestep control is used.
  1658. .\"    if x is 2 (two), the truncation-error timestep is used.
  1659. .\"    The default value is 2.  If method=Gear and MAXORD>2 then
  1660. .\"    LVLTIM is set to 2 by SPICE.
  1661. .\"METHOD=name    sets the numerical integration method used by SPICE.
  1662. .\"    Possible names are Gear or trapezoidal.  The default is
  1663. .\"    trapezoidal.
  1664. .\"MAXORD=x    sets the maximum order for the integration method if
  1665. .\"    Gear's variable-order method is used.  X must be between
  1666. .\"    2 and 6.  The default value is 2.
  1667. DEFL=x    resets the value for MOS channel length; the default
  1668.     is 100.0 micrometer.
  1669. DEFW=x    resets the value for MOS channel width; the default
  1670.     is 100.0 micrometer.
  1671. DEFAD=x    resets the value for MOS drain diffusion area; the
  1672.     default is 0.0.
  1673. DEFAS=x    resets the value for MOS source diffusion area; the
  1674.     default is 0.0.
  1675. .TE
  1676. .sp .2i
  1677. .sh 2 ".OP Card"
  1678. .sp 0.1i
  1679. .b "General form:"
  1680. .(l
  1681.  .OP
  1682. .)l
  1683. .sp 0.2i
  1684. .pp
  1685. The inclusion of this card in an input deck will force SPICE to determine
  1686. the dc operating point of the circuit with inductors shorted and capacitors
  1687. opened.  Note:  a dc analysis is automatically performed prior to a transient
  1688. analysis to determine the transient initial conditions, and prior to an ac
  1689. small-signal analysis to determine the linearized, small-signal models for
  1690. nonlinear devices.
  1691. .pp
  1692. SPICE performs a dc operating point analysis if no other analyses are
  1693. requested.
  1694. .sp 0.2i
  1695. .sh 2 ".DC Card"
  1696. .sp 0.1i
  1697. .b "General form:"
  1698. .(l
  1699.  .DC SRCNAM VSTART VSTOP VINCR [SRC2 START2 STOP2 INCR2]
  1700. .)l
  1701. .b "Examples:"
  1702. .(l
  1703.  .DC VIN 0.25 5.0 0.25
  1704.  .DC VDS 0 10 .5 VGS 0 5 1
  1705.  .DC VCE 0 10 .25 IB 0 10U 1U
  1706. .)l
  1707. .pp
  1708. This card defines the dc transfer curve source and sweep limits.  SRCNAM
  1709. is the name of an independent voltage or current source.  VSTART, VSTOP, and
  1710. VINCR are the starting, final, and incrementing values respectively.  The first
  1711. example will cause the value of the voltage source VIN to be swept from 0.25
  1712. Volts to 5.0 Volts in increments of 0.25 Volts.  A second source (SRC2) may
  1713. optionally be specified with associated sweep parameters.  In this case,
  1714. the first source will be swept over its range for each value of the second
  1715. source.  This option can be useful for obtaining semiconductor device output
  1716. characteristics.  See the second example data deck in that section of the guide.
  1717. .sp 0.2i
  1718. .sh 2 ".NODESET Card"
  1719. .sp 0.1i
  1720. .b "General form:"
  1721. .(l
  1722.  .NODESET V(NODNUM)=VAL V(NODNUM)=VAL ...
  1723. .)l
  1724. .b "Examples:"
  1725. .(l
  1726.  .NODESET V(12)=4.5 V(4)=2.23
  1727. .)l
  1728. .pp
  1729. This card helps the program find the dc or initial transient solution 
  1730. by making a preliminary
  1731. pass with the specified nodes held to the given voltages.  The restriction
  1732. is then released and the iteration continues to the true solution.
  1733. The .NODESET card may be necessary for convergence on bistable or astable
  1734. circuits.  In general, this card should not be necessary.
  1735. .ne 0.8i
  1736. .sp 0.2i
  1737. .sh 2 ".IC Card"
  1738. .sp 0.1i
  1739. .b "General form:"
  1740. .(l
  1741.  .IC V(NODNUM)=VAL V(NODNUM)=VAL ...
  1742. .)l
  1743. .b "Examples:"
  1744. .(l
  1745.  .IC V(11)=5 V(4)=-5 V(2)=2.2
  1746. .)l
  1747. .pp
  1748. This card is for setting transient initial conditions.  It has two
  1749. different interpretations, depending on whether the UIC parameter is
  1750. specified on the .TRAN card.  Also, one should not confuse this card with
  1751. the .NODESET card.  The .NODESET card is only to help dc convergence,
  1752. and does not affect final bias solution (except for multi-stable circuits).
  1753. The two interpretations of this card are as follows:
  1754. .sp 0.2i
  1755.  1.  When the UIC parameter is specified on the .TRAN card, then
  1756. the node voltages specified on the .IC card are used to compute
  1757. the capacitor, diode, BJT, JFET, and MOSFET initial conditions.
  1758. This is equivalent to specifying the IC=... parameter on each
  1759. device card, but is much more convenient.  The IC=... parameter
  1760. can still be specified and will take precedence over the .IC
  1761. values.  Since no dc bias (initial transient) solution 
  1762. is computed before the transient
  1763. analysis, one should take care to specify all dc source voltages
  1764. on the .IC card if they are to be used to compute device initial
  1765. conditions.
  1766. .sp 0.2i
  1767.  2.  When the UIC parameter is not specified on the .TRAN card,
  1768. the dc bias (initial transient) solution 
  1769. will be computed before the transient analysis.
  1770. In this case, the node voltages specified on the .IC card will
  1771. be forced to the desired initial values during the bias solution.
  1772. During transient analysis, the constraint on these node voltages
  1773. is removed.
  1774. .\".sp 0.2i
  1775. .\".sh 2 ".TF Card"
  1776. .\".sp 0.1i
  1777. .\".b "General form:"
  1778. .\".(l
  1779. .\" .TF OUTVAR INSRC
  1780. .\".)l
  1781. .\".b "Examples:"
  1782. .\".(l
  1783. .\" .TF V(5,3) VIN
  1784. .\" .TF I(VLOAD) VIN
  1785. .\".)l
  1786. .\".pp
  1787. .\"This card defines the small-signal output and input for the dc small-
  1788. .\"signal analysis.  OUTVAR is the small-signal output variable and INSRC is the
  1789. .\"small-signal input source.  If this card is included, SPICE will compute the
  1790. .\"dc small-signal value of the transfer function (output/input), input
  1791. .\"resistance, and output resistance.  For the first example, SPICE would
  1792. .\"compute the
  1793. .\"ratio of V(5,3) to VIN, the small-signal input resistance at VIN, and the
  1794. .\"small-signal output resistance measured across nodes 5 and 3.
  1795. .\".ne 0.8i
  1796. .\".sp 0.2i
  1797. .\".sh 2 ".SENS Card"
  1798. .\".sp 0.1i
  1799. .\".b "General form:"
  1800. .\".(l
  1801. .\" .SENS OV1 <OV2 ... >
  1802. .\".)l
  1803. .\".b "Examples:"
  1804. .\".(l
  1805. .\" .SENS V(9) V(4,3) V(17) I(VCC)
  1806. .\".)l
  1807. .\".pp
  1808. .\"If a .SENS card is included in the input deck, SPICE will determine the
  1809. .\"dc small-signal sensitivities of each specified output variable with respect to
  1810. .\"every circuit parameter.  Note:  for large circuits, large amounts of output
  1811. .\"can be generated.
  1812. .sp 0.2i
  1813. .sh 2 ".AC Card"
  1814. .sp 0.1i
  1815. .b "General form:"
  1816. .(l
  1817.  .AC DEC ND FSTART FSTOP
  1818.  .AC OCT NO FSTART FSTOP
  1819.  .AC LIN NP FSTART FSTOP
  1820. .)l
  1821. .b "Examples:"
  1822. .(l
  1823.  .AC DEC 10 1 10K
  1824.  .AC DEC 10 1K 100MEG
  1825.  .AC LIN 100 1 100HZ
  1826. .)l
  1827. .sp 0.2i
  1828. .pp
  1829. DEC stands for decade variation, and ND is the number of points per
  1830. decade.  OCT stands for octave variation, and NO is the number of points per
  1831. octave.  LIN stands for linear variation, and NP is the number of points.
  1832. FSTART is the starting frequency, and FSTOP is the final frequency.  If this
  1833. card is included in the deck, SPICE will perform an ac analysis of the circuit
  1834. over the specified frequency range.  Note that in order for this analysis to be
  1835. meaningful, at least one independent source must have been specified with an ac
  1836. value.
  1837. .\".sp 0.2i
  1838. .\".sh 2 ".DISTO Card"
  1839. .\".sp 0.1i
  1840. .\".b "General form:"
  1841. .\".(l
  1842. .\" .DISTO RLOAD <INTER <SKW2 <REFPWR <SPW2>>>>
  1843. .\".)l
  1844. .\".b "Examples:"
  1845. .\".(l
  1846. .\" .DISTO RL 2 0.95 1.0E-3 0.75
  1847. .\".)l
  1848. .\".sp 0.1i
  1849. .\".pp
  1850. .\"This card controls whether SPICE will compute the distortion characteristic
  1851. .\"of the circuit in a small-signal mode as a part of the ac small-signal
  1852. .\"sinusoidal steady-state analysis.  The analysis is performed assuming that
  1853. .\"one or two signal frequencies are imposed at the input;  let the two frequencies
  1854. .\"be f1 (the nominal analysis frequency) and f2 (=SKW2*f1).  The program
  1855. .\"then computes the following distortion measures:
  1856. .\".sp 0.2i
  1857. .\"    HD2  - the magnitude of the frequency component 2*f1 assuming that f2
  1858. .\"           is not present.
  1859. .\"    HD3  - the magnitude of the frequency component 3*f1 assuming that f2
  1860. .\"           is not present.
  1861. .\"    SIM2 - the magnitude of the frequency component f1 + f2.
  1862. .\"    DIM2 - the magnitude of the frequency component f1 - f2.
  1863. .\"    DIM3 - the magnitude of the frequency component 2*f1 - f2.
  1864. .\".pp
  1865. .\"RLOAD is the name of the output load resistor into which all distortion
  1866. .\"power products are to be computed.  INTER is the interval at which the summary
  1867. .\"printout of the contributions of all nonlinear devices to the total distortion
  1868. .\"is to be printed.  If omitted or set to zero, no summary printout will be made.
  1869. .\"REFPWR is the reference power level used in computing the distortion products;
  1870. .\"if omitted, a value of 1 mW (that is, dbm) is used.  SKW2 is the ratio of f2 to
  1871. .\"f1.  If omitted, a value of 0.9 is used (i.e., f2 = 0.9*f1).  SPW2 is the
  1872. .\"amplitude of f2.  If omitted, a value of 1.0 is assumed.
  1873. .\".pp
  1874. .\"The distortion measures HD2, HD3, SIM2, DIM2, and DIM3 may also be be
  1875. .\"printed and/or plotted (see the description of the .PRINT and .PLOT cards).
  1876. .\".sp 0.2i
  1877. .\".sh 2 ".NOISE Card"
  1878. .\".sp 0.1i
  1879. .\".b "General form:"
  1880. .\".(l
  1881. .\" .NOISE OUTV INSRC NUMS
  1882. .\".)l
  1883. .\".b "Examples:"
  1884. .\".(l
  1885. .\" .NOISE V(5) VIN 10
  1886. .\".)l
  1887. .\".pp
  1888. .\"This card controls the noise analysis of the circuit.  The noise analysis
  1889. .\"is performed in conjunction with the ac analysis (see .AC card). OUTV is an
  1890. .\"output voltage which defines the summing point.  INSRC is the name of the
  1891. .\"independent voltage or current source which is the noise input reference. NUMS
  1892. .\"is the summary interval.  SPICE will compute the equivalent output noise at
  1893. .\"the specified output as well as the equivalent input noise at the specified
  1894. .\"input.  In addition, the contributions of every noise generator in the circuit
  1895. .\"will be printed at every NUMS frequency points (the summary interval).  If NUMS
  1896. .\"is zero, no summary printout will be made.
  1897. .\".pp
  1898. .\"The output noise and the equivalent input noise may also be printed and/or
  1899. .\"plotted (see the description of the .PRINT and .PLOT cards).
  1900. .ne 0.8i
  1901. .sp 0.2i
  1902. .sh 2 ".TRAN Card"
  1903. .sp 0.1i
  1904. .b "General form:"
  1905. .(l
  1906.  .TRAN TSTEP TSTOP <TSTART <TMAX>> \"<UIC>
  1907. .)l
  1908. .b "Examples:"
  1909. .(l
  1910.  .TRAN 1NS 100NS
  1911.  .TRAN 1NS 1000NS 500NS
  1912.  .TRAN 10NS 1US\" UIC
  1913. .)l
  1914. .pp
  1915. TSTEP is the printing or plotting increment for line-printer output.
  1916. For use with the post-processor, TSTEP is the suggested computing increment.
  1917. TSTOP is the final time, and TSTART is
  1918. the initial time.  If TSTART is omitted, it is assumed to be zero.  The
  1919. transient analysis always begins at time zero.  In the interval <zero, TSTART>,
  1920. the circuit is analyzed (to reach a steady state), but no outputs are stored.
  1921. In the interval <TSTART, TSTOP>, the circuit is analyzed and outputs are
  1922. stored.  TMAX is the maximum stepsize that SPICE will use (for default, the
  1923. program chooses either TSTEP or (TSTOP-TSTART)/50.0, whichever is smaller.
  1924. TMAX is useful when one wishes to guarantee a computing interval which is
  1925. smaller than the printer increment, TSTEP.
  1926. .pp
  1927. UIC (use initial conditions) is an optional keyword which indicates that
  1928. the user does not want SPICE to solve for the quiescent operating point before
  1929. beginning the transient analysis.  If this keyword is specified, SPICE uses the
  1930. values specified using IC=... on the various elements as the initial transient
  1931. condition and proceeds with the analysis.  If the .IC card has been specified,
  1932. then the node voltages on the .IC card are used 
  1933. to compute the intitial conditions
  1934. for the devices.  Look at the description on the .IC card for its
  1935. interpretation when UIC is not specified.
  1936. .b
  1937. .sp 0.2i
  1938. .sh 2 ".FOUR Card"
  1939. .sp 0.1i
  1940. .pp
  1941. The .FOUR card used by SPICE2 to request fourier analysis of outputs
  1942. has been replaced by the fourier command in nutmeg and the interactive
  1943. SPICE3 front end. 
  1944. For details of this command, see the manuals for these interfaces.
  1945. .\".b "General form:"
  1946. .\".(l
  1947. .\" .FOUR FREQ OV1 <OV2 OV3 ...>
  1948. .\".)l
  1949. .\".b "Examples:"
  1950. .\".(l
  1951. .\" .FOUR 100K  V(5)
  1952. .\".)l
  1953. .\".pp
  1954. .\"This card controls whether SPICE performs a Fourier analysis as a part of
  1955. .\"the transient analysis.  FREQ is the fundamental frequency, and OV1, ..., are
  1956. .\"the output variables for which the analysis is desired.  The Fourier analysis
  1957. .\"is performed over the interval <TSTOP-period, TSTOP>, where TSTOP is the final
  1958. .\"time specified for the transient analysis, and period is one period of the
  1959. .\"fundamental frequency.  The dc component and the first nine components are
  1960. .\"determined.  For maximum accuracy, TMAX (see the .TRAN card) should be set to
  1961. .\"period/100.0 (or less for very high-Q circuits).
  1962. .\".ne 0.8i
  1963. .\".sp 0.2i
  1964. .\".sh 2 ".PRINT Cards"
  1965. .\".sp 0.1i
  1966. .\".b "General form:"
  1967. .\".(l
  1968. .\" .PRINT PRTYPE OV1 <OV2 ... OV8>
  1969. .\".)l
  1970. .\".b "Examples:"
  1971. .\".(l
  1972. .\" .PRINT TRAN V(4) I(VIN)
  1973. .\" .PRINT AC VM(4,2) VR(7) VP(8,3)
  1974. .\" .PRINT DC V(2) I(VSRC) V(23,17)
  1975. .\" .PRINT NOISE INOISE
  1976. .\" .PRINT DISTO HD3 SIM2(DB)
  1977. .\".)l
  1978. .\".pp
  1979. .\"This card defines the contents of a tabular listing of one to eight output
  1980. .\"variables.  PRTYPE is the type of the analysis (DC, AC, TRAN, NOISE, or
  1981. .\"DISTO) for which the specified outputs are desired. The form for voltage or
  1982. .\"current output variables is as follows:
  1983. .\".sp 0.2i
  1984. .\".ip V(N1<,N2>) 10
  1985. .\"specifies the voltage difference between nodes N1
  1986. .\"and N2.  If N2 (and the preceding comma) is omitted,
  1987. .\"ground (0) is assumed.  For the ac analysis, five
  1988. .\"additional outputs can be accessed by replacing the
  1989. .\"letter V by:
  1990. .\".sp 0.2i
  1991. .\".TS
  1992. .\"center;
  1993. .\"l l.
  1994. .\"VR  -     real part
  1995. .\"VI  -     imaginary part
  1996. .\"VM  -     magnitude
  1997. .\"VP  -     phase
  1998. .\"VDB -     20*log10(magnitude)
  1999. .\".TE
  2000. .\".sp 0.2i
  2001. .\".ip I(VXXXXXXX) 10
  2002. .\"specifies the current flowing in the independent
  2003. .\"voltage source named VXXXXXXX.   Positive current
  2004. .\"flows from the positive node, through the source, to
  2005. .\"the negative node.  For the ac analysis, the
  2006. .\"corresponding replacements for the letter I may be
  2007. .\"made in the same way as described for voltage outputs.
  2008. .\".sp 0.2i
  2009. .\".pp
  2010. .\"Output variables for the noise and distortion analyses have a different
  2011. .\"general form
  2012. .\"from that of the other analyses, i.e.
  2013. .\".(l
  2014. .\"                  OV<(X)>
  2015. .\".)l
  2016. .\"where OV is any of ONOISE (output noise), INOISE (equivalent input noise),
  2017. .\"D2, HD3, SIM2, DIM2, or DIM3 (see description of distortion analysis), and X
  2018. .\"may be any of:
  2019. .\".TS
  2020. .\"center;
  2021. .\"l l.
  2022. .\"R  -     real part
  2023. .\"I  -     imaginary part
  2024. .\"M  -     magnitude (default if nothing specified)
  2025. .\"P  -     phase
  2026. .\"DB -     20*log10(magnitude)
  2027. .\".TE
  2028. .\"thus, SIM2 (or SIM2(M)) describes the magnitude of the SIM2 distortion measure,
  2029. .\"while HD2(R) describes the real part of the HD2 distortion measure.
  2030. .\".pp
  2031. .\"There is no limit on the number of .PRINT cards for each type of
  2032. .\"analysis.
  2033. .\".sp 0.2i
  2034. .\".sh 2 ".PLOT Cards"
  2035. .\".sp 0.1i
  2036. .\".b "General form:"
  2037. .\".(l
  2038. .\" .PLOT PLTYPE OV1 <(PLO1,PHI1)> <OV2 <(PLO2,PHI2)> ... OV8>
  2039. .\".)l
  2040. .\".b "Examples:"
  2041. .\".(l
  2042. .\" .PLOT DC V(4) V(5) V(1)
  2043. .\" .PLOT TRAN V(17,5) (2,5) I(VIN) V(17) (1,9)
  2044. .\" .PLOT AC VM(5) VM(31,24) VDB(5) VP(5)
  2045. .\" .PLOT DISTO HD2 HD3(R) SIM2
  2046. .\" .PLOT TRAN V(5,3) V(4) (0,5) V(7) (0,10)
  2047. .\".)l
  2048. .\".pp
  2049. .\"This card defines the contents of one plot of from one to eight output
  2050. .\"variables.  PLTYPE is the type of analysis (DC, AC, TRAN, NOISE, or DISTO)
  2051. .\"for which the specified outputs are desired.  The syntax for the OVI is
  2052. .\"identical to that for the .PRINT card, described above.
  2053. .\".pp
  2054. .\"The optional plot limits (PLO,PHI) may be specified after any of the
  2055. .\"output variables.  All output variables to the left of a pair of plot limits
  2056. .\"(PLO,PHI) will be plotted using the same lower and upper plot bounds.  If plot
  2057. .\"limits are not specified, SPICE will automatically determine the minimum and
  2058. .\"maximum values of all output variables being plotted and scale the plot to fit.
  2059. .\"More than one scale will be used if the output variable values warrant (i.e.,
  2060. .\"mixing output variables with values which are orders-of-magnitude different
  2061. .\"still gives readable plots).
  2062. .\".pp
  2063. .\"The overlap of two or more traces on any plot is indicated by the letter
  2064. .\"X.
  2065. .\".pp
  2066. .\"When more than one output variable appears on the same plot, the
  2067. .\"first variable specified will be printed as well as plotted.  If a printout
  2068. .\"of all variables is desired, then a companion .PRINT card should be included.
  2069. .\".pp
  2070. .\"There is no limit on the number of .PLOT cards specified for each
  2071. .\"type of analysis.
  2072. .sp .5i
  2073. .sh 1 "APPENDIX A:  EXAMPLE DATA DECKS"
  2074. .sp 0.2i
  2075. .sh 2 "Circuit 1"
  2076. .sp 0.1i
  2077. .pp
  2078. The following deck determines the dc operating point \"and small-signal
  2079. .\"transfer function 
  2080. of a simple differential pair.  
  2081. In addition, the ac
  2082. small-signal response is computed over the frequency range 1Hz to 100MEGHz.
  2083. .(l
  2084. SIMPLE DIFFERENTIAL PAIR
  2085. VCC 7 0 12
  2086. VEE 8 0 -12
  2087. VIN 1 0 AC 1
  2088. RS1 1 2 1K
  2089. RS2 6 0 1K
  2090. Q1 3 2 4 MOD1
  2091. Q2 5 6 4 MOD1
  2092. RC1 7 3 10K
  2093. RC2 7 5 10K
  2094. RE 4 8 10K
  2095.  .MODEL MOD1 NPN BF=50 VAF=50 IS=1.E-12 RB=100 CJC=.5PF TF=.6NS
  2096. .\" .TF V(5) VIN
  2097.  .AC DEC 10 1 100MEG
  2098. .\" .PLOT AC VM(5) VP(5)
  2099. .\" .PRINT AC VM(5) VP(5)
  2100.  .END
  2101. .)l
  2102. .sp 0.2i
  2103. .sh 2 "Circuit 2"
  2104. .sp 0.1i
  2105. The following deck computes the output characteristics of a MOSFET
  2106. device over the range 0-10V for VDS and 0-5V for VGS.
  2107. .sp 0.2i
  2108. .(l
  2109.  MOS OUTPUT CHARACTERISTICS
  2110.  .OPTIONS NODE NOPAGE
  2111.  VDS 3 0
  2112.  VGS 2 0
  2113.  M1 1 2 0 0 MOD1 L=4U W=6U AD=10P AS=10P
  2114.  .MODEL MOD1 NMOS VTO=-2 NSUB=1.0E15 UO=550
  2115.  * VIDS MEASURES ID, WE COULD HAVE USED VDS, BUT ID WOULD BE NEGATIVE
  2116.  VIDS 3 1
  2117.  .DC VDS 0 10 .5 VGS 0 5 1
  2118. .\" .PRINT DC I(VIDS) V(2)
  2119. .\" .PLOT DC I(VIDS)
  2120.  .END
  2121. .)l
  2122. .sp .2i
  2123. .sh 2 "Circuit 3"
  2124. .sp 0.1i
  2125. .pp
  2126. The following deck determines the dc transfer curve and the transient
  2127. pulse response of a simple RTL inverter.  The input is a pulse from 0 to 5
  2128. Volts with delay, rise, and fall times of 2ns and a pulse width of 30ns.  The
  2129. transient interval is 0 to 100ns, with printing to be done every nanosecond.
  2130. .sp 0.2i
  2131. .(l
  2132.  SIMPLE RTL INVERTER
  2133.  VCC 4 0 5
  2134.  VIN 1 0 PULSE 0 5 2NS 2NS 2NS 30NS
  2135.  RB 1 2 10K
  2136.  Q1 3 2 0 Q1
  2137.  RC 3 4 1K
  2138. .\" .PLOT DC V(3)
  2139. .\" .PLOT TRAN V(3) (0,5)
  2140. .\" .PRINT TRAN V(3)
  2141.  .MODEL Q1 NPN BF 20 RB 100 TF .1NS CJC 2PF
  2142.  .DC VIN 0 5 0.1
  2143.  .TRAN 1NS 100NS
  2144.  .END
  2145. .)l
  2146. .sp 0.2i
  2147. .sh 2 "Circuit 4"
  2148. .sp 0.1i
  2149. .pp
  2150. The following deck simulates a four-bit binary adder, using several 
  2151. subcircuits to describe various pieces of the overall circuit.
  2152. .sp 0.2i
  2153. .(l
  2154. ADDER - 4 BIT ALL-NAND-GATE BINARY ADDER
  2155. .sp 0.2i
  2156.      *** SUBCIRCUIT DEFINITIONS
  2157. .sp 0.2i
  2158.  .SUBCKT NAND 1 2 3 4
  2159.       *   NODES:  INPUT(2), OUTPUT, VCC
  2160.  Q1 9 5 1 QMOD
  2161.  D1CLAMP 0 1 DMOD
  2162.  Q2 9 5 2 QMOD
  2163.  D2CLAMP 0 2 DMOD
  2164.  RB 4 5 4K
  2165.  R1 4 6 1.6K
  2166.  Q3 6 9 8 QMOD
  2167.  R2 8 0 1K
  2168.  RC 4 7 130
  2169.  Q4 7 6 10 QMOD
  2170.  DVBEDROP 10 3 DMOD
  2171.  Q5 3 8 0 QMOD
  2172.  .ENDS NAND
  2173.  .SUBCKT ONEBIT 1 2 3 4 5 6
  2174.       *   NODES:  INPUT(2), CARRY-IN, OUTPUT, CARRY-OUT, VCC
  2175.  X1 1 2 7 6 NAND
  2176.  X2 1 7 8 6 NAND
  2177.  X3 2 7 9 6 NAND
  2178.  X4 8 9 10 6 NAND
  2179.  X5 3 10 11 6 NAND
  2180.  X6 3 11 12 6 NAND
  2181.  X7 10 11 13 6 NAND
  2182.  X8 12 13 4 6 NAND
  2183.  X9 11 7 5 6 NAND
  2184.  .ENDS ONEBIT
  2185.  .SUBCKT TWOBIT 1 2 3 4 5 6 7 8 9
  2186.       *   NODES:  INPUT - BIT0(2) / BIT1(2), OUTPUT - BIT0 / BIT1,
  2187.       *           CARRY-IN, CARRY-OUT, VCC
  2188.  X1 1 2 7 5 10 9 ONEBIT
  2189.  X2 3 4 10 6 8 9 ONEBIT
  2190.  .ENDS TWOBIT
  2191. .sp 0.2i
  2192.  .SUBCKT FOURBIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  2193.      *   NODES:  INPUT - BIT0(2) / BIT1(2) / BIT2(2) / BIT3(2),
  2194.      *           OUTPUT - BIT0 / BIT1 / BIT2 / BIT3, CARRY-IN, CARRY-OUT, VCC
  2195.  X1 1 2 3 4 9 10 13 16 15 TWOBIT
  2196.  X2 5 6 7 8 11 12 16 14 15 TWOBIT
  2197.  .ENDS FOURBIT
  2198. .sp 0.2i
  2199.      *** DEFINE NOMINAL CIRCUIT
  2200. .sp 0.2i
  2201.  .MODEL DMOD D
  2202.  .MODEL QMOD NPN(BF=75 RB=100 CJE=1PF CJC=3PF)
  2203.  VCC 99 0 DC 5V
  2204.  VIN1A 1 0 PULSE(0 3 0 10NS 10NS   10NS   50NS)
  2205.  VIN1B 2 0 PULSE(0 3 0 10NS 10NS   20NS  100NS)
  2206.  VIN2A 3 0 PULSE(0 3 0 10NS 10NS   40NS  200NS)
  2207.  VIN2B 4 0 PULSE(0 3 0 10NS 10NS   80NS  400NS)
  2208.  VIN3A 5 0 PULSE(0 3 0 10NS 10NS  160NS  800NS)
  2209.  VIN3B 6 0 PULSE(0 3 0 10NS 10NS  320NS 1600NS)
  2210.  VIN4A 7 0 PULSE(0 3 0 10NS 10NS  640NS 3200NS)
  2211.  VIN4B 8 0 PULSE(0 3 0 10NS 10NS 1280NS 6400NS)
  2212.  X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 FOURBIT
  2213.  RBIT0 9 0 1K
  2214.  RBIT1 10 0 1K
  2215.  RBIT2 11 0 1K
  2216.  RBIT3 12 0 1K
  2217.  RCOUT 13 0 1K
  2218. .\" .PLOT TRAN V(1) V(2) V(3) V(4) V(5) V(6) V(7) V(8)
  2219. .\" .PLOT TRAN V(9) V(10) V(11) V(12) V(13)
  2220. .\" .PRINT TRAN V(1) V(2) V(3) V(4) V(5) V(6) V(7) V(8)
  2221. .\" .PRINT TRAN V(9) V(10) V(11) V(12) V(13)
  2222. .sp 0.2i
  2223.      *** (FOR THOSE WITH MONEY (AND MEMORY) TO BURN)
  2224.  .TRAN 1NS 6400NS
  2225. .sp 0.2i
  2226. .\" .OPTIONS ACCT LIST NODE LIMPTS=6401
  2227.  .END
  2228. .)l
  2229. .sp 0.2i
  2230. .sh 2 "Circuit 5"
  2231. .sp 0.1i
  2232. .pp
  2233. The following deck simulates a transmission-line inverter.  Two
  2234. transmission-line elements are required since two propagation modes are excited.
  2235. In the case of a coaxial line, the first line (T1) models the inner conductor
  2236. with
  2237. respect to the shield, and the second line (T2) models the shield with respect
  2238. to the outside world.
  2239. .sp 0.2i
  2240. .(l
  2241. TRANSMISSION-LINE INVERTER
  2242. V1 1 0 PULSE(0 1 0 0.1N)
  2243. R1 1 2 50
  2244. X1 2 0 0 4 TLINE
  2245. R2 4 0 50
  2246.  .SUBCKT TLINE 1 2 3 4
  2247. T1 1 2 3 4 Z0=50 TD=1.5NS
  2248. T2 2 0 4 0 Z0=100 TD=1NS
  2249.  .ENDS TLINE
  2250.  .TRAN 0.1NS 20NS
  2251. .\" .PLOT TRAN V(2) V(4)
  2252.  .END
  2253. .)l
  2254. .\".bp
  2255. .\".sh 1 "APPENDIX B:  NONLINEAR DEPENDENT SOURCES"
  2256. .\".sp 0.2i
  2257. .\".pp
  2258. .\"SPICE allows circuits to contain dependent sources characterized by any of
  2259. .\"the four equations
  2260. .\".sp 0.2i
  2261. .\"        i=f(v)          v=f(v)          i=f(i)          v=f(i)
  2262. .\".sp 0.2i
  2263. .\"where the functions must be polynomials, and the arguments may be
  2264. .\"multidimensional.  The polynomial functions are specified by a set of
  2265. .\"coefficients
  2266. .\"p0, p1, ..., pn.  Both the number of dimensions and the number of coefficients
  2267. .\"are arbitrary.  The meaning of the coefficients depends upon the dimension of
  2268. .\"the polynomial, as shown in the following examples: 
  2269. .\".pp
  2270. .\"Suppose that the function is one-dimensional (that is, a function of one
  2271. .\"argument).  Then the function value fv is determined by the following
  2272. .\"expression in fa (the function argument):
  2273. .\".sp 0.2i
  2274. .\"    fv = p0 + (p1*fa) + (p2*fa**2) + (p3*fa**3) + (p4*fa**4)
  2275. .\".sp 0.2i
  2276. .\"         + (p5*fa**5) + ...
  2277. .\".pp
  2278. .\"Suppose now that the function is two-dimensional, with arguments fa and
  2279. .\"fb.  Then the function value fv is determined by the following expression:
  2280. .\".sp 0.2i
  2281. .\"    fv = p0 + (p1*fa) + (p2*fb) + (p3*fa**2) + (p4*fa*fb) + (p5*fb**2)
  2282. .\".sp 0.2i
  2283. .\"         + (p6*fa**3) + (p7*fa**2*fb) + (p8*fa*fb**2) + (p9*fb**3) + ...
  2284. .\".pp
  2285. .\"Consider now the case of a three-dimensional polynomial function with
  2286. .\"arguments fa, fb, and fc.  Then the function value fv is determined by the
  2287. .\"following expression:
  2288. .\".sp 0.2i
  2289. .\"    fv = p0 + (p1*fa) + (p2*fb) + (p3*fc) + (p4*fa**2) + (p5*fa*fb)
  2290. .\".sp 0.2i
  2291. .\"         + (p6*fa*fc) + (p7*fb**2) + (p8*fb*fc) + (p9*fc**2) + (p10*fa**3)
  2292. .\".sp 0.2i
  2293. .\"         + (p11*fa**2*fb) + (p12*fa**2*fc) + (p13*fa*fb**2)
  2294. .\".sp 0.2i
  2295. .\"         + (p14*fa*fb*fc)
  2296. .\".sp 0.2i
  2297. .\"         + (p15*fa*fc**2) + (p16*fb**3) + (p17*fb**2*fc) + (p18*fb*fc**2)
  2298. .\".sp 0.2i
  2299. .\"         + (p19*fc**3) + (p20*fa**4) + ...
  2300. .\".pp
  2301. .\"Note:  if the polynomial is one-dimensional and exactly one coefficient is
  2302. .\"specified, then SPICE assumes it to be p1 (and p0 = 0.0), in order to
  2303. .\"facilitate the input of linear controlled sources.
  2304. .\".pp
  2305. .\"For all four of the dependent sources described below, the initial
  2306. .\"condition parameter is described as optional.  If not specified, SPICE assumes 0
  2307. .\"the initial condition for dependent sources is an initial 'guess' for the value
  2308. .\"of the controlling variable.  The program uses this initial condition to obtain
  2309. .\"the dc operating point of the circuit.  After convergence has been obtained,
  2310. .\"the program continues iterating to obtain the exact value for the controlling
  2311. .\"variable.  Hence, to reduce the computational effort for the dc operating
  2312. .\"point (or if the polynomial specifies a strong nonlinearity), a value fairly
  2313. .\"close to the actual controlling variable should be specified for the initial
  2314. .\"condition.
  2315. .\".sp 0.2i
  2316. .\".sh 2 "Voltage-Controlled Current Sources"
  2317. .\".sp 0.1i
  2318. .\".b "General form:"
  2319. .\".(l
  2320. .\"GXXXXXXX N+ N- <POLY(ND)> NC1+ NC1- ... P0 <P1 ...> <IC=...>
  2321. .\".)l
  2322. .\".b "Examples:"
  2323. .\".(l
  2324. .\"G1 1 0 5 3 0 0.1M
  2325. .\"GR 17 3 17 3 0 1M 1.5M IC=2V
  2326. .\"GMLT 23 17 POLY(2) 3 5 1 2 0 1M 17M 3.5U IC=2.5, 1.3
  2327. .\".)l
  2328. .\".pp
  2329. .\"N+ and N- are the positive and negative nodes, respectively.  Current flow
  2330. .\"is from the positive node, through the source, to the negative node.  POLY(ND)
  2331. .\"only has to be specified if the source is multi-dimensional (one-dimensional is
  2332. .\"the default).  If specified, ND is the number of dimensions, which must be
  2333. .\"positive.  NC1+, NC1-, ... Are the positive and negative controlling nodes,
  2334. .\"respectively.  One pair of nodes must be specified for each dimension.  P0, P1,
  2335. .\"P2, ..., Pn are the polynomial coefficients.  The (optional) initial condition
  2336. .\"is the initial guess at the value(s) of the controlling voltage(s).  If not
  2337. .\"specified, 0.0 is assumed.  The polynomial specifies the source current as a
  2338. .\"function of the controlling voltage(s).  The second example above describes a
  2339. .\"current source with value
  2340. .\".sp 0.2i
  2341. .\"        I = 1E-3*V(17,3) + 1.5E-3*V(17,3)**2
  2342. .\".sp 0.2i
  2343. .\"note that since the source nodes are the same as the controlling nodes, this
  2344. .\"source actually models a nonlinear resistor.
  2345. .\".bp
  2346. .\".sh 2 "Voltage-Controlled Voltage Sources"
  2347. .\".sp 0.1i
  2348. .\".b "General form:"
  2349. .\".(l
  2350. .\"EXXXXXXX N+ N- <POLY(ND)> NC1+ NC1- ... P0 <P1 ...> <IC=...>
  2351. .\".)l
  2352. .\".b "Examples:"
  2353. .\".(l
  2354. .\"E1 3 4 21 17 10.5 2.1 1.75
  2355. .\"EX 17 0 POLY(3) 13 0 15 0 17 0 0 1 1 1 IC=1.5,2.0,17.35
  2356. .\".)l
  2357. .\".pp
  2358. .\"N+ and N- are the positive and negative nodes, respectively.  POLY(ND)
  2359. .\"only has to be specified if the source is multi-dimensional (one-dimensional is
  2360. .\"the default).  If specified, ND is the number of dimensions, which must be
  2361. .\"positive.  NC1+, NC1-, ... are the positive and negative controlling nodes,
  2362. .\"respectively.  One pair of nodes must be specified for each dimension.  P0, P1,
  2363. .\"P2, ..., Pn are the polynomial coefficients.  The (optional) initial condition
  2364. .\"is the initial guess at the value(s) of the controlling voltage(s).  If not
  2365. .\"specified, 0.0 is assumed.  The polynomial specifies the source voltage as a
  2366. .\"function of the controlling voltage(s).  The second example above describes a
  2367. .\"voltage source with value
  2368. .\".sp 0.2i
  2369. .\"        V = V(13,0) + V(15,0) + V(17,0)
  2370. .\".sp 0.2i
  2371. .\"(in other words, an ideal voltage summer).
  2372. .\".sp 0.2i
  2373. .\".sh 2 "Current-Controlled Current Sources"
  2374. .\".sp 0.1i
  2375. .\".b "General form:"
  2376. .\".(l
  2377. .\"FXXXXXXX N+ N- <POLY(ND)> VN1 <VN2 ...> P0 <P1 ...> <IC=...>
  2378. .\".)l
  2379. .\".b "Examples:" 
  2380. .\".(l
  2381. .\"F1 12 10 VCC 1MA 1.3M
  2382. .\"FXFER 13 20 VSENS 0 1
  2383. .\".)l
  2384. .\".pp
  2385. .\"N+ and N- are the positive and negative nodes, respectively.  Current flow
  2386. .\"is from the positive node, through the source, to the negative node.  POLY(ND)
  2387. .\"only has to be specified if the source is multi-dimensional (one-dimensional is
  2388. .\"the default).  If specified, ND is the number of dimensions, which must be
  2389. .\"positive.  VN1, VN2, ... are the names of voltage sources through which the
  2390. .\"controlling current flows;  one name must be specified for each dimension.  The
  2391. .\"direction of positive controlling current flow is from the positive node,
  2392. .\"through the source, to the negative node of each voltage source.  P0, P1,
  2393. .\"P2, ..., Pn are the polynomial coefficients.  The (optional) initial condition
  2394. .\"is the initial guess at the value(s) of the controlling current(s) (in Amps).
  2395. .\"If not specified, 0.0 is assumed.  The polynomial specifies the source current
  2396. .\"as a function of the controlling current(s).  The first example above describes
  2397. .\"a current source with value
  2398. .\".sp 0.2i
  2399. .\"        I = 1E-3 + 1.3E-3*I(VCC)
  2400. .\".sp 0.2i
  2401. .\".sh 2 "Current-Controlled Voltage Sources"
  2402. .\".sp 0.1i
  2403. .\".b "General form:"
  2404. .\".(l
  2405. .\"HXXXXXXX N+ N- <POLY(ND)> VN1 <VN2 ...> P0 <P1 ...> <IC=...>
  2406. .\".)l
  2407. .\".b "Examples:" 
  2408. .\".(l
  2409. .\"HXY 13 20 POLY(2) VIN1 VIN2 0 0 0 0 1 IC=0.5 1.3
  2410. .\"HR 4 17 VX 0 0 1
  2411. .\".)l
  2412. .\".pp
  2413. .\"N+ and N- are the positive and negative nodes, respectively.  POLY(ND)
  2414. .\"only has to be specified if the source is multi-dimensional (one-dimensional is
  2415. .\"the default).  If specified, ND is the number of dimensions, which must be
  2416. .\"positive.  VN1, VN2, ... are the names of voltage sources through which the
  2417. .\"controlling current flows;  one name must be specified for each dimension.  The
  2418. .\"direction of positive controlling current flow is from the positive node,
  2419. .\"through the source, to the negative node of each voltage source.  P0, P1,
  2420. .\"P2, ..., Pn are the polynomial coefficients.  The (optional) initial condition
  2421. .\"is the initial guess at the value(s) of the controlling current(s) (in Amps).
  2422. .\"If not specified, 0.0 is assumed.  The polynomial specifies the source voltage
  2423. .\"as a function of the controlling current(s).  The first example above describes
  2424. .\"a voltage source with value
  2425. .\".sp 0.2i
  2426. .\"        V = I(VIN1)*I(VIN2)
  2427.