BSD 3 development
[unix-history] / usr / doc / spice
CommitLineData
2cede8ff
D
1.th
2.(l C
3.b "Spice VAX Version 2X.x User's Guide"
4.sp 0.2i
5R.Dowell, A.R.Newton, D.O.Pederson
6Department of Electrical Engineering and Computer Sciences
7University of California
8Berkeley, Ca., 94720
9.sp 0.2i
10.)l
11.pp
12Spice is a general-purpose circuit simulation program for nonlinear dc,
13nonlinear transient, and linear ac analyses. Circuits may contain resistors,
14capacitors, inductors, mutual inductors, independent voltage and current
15sources, four types of dependent sources, transmission lines, and the four most
16common semiconductor devices: diodes, bjts, jfets, and mosfets.
17.pp
18Spice has built-in models for the semiconductor devices, and the user need
19specify only the pertinent model parameter values. The model for the bjt is
20based on the integral charge model of Gummel and Poon; however, if the Gummel-
21Poon parameters are not specified, the model reduces to the simpler Ebers-Moll
22model. In either case, charge storage effects, ohmic resistances, and a
23current-dependent output conductance may be included. The diode model can be
24used for either junction diodes or schottky barrier diodes. The jfet model is
25based on the fet model of Shichman and Hodges. The model for the mosfet is
26based on the Frohman-Grove model; however, channel-length modulation,
27subthreshold conduction, and some short-channel effects are included.
28.pp
29Note that the mosfet model parameter lambda has been changed to express
30channel length modulation in meters/volt in this version of spice.
31.bp
32.sh 1 "TYPES OF ANALYSIS"
33.sp 0.2i
34.sh 2 "dc analysis"
35.pp
36The dc analysis portion of spice determines the dc operating point of the
37circuit with inductors shorted and capacitors opened. A dc analysis is
38automatically performed prior to a transient analysis to determine the transient
39initial conditions, and prior to an ac small-signal analysis to determine the
40linearized, small-signal models for nonlinear devices. If requested, the dc
41small-signal value of a transfer function (ratio of output variable to input
42source), input resistance, and output resistance will also be computed as a
43part of the dc solution. The dc analysis can also be used to generate dc
44transfer curves: a specified independent voltage or current source is stepped
45over a user-specified range and the dc output variables are stored for each
46sequential source value. If requested, spice also will determine the dc
47small-signal sensitivities of specified output variables with respect to circuit
48parameters. The dc analysis options are specified on the .dc, .tf, .op,
49and .sens control cards.
50.pp
51If one desires to see the small-signal models for nonlinear devices
52in conjunction with a transient analysis operating point, then the '.op'
53card must be provided. The dc bias conditions will be identical for each
54case, but the more comprehensive operating point information is not available
55to be printed when transient initial conditions are computed.
56.sp 0.2i
57.sh 2 "ac small-signal analysis"
58.pp
59The ac small-signal portion of spice computes the ac output variables as a
60function of frequency. The program first computes the dc operating point of
61the circuit and determines linearized, small-signal models for all of the
62nonlinear devices in the circuit. The resultant linear circuit is then analyzed
63over a user-specified range of frequencies. The desired output of an ac small-
64signal analysis is usually a transfer function (voltage gain, transimpedance,
65etc). If the circuit has only one ac input, it is convenient to set that input
66to unity and zero phase, so that output variables have the same value as the
67transfer function of the output variable with respect to the input.
68.pp
69The generation of white noise by resistors and semiconductor devices can
70also be simulated with the ac small-signal portion of spice. Equivalent noise
71source values are determined automatically from the small-signal operating
72point of the circuit, and the contribution of each noise source is added at a
73given summing point. The total output noise level and the equivalent input
74noise level are determined at each frequency point. The output and input noise
75levels are normalized with respect to the square root of the noise bandwidth
76and have the units volts/rt hz or amps/rt hz. The output noise and equivalent
77input noise can be printed or plotted in the same fashion as other output
78variables. No additional input data is necessary for this analysis.
79.pp
80Flicker noise sources can be simulated in the noise analysis by including
81values for the parameters kf and af on the appropriate device model cards.
82.pp
83The distortion characteristics of a circuit in the small-signal mode can
84be simulated as a part of the ac small-signal analysis. The analysis is
85performed assuming that one or two signal frequencies are imposed at the input.
86.pp
87The frequency range and the noise and distortion analysis parameters are
88specified on the .ac, .noise, and .distortion control lines.
89.sp 0.2i
90.sh 2 "transient analysis"
91.pp
92The transient analysis portion of spice computes the transient output
93variables as a function of time over a user-specified time interval. The
94initial conditions are automatically determined by a dc analysis. All sources
95which are not time dependent (for example, power supplies) are set to their dc
96value. For large-signal sinusoidal simulations, a fourier analysis of the
97output waveform can be specified to obtain the frequency domain fourier
98coefficients. The transient time interval and the fourier analysis options are
99specified on the .tran and .fourier control lines.
100.sp 0.2i
101.sh 2 "analysis at different temperatures"
102.pp
103All input data for spice is assumed to have been measured at 25 deg c
104(298 deg k). The simulation also assumes a nominal temperature of 25 deg c.
105The circuit can be simulated at other temperatures by using a .temp control
106line.
107.pp
108Temperature appears explicitly in the exponential terms of the bjt and
109diode model equations. In addition, saturation currents have a built-in
110temperature dependence. The temperature dependence of the saturation current
111in the bjt models is determined by:
112.(l
113js(T1) = js(T0)*((T1/T0)**pt)*exp(q*Eg*(T1-T0)/(k*T1*T0))
114.)l
115where k is boltzmans constant, q is the electronic charge, Eg is the energy
116gap which is a model parameter, and pt is the saturation current
117temperature exponent (also a model parameter, and usually equal to 3). The
118temperature dependence of forward and reverse beta is according to the formula:
119.(l
120beta(T1)=beta(T0)*(T1/T0)**tb
121.)l
122where T1 and T0 are in degrees kelvin, and tb is a user-supplied model
123parameter. Temperature effects on beta are carried out by appropriate
124adjustment to the values of bf, jle, br, and jlc. Temperature dependence of the
125saturation current in the junction diode model is determined by:
126.(l
127is(T1) = is(T0)*((T1/T0)**(pt/n))*exp(q*Eg*(T1-T0)/(k*n*T1*T0))
128.)l
129where n is the emission coefficient, which is a model parameter, and the other
130symbols have the same meaning as above. Note that for schottky barrier diodes,
131the value of the saturation current temperature exponent, pt, is usually 2.
132.pp
133Temperature appears explicitly in the value of junction potential, phi,
134for all the device models. The temperature dependence is determined by:
135.(l
136phi(temp) = k*temp/q*log(Na*Nd/Ni(temp)**2)
137.)l
138where k is boltzmans constant, q is the electronic charge, Na is the acceptor
139impurity density, Nd is the donor impurity density, Ni is the intrinsic
140concentration, and Eg is the energy gap.
141.pp
142Temperature appears explicitly in the value of surface mobility, uo, for
143the mosfet model. The temperature dependence is determined by:
144.(l
145uo(temp) = uo(tnom)/(temp/tnom)**(1.5)
146.)l
147.pp
148The effects of temperature on resistors is modeled by the formula:
149.(l
150value(temp) = value(tnom)*(1+tc1*(temp-tnom)+tc2*(temp-tnom)**2))
151.)l
152where temp is the circuit temperature, tnom is the nominal temperature, and
153tc1 and tc2 are the first- and second-order temperature coefficients.
154.sp 0.5i
155.sh 1 "CONVERGENCE"
156.sp 0.2i
157.pp
158Both dc and transient solutions are obtained by an iterative process which
159is terminated when both of the following conditions hold:
160.sp 0.2i
161.ip 1)
162The nonlinear branch currents converge to within a tolerance of
1630.1 percent or 1 picoamp (1.0e-12 amp), whichever is larger.
164.ip 2)
165The node voltages converge to within a tolerance of 0.1 percent
166or 1 microvolt (1.0e-6 volt), whichever is larger.
167.pp
168Although the algorithm used in spice has been found to be very reliable, in
169some cases it will fail to converge to a solution. When this failure occurs,
170the program will print the node voltages at the last iteration and terminate
171the job. In such cases, the node voltages that are printed are not necessarily
172correct or even close to the correct solution.
173.pp
174Failure to converge in the dc analysis is usually due to an error in
175specifying circuit connections, element values, or model parameter values.
176Regenerative switching circuits or circuits with positive feedback probably
177will not converge in the dc analysis unless the 'off' option is used for some
178of the devices in the feedback path, or the .nodeset card is used to force the
179circuit to converge to the desired state.
180.sp 0.2i
181.bp
182.sh 1 "INPUT FORMAT"
183.sp 0.2i
184.pp
185The input format for spice is of the free format type. Fields on a card
186are separated by one or more blanks, a comma, an equal (=) sign, or a left or
187right parenthesis; extra spaces are ignored. A card may be continued by
188entering a + (plus) in column 1 of the following card; spice continues reading
189beginning with column 2.
190.pp
191A name field must begin with a letter (a through z) and cannot contain
192any delimiters. Only the first eight characters of the name are used.
193.pp
194A number field may be an integer field (12, -44), a floating point field
195(3.14159), either an integer or floating point number followed by an integer
196exponent (1e-14, 2.65e3), or either an integer or a floating point number
197followed by one of the following scale factors:
198.sp 0.2i
199.TS
200center;
201l l l l l.
202t=1e12 g=1e9 meg=1e6 k=1e3 mil=25.4e-6
203m=1e-3 u=1e-6 n=1e-9 p=1e-12 f=1e-15
204.TE
205.sp 0.2i
206Letters immediately following a number that are not scale factors are ignored,
207and letters immediately following a scale factor are ignored. Hence, 10, 10v,
20810volts, and 10hz all represent the same number, and m, ma, msec, and mmhos all
209represent the same scale factor. Note that 1000, 1000.0, 1000hz, 1e3, 1.0e3,
2101khz, and 1k all represent the same number.
211.bp
212.sh 1 "CIRCUIT DESCRIPTION"
213.pp
214The circuit to be analyzed is described to spice by a set of element
215cards, which define the circuit topology and element values, and a set of
216control cards, which define the model parameters and the run controls. The
217first card in the input deck must be a title card, and the last card must be
218a .end card. The order of the remaining cards is arbitrary (except, of course,
219that continuation cards must immediately follow the card being continued).
220.pp
221Each element in the circuit is specified by an element card that contains
222the element name, the circuit nodes to which the element is connected, and the
223values of the parameters that determine the electrical characteristics of the
224element. The first letter of the element name specifies the element type.
225The format for the spice element types is given in what follows. The strings
226'xxxxxxx', 'yyyyyyy', and 'zzzzzzz' denote arbitrary alphanumeric strings. For
227example, a resistor name must begin with the letter r and can contain from one
228to eight characters. Hence, r, r1, rse, rout, and r3ac2zy are valid resistor
229names.
230.pp
231Data fields that are enclosed in lt and gt signs '< >' are optional. All
232indicated punctuation (parentheses, equal signs, etc.) are required. With
233respect to branch voltages and currents, spice uniformly uses the associated
234reference convention (current flows in the direction of voltage drop).
235.pp
236Nodes must be nonnegative integers but need not be numbered sequentially.
237The datum (ground) node must be numbered zero. The circuit cannot contain a
238loop of voltage sources and/or inductors and cannot contain a cutset of current
239sources and/or capacitors. Each node in the circuit must have a dc path to
240ground. Every node must have at least two connections except for transmission
241line nodes (to permit unterminated transmission lines) and mosfet substrate
242nodes (which have two internal connections anyway).
243.sh 1 "TITLE CARD, COMMENT CARDS AND .END CARD"
244.sp 0.2i
245.sh 2 "title card"
246.sp 0.2i
247.b "Examples:"
248.(l
249power amplifier circuit
250test of CAM cell
251.)l
252.pp
253This card must be the first card in the input deck. Its contents are
254printed verbatim as the heading for each section of output.
255.sh 2 ".end card"
256.sp 0.2i
257.b "Examples:"
258.(l
259 .end
260.)l
261.pp
262This card must always be the last card in the input deck. Note that the
263period is an integral part of the name.
264.sp 0.2i
265.sh 2 "comment card"
266.sp 0.2i
267.b "General form:"
268.(l
269* <any comment>
270.)l
271.b "Examples:"
272.(l
273* rf=1k gain should be 100
274* May the Force be with my circuit
275.)l
276.pp
277The asterisk in the first column indicates that this card is a
278comment card. Comment cards may be placed anywhere in the circuit description.
279.bp
280.sh 1 "ELEMENT CARDS"
281.sp 0.2i
282.sh 2 "resistors"
283.sp 0.2i
284.b "General form:"
285.(l
286rxxxxxxx n1 n2 value <tc=tc1<,tc2>>
287.)l
288.b "Examples:"
289.(l
290r1 1 2 100
291rc1 12 17 1k tc=0.001,0.015
292.)l
293.pp
294N1 and n2 are the two element nodes. Value is the resistance (in ohms)
295and may be positive or negative but not zero. Tc1 and tc2 are the (optional)
296temperature coefficients; if not specified, zero is assumed for both. The
297value of the resistor as a function of temperature is given by:
298.(l
299value(temp) = value(tnom)*(1+tc1*(temp-tnom)+tc2*(temp-tnom)**2))
300.)l
301.sp 0.4i
302.sh 2 "capacitors and inductors"
303.sp 0.2i
304.b "General form:"
305.(l
306cxxxxxxx n+ n- value <ic=incond>
307lyyyyyyy n+ n- value <ic=incond>
308.)l
309.sp 0.2i
310.b "Examples:"
311.(l
312cbyp 13 0 1uf
313cosc 17 23 10u ic=3v
314llink 42 69 1uh
315lshunt 23 51 10u ic=15.7ma
316.)l
317.pp
318N+ and n- are the positive and negative element nodes, respectively.
319Value is the capacitance in farads or the inductance in henries.
320.pp
321For the capacitor, the (optional) initial condition is the initial
322time-zero) value of capacitor voltage (in volts). For the inductor, the (option
323initial condition is the initial (time-zero) value of inductor current (in
324amps) that flows from n+, through the inductor, to n-. Note that the initial
325conditions (if any) apply 'only' if the uic option is specified on the .tran
326card.
327.sh 2 "coupled (mutual) inductors"
328.sp 0.2i
329.b "General form:"
330.(l
331kxxxxxxx lyyyyyyy lzzzzzzz value
332.)l
333.b "Examples:"
334.(l
335k43 laa lbb 0.999
336kxfrmr l1 l2 0.87
337.)l
338.pp
339lyyyyyyy and lzzzzzzz are the names of the two coupled inductors, and
340value is the coefficient of coupling, k, which must be greater than 0 and less
341than or equal to 1. Using the 'dot' convention, place a 'dot' on the first
342node of each inductor.
343.sp 0.2i
344.sh 2 "transmission lines (lossless)"
345.sp 0.2i
346.b "General form:"
347.(l
348txxxxxxx n1 n2 n3 n4 z0=value <td=value> <f=freq <nl=nrmlen>>
349+ <ic=v1,i1,v2,i2>
350.)l
351.sp 0.2i
352.b "Examples:"
353.(l
354t1 1 0 2 0 z0=50 td=10ns
355.)l
356.pp
357N1 and n2 are the nodes at port 1; n3 and n4 are the nodes at port 2.
358Z0 is the characteristic impedance. The length of the line may be expressed in
359either of two forms. The transmission delay, td, may be specified directly (as
360td=10ns, for example). Alternatively, a frequency f may be given, together
361with nl, the normalized electrical length of the transmission line with respect
362to the wavelength in the line at the frequency f. If a frequency is specified
363but nl is omitted, 0.25 is assumed (that is, the frequency is assumed to be the
364quarter-wave frequency). Note that although both forms for expressing the line
365length are indicated as optional, one of the two must be specified.
366.pp
367Note that this element models only one propagating mode. If all four
368nodes are distinct in the actual circuit, then two modes may be excited. To
369simulate such a situation, two transmission-line elements are required. (see
370the example in Appendix A for further clarification.)
371.pp
372The (optional) initial condition specification consists of the voltage
373and current at each of the transmission line ports. Note that the initial
374conditions (if any) apply 'only' if the uic option is specified on the .tran
375card.
376.pp
377One should be aware that spice will use a transient time-step which
378does not exceed 1/2 the minimum transmission line delay. Therefore very
379short transmission lines (compared with the analysis time frame) will cause
380long run times.
381.sh 2 "linear dependent sources"
382.pp
383Spice allows circuits to contain linear dependent sources characterized by
384any of the four equations
385.sp 0.2i
386 i=g*v v=e*v i=f*i v=h*i
387.sp 0.2i
388where g, e, f, and h are constants representing transconductance, voltage gain,
389current gain, and transresistance, respectively. Note: a more complete
390description of dependent sources as implemented in spice is given in Appendix B.
391.sp 0.2i
392.sh 2 "linear voltage-controlled current sources"
393.sp 0.2i
394.b "General form:"
395.(l
396gxxxxxxx n+ n- nc+ nc- value
397.)l
398.sp 0.2i
399.b "Examples:"
400.(l
401g1 2 0 5 0 0.1mmho
402.)l
403.pp
404N+ and n- are the positive and negative nodes, respectively. Current flow
405is from the positive node, through the source, to the negative node. Nc+ and
406nc- are the positive and negative controlling nodes, respectively. Value is
407the transconductance (in mhos).
408.sp 0.2i
409.sh 2 "linear voltage-controlled voltage sources"
410.sp 0.2i
411.b "General form:"
412.(l
413exxxxxxx n+ n- nc+ nc- value
414.)l
415.sp 0.2i
416.b "Examples:"
417.(l
418e1 2 3 14 1 2.0
419.)l
420.pp
421N+ is the positive node, and n- is the negative node. Nc+ and nc- are the
422positive and negative controlling nodes, respectively. Value is the voltage
423gain.
424.sp 0.2i
425.sh 2 "linear current-controlled current sources"
426.sp 0.2i
427.b "General form:"
428.(l
429fxxxxxxx n+ n- vnam value
430.)l
431.sp 0.2i
432.b "Examples:"
433.(l
434f1 13 5 vsens 5
435.)l
436.pp
437N+ and n- are the positive and negative nodes, respectively. Current flow
438is from the positive node, through the source, to the negative node. Vnam is
439the name of a voltage source through which the controlling current flows. The
440direction of positive controlling current flow is from the positive node,
441through the source, to the negative node of vnam. Value is the current gain.
442.sp 0.2i
443.sh 2 "linear current-controlled voltage sources"
444.sp 0.2i
445.b "General form:"
446.(l
447hxxxxxxx n+ n- vnam value
448.)l
449.sp 0.2i
450.b "Examples:"
451.(l
452hx 5 17 vz 0.5k
453.)l
454.pp
455N+ and n- are the positive and negative nodes, respectively. Vnam is the
456name of a voltage source through which the controlling current flows. The
457direction of positive controlling current flow is from the positive node,
458through the source, to the negative node of vnam. Value is the transresistance
459(in ohms).
460.sh 2 "independent sources"
461.sp 0.2i
462.b "General form:"
463.(l
464vxxxxxxx n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>>
465.)l
466 iyyyyyyy n+ n- <<dc> dc/tran value> <ac <acmag <acphase>>>
467.sp 0.2i
468.b "Examples:"
469.(l
470vcc 10 0 dc 6
471vin 13 2 0.001 ac 1 sin(0 1 1meg)
472isrc 23 21 ac 0.333 45.0 sffm(0 1 10k 5 1k)
473vmeas 12 9
474.)l
475.pp
476N+ and n- are the positive and negative nodes, respectively. Note that
477voltage sources need not be grounded. Positive current is assumed to flow from
478positive node, through the source, to the negative node.
479A current sources of positive value, will force current to flow out of
480the n+ node, through the source, and into the n- node.
481Voltage sources, in addition to being
482used for circuit excitation, are the 'ammeters' for spice,
483that is, zero valued voltage sources may be inserted into the circuit for the pu
484of measuring current. They will, of course, have no effect on circuit
485operation since they represent short-circuits.
486.sp 0.2i
487.pp
488Dc/tran is the dc and transient analysis value of the source. If the
489source value is zero both for dc and transient analyses, this value may be
490omitted. If the source value is time-invariant (e.g., a power supply), then
491the value may optionally be preceded by the letters dc.
492.sp 0.2i
493.pp
494Acmag is the ac magnitude and acphase is the ac phase. The source is set
495to this value in the ac analysis. If acmag is omitted following the keyword
496ac, a value of unity is assumed. If acphase is omitted, a value of zero is
497assumed. If the source is not an ac small-signal input, the keyword ac and the
498ac values are omitted.
499.sp 0.2i
500.pp
501Any independent source can be assigned a time-dependent value for
502transient analysis. If a source is assigned adependent value, the time-
503time-zero value is used for dc analysis. There are five independent source
504functions: pulse, exponential, sinusoidal, piece-wise linear, and single-freque
505fm. If parameters other than source values are omitted or set to zero, the
506default values shown will be assumed. (tstep is the printing increment and
507tstop is the final time (see the .tran card for explanation)).
508.sp 0.2i
5091. Pulse pulse(v1 v2 td tr tf pw per)
510.sp 0.2i
511.b "Examples:"
512.(l
513vin 3 0 pulse(-1 1 2ns 2ns 2ns 50ns 100ns)
514.)l
515.TS
516center;
517l l l.
518parameters default values units
519.sp 0.2i
520v1 (initial value) volts or amps
521v2 (pulsed value) volts or amps
522td (delay time) 0.0 seconds
523tr (rise time) tstep seconds
524tf (fall time) tstep seconds
525pw (pulse width) tstop seconds
526per (period) tstop seconds
527.TE
528.pp
529A single pulse so specified is described by the following table:
530.sp 0.2i
531.TS
532center;
533l l.
534time value
535.sp 0.2i
5360 v1
537td v1
538td+tr v2
539td+tr+pw v2
540td+tr+pw+tf v1
541tstop v1
542.TE
543.sp 0.1i
544Intermediate points are determined by linear interpolation.
545.sp 0.1i
5462. Sinusoidal sin(vo va freq td theta)
547.sp 0.2i
548.b "Examples:"
549.(l
550vin 3 0 sin(0 1 100meg 1ns 1e10)
551.)l
552.sp 0.2i
553.TS
554center;
555l l l.
556parameters default value units
557.sp 0.2i
558vo (offset) volts or amps
559va (amplitude) volts or amps
560freq (frequency) 1/tstop hz
561td (delay) 0.0 seconds
562theta (damping factor) 0.0 1/seconds
563.TE
564.pp
565The shape of the waveform is described by the following table:
566.TS
567center;
568l l.
569.sp 0.2i
570time value
571.sp 0.2i
5720 to td vo
573td to tstop vo + va*exp(-(time-td)*theta)*sine(twopi*freq*(time-td))
574.TE
575.sp 0.2i
576.bp
5773. Exponential exp(v1 v2 td1 tau1 td2 tau2)
578.sp 0.2i
579.b "Examples:"
580.(l
581vin 3 0 exp(-4 -1 2ns 30ns 60ns 40ns)
582.)l
583.sp 0.2i
584.TS
585center;
586l l.
587parameters default values units
588.sp 0.2i
589v1 (initial value) volts or amps
590v2 (pulsed value) volts or amps
591td1 (rise delay time) 0.0 seconds
592tau1 (rise time constant) tstep seconds
593td2 (fall delay time) td1+tstep seconds
594tau2 (fall time constant) tstep seconds
595.TE
596.pp
597The shape of the waveform is described by the following table:
598.sp 0.2i
599.TS
600center;
601l l.
602time value
603.sp 0.2i
6040 to td1 v1
605td1 to td2 v1+(v2-v1)*(1-exp(-(time-td1)/tau1))
606td2 to tstop v1+(v2-v1)*(1-exp(-(time-td1)/tau1))
607 +(v1-v2)*(1-exp(-(time-td2)/tau2))
608.TE
609.sp 0.2i
6104. Piece-wise linear
611.sp 0.2i
612 pwl(t1 v1 <t2 v2 t3 v3 t4 v4 ...>)
613.sp 0.2i
614.b "Examples:"
615.(l
616vclock 7 5 pwl(0 -7 10ns -7 11ns -3 17ns -3 18ns -7 50ns -7)
617.)l
618.sp 0.2i
619.TS
620center;
621l l.
622parameters default values
623.TE
624.(l
625Each pair of values (ti, vi) specifies that the value of the source is vi
626(in volts or amps) at time=ti. The value of the source at intermediate values
627of time is determined by using linear interpolation on the input values.
628.)l
629.sp 0.2i
630.bp
6315. Single-frequency fm
632.sp 0.2i
633 sffm(vo va fc mdi fs)
634.sp 0.2i
635.b "Examples:"
636.(l
637v1 12 0 sffm(0 1m 20k 5 1k)
638.)l
639.sp 0.2i
640.TS
641center;
642l l l.
643parameters default values units
644.sp 0.2i
645vo (offset) volts or amps
646va (amplitude) volts or amps
647fc (carrier frequency) 1/tstop hz
648mdi (modulation index)
649fs (signal frequency) 1/tstop hz
650.TE
651.pp
652The shape of the waveform is described by the following equation:
653.(l
654value = vo + va*sine((twopi*fc*time) + mdi*sine(twopi*fs*time))
655.)l
656.bp
657.sh 1 "SEMICONDUCTOR DEVICES"
658.pp
659The elements that have been described to this point typically require only
660a few parameter values to specify completely the electrical characteristics of
661the element. However, the models for the four semiconductor devices that are
662included in the spice program require many parameter values. Moreover, many
663devices in a circuit often are defined by the same set of device model
664parameters. For these reasons, a set of device model parameters is defined on a
665separate .model card and assigned a unique model name. The device element
666cards in spice then reference the model name. This scheme alleviates the need
667to specify all of the model parameters on each device element card.
668.pp
669Each device element card contains the device name, the nodes to which the
670device is connected, and the device model name. In addition, two optional
671parameters may be specified for each device: an area factor, and an initial
672condition.
673.pp
674The area factor determines the number of equivalent parallel devices of a
675specified model. The affected parameters are marked with an asterisk under the
676heading 'area' in the model descriptions below.
677.pp
678Two different forms of initial conditions may be specified for devices.
679The first form is included to improve the dc convergence for circuits that
680contain more than one stable state. If a device is specified off, the dc
681operating point is determined with the terminal voltages for that device set to
682zero. After convergence is obtained, the program continues to iterate to
683obtain the exact value for the terminal voltages. If a circuit has more than
684one dc stable state, the off option can be used to force the solution to
685correspond to a desired state. If a device is specified off when in reality
686the device is conducting, the program will still obtain the correct solution
687(assuming the solutions converge) but more iterations will be required since
688the program must independently converge to two separate solutions.
689The .nodeset card serves a similar purpose as the 'off' option. The .nodeset
690option is easier to apply and is the preferred means to aid convergence.
691.pp
692The second form of initial conditions are specified for use with
693the transient analysis. These are true 'initial conditions' as opposed
694to the convergence aids above. See the description of the .ic card and
695the .tran card for a detailed explanation of initial conditions.
696.sh 2 "junction diodes"
697.sp 0.2i
698.b "General form:"
699.(l
700dxxxxxxx n+ n- mname <area> <off> <ic=vd>
701.)l
702.sp 0.2i
703.b "Examples:"
704.(l
705dbridge 2 10 diode1
706dclmp 3 7 dmod 3.0 ic=0.2
707.)l
708.pp
709N+ and n- are the positive and negative nodes, respectively. Mname is the
710model name, area is the area factor, and off indicates an (optional) starting
711condition on the device for dc analysis. If the area factor is omitted, a
712value of 1.0 is assumed. The (optional) initial condition specification using
713ic=vd is intended for use with the uic option on the .tran card, when a
714transient analysis is desired starting from other than the quiescent operating
715point.
716.sp 0.2i
717.sh 2 "bipolar junction transistors (bjt's)"
718.sp 0.2i
719.b "General form:"
720.(l
721qxxxxxxx nc nb ne <ns> mname <area> <off> <ic=vbe,vce>
722.)l
723.sp 0.2i
724.b "Examples:"
725.(l
726q23 10 24 13 qmod ic=0.6,5.0
727q50a 11 26 4 20 mod1
728.)l
729.pp
730Nc, nb, and ne are the collector, base, and emitter nodes, respectively.
731Ns is the (optional) substrate node. If unspecified, ground is used.
732mname is the model name, area is the area factor, and off indicates an
733(optional) initial condition on the device for the dc analysis. If the area
734factor is omitted, a value of 1.0 is assumed. The (optional) initial condition
735specification using ic=vbe,vce is intended for use with the uic option on
736the .tran card, when a transient analysis is desired starting from other than th
737quiescent operating point. See the '.ic' card description for a better way to
738set transient initial conditions.
739.sp 0.2i
740.sh 2 "junction field-effect transistors (jfet's)"
741.sp 0.2i
742.b "General form:"
743.(l
744jxxxxxxx nd ng ns mname <area> <off> <ic=vds,vgs>
745.)l
746.sp 0.2i
747.b "Examples:"
748.(l
749j1 7 2 3 jm1 off
750.)l
751.pp
752Nd, ng, and ns are the drain, gate, and source nodes, respectively. Mname
753is the model name, area is the area factor, and off indicates an (optional)
754initial condition on the device for dc analysis. If the area factor is
755omitted, a value of 1.0 is assumed. The (optional) initial condition specification,
756using ic=vds,vgs is intended for use with the uic option on the .tran card,
757when a transient analysis is desired starting from other than the quiescent
758operating point (see the .ic card for a better way to set initial conditions).
759.sp 0.2i
760.sh 2 "mosfets"
761.sp 0.2i
762.b "General form:"
763.(l
764mxxxxxxx nd ng ns nb mname <l=val> <w=val> <ad=val> <as=val>
765+ <rd=val> <rs=val> <off> <ic=vds,vgs,vbs>
766.)l
767.sp 0.2i
768.b "Examples:"
769.(l
770m1 24 2 0 20 type1
771m31 2 17 6 10 modm l=5u w=2u
772m31 2 16 6 10 modm 5u 2u
773m1 2 9 3 0 mod1 l=10u w=5u ad=2p as=2p
774m1 2 9 3 0 mod1 10u 5u 2p 2p
775.)l
776Nd, ng, ns, and nb are the drain, gate, source, and bulk (substrate)
777nodes, respectively. Mname is the model name. L and w are the channel length
778and width, in meters. Ad and as are the areas of the drain and source
779diffusions, in sq-meters. Note that the suffix 'u' specifies microns (10**-6 m)
780and 'p' sq-microns (10**-12 sq-m). If any of l, w, ad, or as are not specified,
781default values are used. The user may specify the values to be used for
782these default parameters on the .option card. The use of defaults simplifies
783input deck preparation, as well as the editing required if devices geometries
784are to be changed. Off indicates an (optional) initial condition
785on the device for dc analysis. The (optional) initial condition
786specification using ic=vds,vgs,vbs is intended for use with the uic option
787on the .tran card, when a transient analysis is desired starting from other
788than the quiescent operating point. See the .ic card for a better and
789more convenient way to specify transient initial conditions.
790.bp
791.sp 0.2i
792.sh 2 ".model card"
793.sp 0.2i
794.b "General form:"
795.(l
796 .model mname type(pname1=pval1 pname2=pval2 ... )
797.)l
798.sp 0.2i
799.b "Examples:"
800.(l
801 .model mod1 npn bf=50 js=1e-13 vbf=50
802.)l
803.pp
804The .model card specifies a set of model parameters that will be used by
805one or more devices. Mname is the model name, and type is one of the following
806seven types:
807.TS
808center;
809l l.
810npn npn bjt model
811pnp pnp bjt model
812d diode model
813njf n-channel jfet model
814pjf p-channel jfet model
815nmos n-channel mosfet model
816pmos p-channel mosfet model
817.TE
818.pp
819Parameter values are defined by appending the parameter name, as given
820below for each model type, followed by an equal sign and the parameter value.
821Model parameters that are not given a value are assigned the default values
822given below for each model type.
823.sp 0.2i
824.sh 2 "diode model"
825.pp
826The dc characteristics of the diode are determined by the parameters is
827and n. An ohmic resistance, rs, is included. Charge storage effects are
828modeled by a transit time, tt, and a nonlinear depletion layer capacitance
829which is determined by the parameters cjo, pb, and m. The temperature
830dependence of the saturation current is defined by the parameters eg, the energy
831and pt, the saturation current temperature exponent. Reverse breakdown is
832modeled by an exponential increase in the reverse diode current and is
833determined by the parameters bv and ibv (both of which are positive numbers).
834.sp 0.2i
835.TS
836center;
837l l l l l l.
838 area name parameter default example
839.sp 0.2i
840 1 * is saturation current 1.0e-14 1.0e-14
841 2 * rs ohmic resistance 0 10
842 3 n emission coefficient 1 1.0
843 4 tt transit-time 0 0.1ns
844 5 * cjo zero-bias junction capacitance 0 2pf
845 6 pb junction potential 1 0.6
846 7 m grading coefficient 0.5 0.5
847 8 eg activation energy 1.11 1.11 si
848 0.69 sbd
849 0.67 ge
850 9 pt saturation-current temp. exp 3.0 3.0 jn
851 2.0 sbd
85210 kf flicker noise coefficient 0
85311 af flicker noise exponent 1
85412 fc coefficient for forward-bias 0.5
855 depletion capacitance formula
85613 bv reverse breakdown voltage infinite 40.0
85714 ibv current at breakdown voltage 1.0e-3
858.TE
859.sh 2 "bjt models (both npn and pnp)"
860.pp
861The bipolar junction transistor model in spice is an adaptation of
862the integral charge control model of Gummel and Poon. This modified
863Gummel-Poon model extends the original model to include several effects
864at high bias levels. The model will automatically simplify to the simpler
865Ebers-Moll model when certain parameters are not specified. To permit
866one to use model parameters from earlier versions of spice, many
867of the model parameters can be called by two names. The parameter names
868used in the modified Gummel-Poon model have been chosen to be more easily
869understood by the program user, and to better reflect both physical and
870circuit design thinking. The dc model is defined by the parameters bf,
871jbf, jle, and nle which determine the forward current gain characteristics,
872br, jbr, jlc, and nlc which determine the reverse current gain characteristics,
873vbf and vbr, which determine the output conductance for forward and reverse
874regions, and the saturation current, js. Three ohmic resistances rb, rc, and
875re are included, where rb can be high current dependent. Base charge storage
876is modeled by forward and reverse transit times, tf and tr the forward transit
877time being bias dependent if desired, and nonlinear depletion layer
878capacitances which are determined by cje, vje, and mje for the b-e junction and
879cjc, vjc, and mjc for the b-c junction. A depletion formulation is used for
880the substrate capacitance described by cjs, vjs, and mjs. The temperature
881dependence of saturation current, js, is determined by the energy-gap, eg,
882and the saturation current temperature exponent, pt. Base current temperature
883dependence is modeled by the temperature exponent for beta, tb.
884.sp 0.2i
885.TS
886center;
887l l l l.
888name parameter units default
889.sp 0.2i
890js transport saturation current amps 1.0e-16
891bf ideal maximum forward beta amp/amp 100
892nf forward current emission coefficient - 1.0
893vbf forward early voltage volts infinite
894jbf corner for forward beta high current roll-off amps infinite
895jle base-emitter leakage saturation current amps 0
896nle base-emitter leakage emission coefficient - 1.5
897br ideal maximum reverse beta amp/amp 1.0
898nr reverse current emission coefficient - 1.0
899vbr reverse early voltage volts infinite
900jbr corner for reverse beta high current roll-off amps infinite
901jlc base-collector leakage saturation current amps 0
902nlc base-collector leakage emission coefficient - 2.0
903rb zero bias base resistance ohms 0
904jrb current where base resistance falls halfway to amps infinite
905 its minimum value
906rbm minimum base resistance at high currents ohms rb
907re emitter resistance ohms 0
908rc collector resistance ohms 0
909cje base-emitter zero bias depletion capacitance farads 0
910vje base-emitter built-in potential volts .75
911mje base-emitter junction exponential factor - .33
912tf ideal forward transit time sec 0
913xtf coefficient for bias dependence of tf - 0
914vtf voltage describing vbc dependence of tf volts infinite
915jtf high-current parameter for effect on tf amps 0
916ptf excess phase at freq=1.0/(tf*2pi) hz degrees 0
917cjc base-collector zero bias depletion capacitance farads 0
918vjc base-collector built-in potential volts .75
919mjc base-collector junction exponential factor - .33
920cdis fraction of base-collector depletion - 1.0
921 capacitance connected to internal base node
922tr ideal reverse transit time sec 0
923cjs zero bias substrate capacitance farads 0
924vjs substrate junction built-in potential volts .75
925mjs substrate junction exponential factor - 0
926tb forward and reverse beta temperature exponent - 0
927eg energy-gap for temperature effect on js ev 1.11
928pt temperature exponent for effect on js - 3
929kf flicker-noise coefficient - 0
930af flicker-noise exponent - 1
931fc coefficient for forward-bias depletion - .5
932 capacitance formula
933.TE
934.sp 0.2i
935.sh 2 "jfet models (both n and p channel)"
936.sp 0.2i
937.pp
938The jfet model is derived from the fet model of Shichman and Hodges. The
939dc characteristics are defined by the parameters vto and beta, which determine
940the variation of drain current with gate voltage, lambda, which determines the
941output conductance, and is, the saturation current of the two gate junctions.
942Two ohmic resistances, rd and rs, are included. Charge storage is modeled by
943nonlinear depletion layer capacitances for both gate junctions which vary as
944the -1/2 power of junction voltage and are defined by the parameters cgs, cgd,
945and pb.
946.sp 0.2i
947.TS
948center;
949l l l l l l.
950 area name parameter default example
951.sp 0.2i
952 1 vto threshold voltage -2.0 -2.0
953 2 * beta transconductance parameter 1.0e-4 1.0e-3
954 3 lambda channel length modulation parameter 0 1.0e-4
955 4 * rd drain ohmic resistance 0 100
956 5 * rs source ohmic resistance 0 100
957 6 * cgs zero-bias g-s junction capacitance 0 5pf
958 7 * cgd zero-bias g-d junction capacitance 0 1pf
959 8 pb gate junction potential 1 0.6
960 9 * is gate junction saturation current 1.0e-14 1.0e-14
96110 kf flicker noise coefficient 0
96211 af flicker noise exponent 1
96312 fc coefficient for forward-bias 0.5
964 depletion capacitance formula
965.TE
966.sp 0.2i
967.sh 2 "mosfet models (both n and p channel)"
968.sp 0.2i
969The dc mosfet equations
970are determined by the parameters vto, kp, gamma, lambda, and phi. These
971parameters may be specified by the user, or they will be computed from
972values specified for nsub, tox, nss, nfs, ngate, tps, uo, ucrit, uexp, and
973utra. Vto is positive (negative) for enhancement mode and negative
974(posiive) for depletion mode n-channel (p-channel) devices. Charge storage is
975modeled by three constant capacitors, cgs, cgd, and cgb, by the nonlinear oxide
976gate capacitance which is distributed among the gate-source, gate-drain, and
977bulk regions using the formulation of J.E. Meyer, and by the nonlinear
978depletion-layer capacitances for both substrate junctions which vary as the -1/2
979power of junction voltage and are determined by the parameters cbd, cbs, and
980pb.
981.sp 0.2i
982.TS
983center;
984l l l l l l.
985 name parameter default example units
986.sp 0.2i
9871 vto zero-bias threshold voltage 0.0 1.0 v
9882 kp intrinsic transconductance parameter 2.417e-5 3.1e-5 a/v**2
9893 gamma bulk threshold parameter 0.0 0.37 v**(1/2)
9904 phi surface potential at strong inversion 0.6 0.65 v
9915 lambda channel-length modulation parameter 0.0 1.0e-7 meters/v
9926 rd drain ohmic resistance 0.0 1.0 ohms
9937 rs source ohmic resistance 0.0 1.0 ohms
9948 cgs gate-source overlap capacitance
995 per meter channel width 0.0 4.0e-11 f/m
9969 cgd gate-drain overlap capacitance
997 per meter channel width 0.0 4.0e-11 f/m
99810 cgb gate-bulk overlap capacitance
999 per meter channel length 0.0 2.0e-10 f/m
100011 cbd zero-bias b-d junction capacitance
1001 per sq-meter of junction area 0.0 2.0e-4 f/sq-m
100212 cbs zero-bias b-s junction capacitance
1003 per sq-meter of junction area 0.0 2.0e-4 f/sq-m
100413 tox oxide thickness 1.0e-7 1.0e-7 meters
100514 pb bulk junction potential 0.8 0.87 v
100615 js bulk junction reverse saturation current
1007 per sq-meter of junction area 1.0e-4 1.0e-4 a/sq-m
100816 nsub substrate doping 0.0 4.0e15 /cm**3
100917 nss surface state density 0.0 1.0e10 /cm**2
101018 nfs fast surface state density 0.0 1.0e10 /cm**2
101119 xj metallurgical junction depth 0.0 1.0e-6 meters
101220 ld lateral diffusion (channel length is 0.0 0.8e-6 meters
1013 reduced such that leff=l-2*ld)
101421 wd width reduction (channel width is 0.0 1.0e-6 meters
1015 reduced such that weff=w-2*wd)
101622 ngate polysilicon gate doping al gate 1.0e20 /cm**3
101723 tps type of polysilicon: +1 opp to sub 1.0
1018 -1 same as sub
101924 uo surface mobility 700 600 cm**2/v-s
102025 ucrit critical field for mobility 1.0e+4 1.0e+4 v/cm
102126 uexp critical field exponent (mobility) 0.0 0.1
102227 utra transverse field coefficient (mobility) 0.0 0.3
102328 kf flicker noise coefficient 0.0
102429 af flicker noise exponent 1.0
102530 fc coefficient for forward-bias 0.5
1026 depletion capacitance formula
1027.TE
1028.bp
1029.sh 1 "SUBCIRCUITS"
1030.pp
1031A subcircuit that consists of spice elements can be defined and referenced
1032in a fashion similar to device models. The subcircuit is defined in the input
1033deck by a grouping of element cards; the program then automatically inserts
1034the group of elements wherever the subcircuit is referenced. There is no limit
1035on the size or complexity of subcircuits, and subcircuits may contain other
1036subcircuits. An example of subcircuit usage is given in Appendix A.
1037.sp 0.2i
1038.sh 2 ".subckt card"
1039.sp 0.2i
1040.b "General form:"
1041.(l
1042 .subckt subnam n1 <n2 n3 ...>
1043.)l
1044.b "Examples:"
1045.(l
1046 .subckt opamp 1 2 3 4
1047.)l
1048.pp
1049A subcircuit definition is begun with a .subckt card. Subnam is the
1050subcircuit name, and n1, n2, ... Are the external nodes, which cannot be zero.
1051The group of element cards which immediately follow the .subckt card define the
1052subcircuit. The last card in a subcircuit definition is the .ends card (see
1053below). Control cards may not appear within a subcircuit definition; however,
1054subcircuit definitions may contain anything else, including other subcircuit
1055definitions, device models, and subcircuit calls (see below). Note that any
1056device models or subcircuit definitions included as part of a subcircuit
1057definition are strictly local (i.e., such models and definitions are not known
1058outside the subcircuit definition). Also, any element nodes not included on
1059the .subckt card are strictly local, with the exception of 0 (ground) which is
1060always global.
1061.sh 2 ".ends card"
1062.sp 0.2i
1063.b "General form:"
1064.(l
1065 .ends <subnam>
1066.)l
1067.b "Examples:"
1068.(l
1069 .ends opamp
1070.)l
1071.pp
1072This card must be the last one for any subcircuit definition. The sub-
1073circuit name, if included, indicates which subcircuit definition is being
1074terminated; if omitted, all subcircuits being defined are terminated. The
1075name is needed only when nested subcircuit definitions are being made.
1076.sp 0.2i
1077.sh 2 "subcircuit calls"
1078.sp 0.2i
1079.b "General form:"
1080.(l
1081xyyyyyyy n1 <n2 n3 ...> subnam
1082.)l
1083.sp 0.2i
1084.b "Examples:"
1085.(l
1086x1 2 4 17 3 1 multi
1087.)l
1088.pp
1089Subcircuits are used in spice by specifying pseudo-elements beginning with
1090the letter x, followed by the circuit nodes to be used in expanding the sub-
1091circuit.
1092.bp
1093.sh 1 "CONTROL CARDS"
1094.sp 0.2i
1095.sh 2 ".temp card"
1096.sp 0.2i
1097.b "General form:"
1098.(l
1099 .temp t1 <t2 <t3 ...>>
1100.)l
1101.b "Examples:"
1102.(l
1103 .temp -55.0 25.0 125.0
1104.)l
1105.pp
1106This card specifies the temperatures at which the circuit is to be
1107simulated. T1, t2, ... Are the different temperatures, in degrees c. Temperatu
1108less than -223.0 deg c are ignored. Model data is specified at tnom degrees
1109(see the .option card for tnom); if the .temp card is omitted, the simulation
1110also will be performed at a temperature equal to tnom.
1111.sp 0.2i
1112.sh 2 ".width card"
1113.sp 0.2i
1114.b "General form:"
1115.(l
1116 .width in=colnum out=colnum
1117.)l
1118.sp 0.2i
1119.b "Examples:"
1120.(l
1121 .width in=72 out=133
1122.)l
1123.pp
1124Colnum is the last column read from each line of input; the setting takes
1125effect with the next line read. The default value for colnum is 80.
1126The out parameter specifies the output print width. Permissible values for
1127the output print width are 80 and 133.
1128.sp 0.2i
1129.sh 2 ".options card"
1130.sp 0.2i
1131.b "General form:"
1132.(l
1133 .options opt1 opt2 ... (or opt=optval ...)
1134.)l
1135.b "Examples:"
1136.(l
1137 .options noacct nolist nonode
1138.)l
1139.pp
1140This card allows the user to reset program control and user options for
1141specific simulation purposes. Any combination of the following options may be
1142included, in any order. 'x' (below) represents some positive number.
1143.TS
1144center;
1145l l.
1146option effect
1147.sp 0.2i
1148noacct supresses the listing of accounting and run time
1149 statistics.
1150nolist supresses the summary listing of input data.
1151nomod suppresses the printout of the model parameters.
1152nopage suppresses page ejects
1153nonode supresses the printing of the node table.
1154opts causes the option values to be printed.
1155gmin=x resets the value of gmin, the minimum conductance
1156 allowed by the program. The default value is 1.0e-12.
1157reltol=x resets the relative error tolerance of the program. The
1158 default value is 0.001 (0.1 percent).
1159abstol=x resets the absolute current error tolerance of the
1160 program. The default value is 1 picoamp.
1161vntol=x resets the absolute voltage error tolerance of the
1162 program. The default value is 1 microvolt.
1163trtol=x resets the transient error tolerance. The default value
1164 is 7.0. This parameter is an estimate of the factor by
1165 which spice overestimates the actual truncation error.
1166chgtol=x resets the charge tolerance of the program. The default
1167 value is 1.0e-14.
1168numdgt=x resets the number of significant digits printed for
1169 output variable values. X must satisfy the relation
1170 0 < x < 8. The default value is 4. Note: this option is
1171 independent of the error tolerance used by spice (i.e., if
1172 the values of options reltol, abstol, etc. Are not changed
1173 then one may be printing numerical 'noise' for numdgt > 4.
1174tnom=x resets the nominal temperature. The default value is
1175 25 deg c (298 deg k).
1176itl1=x resets the dc iteration limit. The default is 100.
1177itl2=x resets the dc transfer curve iteration limit. The
1178 default is 50.
1179itl3=x resets the lower transient analysis iteration limit.
1180 the default value is 4.
1181itl4=x resets the transient analysis timepoint iteration limit.
1182 the default is 10.
1183itl5=x resets the transient analysis total iteration limit.
1184 the default is 5000. Set itl5=0 to omit this test.
1185cptime=x the maximum cpu-time in seconds allowed for this job.
1186limtim=x resets the amount of cpu time reserved by spice for
1187 generating plots should a cpu time-limit cause job
1188 termination. The default value is 2 (seconds).
1189limpts=x resets the total number of points that can be printed
1190 or plotted in a dc, ac, or transient analysis. The
1191 default value is 201.
1192lvlcod=x if x is 2 (two), then machine code for the matrix
1193 solution will be generated. Otherwise, no machine code is
1194 generated. The default value is 2. Applies only to cdc
1195 computers.
1196lvltim=x if x is 1 (one), the iteration timestep control is used.
1197 if x is 2 (two), the truncation-error timestep is used.
1198 the default value is 1. If method=Gear and maxord>2 then
1199 lvltim is set to 2 by spice.
1200method=name sets the numerical integration method used by spice.
1201 Possible names are Gear or trapezoidal. The default is
1202 trapezoidal.
1203maxord=x sets the maximum order for the integration method if
1204 Gear's variable-order method is used. X must be between
1205 2 and 6. The default value is 2.
1206defl=x sets the default value for mos channel length.
1207defw=x sets the default value for mos channel width.
1208defad=x sets the default value for mos drain diffusion area.
1209defas=x sets the default value for mos source diffusion area.
1210.TE
1211.sp 0.2i
1212.sh 2 ".op card"
1213.sp 0.2i
1214.b "General form:"
1215.(l
1216 .op
1217.)l
1218.sp 0.2i
1219.pp
1220The inclusion of this card in an input deck will force spice to determine
1221the dc operating point of the circuit with inductors shorted and capacitors
1222opened. Note: a dc analysis is automatically performed prior to a transient
1223analysis to determine the transient initial conditions, and prior to an ac
1224small-signal analysis to determine the linearized, small-signal models for
1225nonlinear devices.
1226.pp
1227Spice performs a dc operating point analysis if no other analyses are
1228requested.
1229.sp 0.2i
1230.sh 2 ".dc card"
1231.sp 0.2i
1232.b "General form:"
1233.(l
1234 .dc srcnam vstart vstop vincr [src2 start2 stop2 incr2]
1235.)l
1236.sp 0.2i
1237.b "Examples:"
1238.(l
1239 .dc vin 0.25 5.0 0.25
1240 .dc vds 0 10 .5 vgs 0 5 1
1241 .dc vce 0 10 .25 ib 0 10u 1u
1242.)l
1243.pp
1244This card defines the dc transfer curve source and sweep limits. Srcnam
1245is the name of an independent voltage or current source. Vstart, vstop, and
1246vincr are the starting, final, and incrementing values respectively. The first
1247example will cause the value of the voltage source vin to be swept from 0.25
1248volts to 5.0 volts in increments of 0.25 volts. A second source (src2) may
1249optionally be specified with associated sweep parameters. In this case,
1250the first source will be swept over its range for each value of the second
1251source. This option can be useful for obtaining semiconductor device output
1252characteristics. See the second example data deck in that section of the guide.
1253.sp 0.2i
1254.bp
1255.sh 2 ".nodeset card"
1256.sp 0.2i
1257.b "General form:"
1258.(l
1259 .nodeset v(nodnum)=val v(nodnum)=val ...
1260.)l
1261.b "Examples:"
1262.(l
1263 .nodeset v(12)=4.5 v(4)=2.23
1264.)l
1265.pp
1266This card helps the program find the dc solution by making a preliminary
1267pass with the specified nodes held to the given voltages. The restriction
1268is then released and the iteration continues to the true solution.
1269The .nodeset card may be necessary for convergence on bistable or astable
1270circuits. In general, this card should not be necessary.
1271.sp 0.2i
1272.sh 2 ".ic card"
1273.sp 0.2i
1274.b "General form:"
1275.(l
1276 .ic v(nodnum)=val v(nodnum)=val ...
1277.)l
1278.b "Examples:"
1279.(l
1280 .ic v(11)=5 v(4)=-5 v(2)=2.2
1281.)l
1282.pp
1283This card is for setting transient initial conditions. It has two
1284different interpretations, depending on whether the 'uic' parameter is
1285specified on the '.tran' card. Also, one should not confuse this card with
1286the '.nodeset' card. The '.nodeset' card is only to help dc convergence,
1287and does not affect final bias solution (except for multi-stable circuits).
1288The two interpretations of this card are as follows:
1289.sp 0.2i
1290 1. When the 'uic' parameter is specified on the '.tran' card, then
1291.pp
1292The node voltages specified on the '.ic' card are used to compute
1293.pp
1294The capacitor, diode, bjt, jfet, and mosfet initial conditions.
1295.pp
1296This is equivalent to specifying the 'ic=...' parameter on each
1297.pp
1298Device card, but is much more convenient. The 'ic=...' parameter
1299.pp
1300Can still be specified and will take precedence over the '.ic'
1301.pp
1302Values. Since no dc bias solution is computed before the transient
1303.pp
1304Analysis, one should take care to specify all dc source voltages
1305.pp
1306On the '.ic' card if they are to be used to compute device initial
1307.pp
1308Conditions.
1309.sp 0.2i
1310 2. When the 'uic' parameter is not specified on the '.tran' card,
1311.pp
1312The a dc bias solution will be computed before the transient analysis.
1313.pp
1314In this case, the node voltages specified on the '.ic' card will
1315.pp
1316Be forced to the desired initial values during the bias solution.
1317.pp
1318During transient analysis, the constraint on these node voltages
1319is removed.
1320.sp 0.2i
1321.sh 2 ".tf card"
1322.sp 0.2i
1323.b "General form:"
1324.(l
1325 .tf outvar insrc
1326.)l
1327.b "Examples:"
1328.(l
1329 .tf v(5,3) vin
1330 .tf i(vload) vin
1331.)l
1332.pp
1333This card defines the small-signal output and input for the dc small-
1334signal analysis. Outvar is the small-signal output variable and insrc is the
1335small-signal input source. If this card is included, spice will compute the
1336dc small-signal value of the transfer function (outputinput), input
1337resistance, and output resistance. For the first example, spice would compute t
1338ratio of v(5,3) to vin, the small-signal input resistance at vin, and the
1339small-signal output resistance measured across nodes 5 and 3.
1340.sp 0.2i
1341.sh 2 ".sens card"
1342.sp 0.2i
1343.b "General form:"
1344.(l
1345 .sens ov1 <ov2 ... >
1346.)l
1347.b "Examples:"
1348.(l
1349 .sens v(9) v(4,3) v(17) i(vcc)
1350.)l
1351.pp
1352If a .sens card is included in the input deck, spice will determine the
1353dc small-signal sensitivities of each specified output variable with respect to
1354every circuit parameter. Note: for large circuits, large amounts of output
1355can be generated.
1356.sp 0.2i
1357.sh 2 ".ac card"
1358.sp 0.2i
1359.b "General form:"
1360.(l
1361 .ac dec nd fstart fstop
1362 .ac oct no fstart fstop
1363 .ac lin np fstart fstop
1364.)l
1365.b "Examples:"
1366.(l
1367 .ac dec 10 1 10k
1368 .ac dec 10 1k 100meg
1369 .ac lin 100 1 100hz
1370.)l
1371.sp 0.2i
1372.pp
1373Dec stands for decade variation, and nd is the number of points per
1374decade. Oct stands for octave variation, and no is the number of points per
1375octave. Lin stands for linear variation, and np is the number of points.
1376Fstart is the starting frequency, and fstop is the final frequency. If this
1377card is included in the deck, spice will perform an ac analysis of the circuit
1378over the specified frequency range. Note that in order for this analysis to be
1379meaningful, at least one independent source must have been specified with an ac
1380value.
1381.sp 0.2i
1382.sh 2 ".disto card"
1383.sp 0.2i
1384.b "General form:"
1385.(l
1386 .disto rload <inter <skw2 <refpwr <spw2>>>>
1387.)l
1388.b "Examples:"
1389.(l
1390 .disto rl 2 0.95 1.0e-3 0.75
1391.)l
1392.pp
1393This card controls whether spice will compute the distortion characteristic
1394of the circuit in a small-signal mode as a part of the ac small-signal
1395sinusoidal steady-state analysis. The analysis is performed assuming that
1396one or two signal frequencies are imposed at the input; let the two frequencies
1397be f1 (the nominal analysis frequency) and f2 (=skw2*f1). The program
1398then computes the following distortion measures:
1399.sp 0.2i
1400 hd2 - the magnitude of the frequency component 2*f1 assuming that f2
1401 is not present.
1402 hd3 - the magnitude of the frequency component 3*f1 assuming that f2
1403 is not present.
1404 sim2 - the magnitude of the frequency component f1 + f2.
1405 dim2 - the magnitude of the frequency component f1 - f2.
1406 dim3 - the magnitude of the frequency component 2*f1 - f2.
1407.pp
1408Rload is the name of the output load resistor into which all distortion
1409power products are to be computed. Inter is the interval at which the summary
1410printout of the contributions of all nonlinear devices to the total distortion
1411is to be printed. If omitted or set to zero, no summary printout will be made.
1412Refpwr is the reference power level used in computing the distortion products.
1413if omitted, a value of 1 mw (that is, dbm) is used. Skw2 is the ratio of f2 to
1414f1. If omitted, a value of 0.9 is used (i.e., f2 = 0.9*f1). Spw2 is the
1415amplitude of f2. If omitted, a value of 1.0 is assumed.
1416.pp
1417The distortion measures hd2, hd3, sim2, dim2, and dim3 may also be be
1418printed and/or plotted (see the description of the .print and .plot cards).
1419.sp 0.2i
1420.sh 2 ".noise card"
1421.sp 0.2i
1422.b "General form:"
1423.(l
1424 .noise outv insrc nums
1425.)l
1426.b "Examples:"
1427.(l
1428 .noise v(5) vin 10
1429.)l
1430.pp
1431This card controls the noise analysis of the circuit. The noise analysis
1432is performed in conjunction with the ac analysis (see .ac card). Outv is an
1433output voltage which defines the summing point. Insrc is the name of the
1434independent voltage or current source which is the noise input reference. Nums
1435is the summary interval. Spice will compute the equivalent output noise at
1436the specified output as well as the equivalent input noise at the specified
1437input. In addition, the contributions of every noise generator in the circuit
1438will be printed at every nums frequency points (the summary interval). If nums
1439is zero, no summary printout will be made.
1440.pp
1441The output noise and the equivalent input noise may also be printed and/or
1442plotted (see the description of the .print and .plot cards).
1443.sp 0.2i
1444.sh 2 ".tran card"
1445.sp 0.2i
1446.b "General form:"
1447.(l
1448 .tran tstep tstop <tstart <tmax>> <uic>
1449.)l
1450.b "Examples:"
1451.(l
1452 .tran 1ns 100ns
1453 .tran 1ns 1000ns 500ns
1454 .tran 10ns 1us uic
1455.)l
1456.pp
1457Tstep is the printing or plotting increment for line-printer output.
1458For use with the post-processor, tstep is the suggested computing increment.
1459tstop is the final time, and tstart is
1460the initial time. If tstart is omitted, it is assumed to be zero. The
1461transient analysis always begins at time zero. In the interval <zero, tstart>,
1462the circuit is analyzed (to reach a steady state), but no outputs are stored.
1463In the interval <tstart, tstop>, the circuit is analyzed and outputs are
1464stored. Tmax is the maximum stepsize that spice will use (for default, the
1465program chooses either tstep or (tstop-tstart)/50.0, whichever is smaller.
1466Tmax is useful when one wishes too guarantee a computing interval which is
1467smaller than the printer increment, tstep.
1468.pp
1469Uic (use initial conditions) is an optional keyword which indicates that
1470the user does not want spice to solve for the quiescent operating point before
1471beginning the transient analysis. If this keyword is specified, spice uses the
1472values specified using ic=... On the various elements as the initial transient
1473condition and proceeds with the analysis. If the .ic card has been specified,
1474then the node voltages on the .ic card are used compute the intitial conditions
1475for the devices. Look at the description on the .ic card for its
1476interpretation when 'uic' is not specified.
1477.sp 0.2i
1478.sh 2 ".four card"
1479.sp 0.2i
1480.b "General form:"
1481.(l
1482 .four freq ov1 <ov2 ov3 ...>
1483.)l
1484.b "Examples:"
1485.(l
1486 .four 100k v(5)
1487.)l
1488.pp
1489This card controls whether spice performs a fourier analysis as a part of
1490the transient analysis. Freq is the fundamental frequency, and ov1, ..., are
1491the output variables for which the analysis is desired. The fourier analysis
1492is performed over the interval <tstop-period, tstop>, where tstop is the final
1493time specified for the transient analysis, and period is one period of the
1494fundamental frequency. The dc component and the first nine components are
1495determined. For maximum accuracy, tmax (see the .tran card) should be set to
1496period/100.0 (or less for very high-q circuits).
1497.sp 0.2i
1498.sh 2 ".print cards"
1499.sp 0.2i
1500.b "General form:"
1501.(l
1502 .print prtype ov1 <ov2 ... Ov8>
1503.)l
1504.b "Examples:"
1505.(l
1506 .print tran v(4) i(vin)
1507 .print ac vm(4,2) vr(7) vp(8,3)
1508 .print dc v(2) i(vsrc) v(23,17)
1509 .print noise inoise
1510 .print disto hd3 sim2(db)
1511.)l
1512.pp
1513This card defines the contents of a tabular listing of one to eight output
1514variables. Prtype is the type of the analysis (dc, ac, tran, noise, or
1515distortion) for which the specified outputs are desired. The form for voltage o
1516current output variables is as follows:
1517.sp 0.2i
1518.ip v(n1<,n2>) 10
1519specifies the voltage difference between nodes n1
1520and n2. If n2 (and the preceding comma) is omitted,
1521ground (0) is assumed. For the ac analysis, five
1522additional outputs can be accessed by replacing the
1523letter v by:
1524.sp 0.2i
1525vr - real part
1526vi - imaginary part
1527vm - magnitude
1528vp - phase
1529vdb - 20*log10(magnitude)
1530.sp 0.2i
1531.ip i(vxxxxxxx) 10
1532specifies the current flowing in the independent
1533voltage source named vxxxxxxx. Positive current
1534flows from the positive node, through the source, to
1535the negative node. For the ac analysis, the
1536corresponding replacements for the letter i may be
1537made in the same way as described for voltage outputs.
1538.sp 0.2i
1539.pp
1540Output variables for the noise and distortion analyses have a different
1541general form
1542form from that of the other analyses. The is
1543.(l
1544 ov<(x)>
1545.)l
1546where ov is any of onoise (output noise), inoise (equivalent input noise),
1547hd2, hd3, sim2, dim2, or dim3 (see description of distortion analysis), and x
1548may be any of:
1549.(l
1550r - real part
1551i - imaginary part
1552m - magnitude (default if nothing specified)
1553p - phase
1554db - 20*log10(magnitude)
1555.)l
1556thus, sim2 (or sim2(m)) describes the magnitude of the sim2 distortion measure,
1557while hd2(r) describes the real part of the hd2 distortion measure.
1558.pp
1559There is no limit on the number of .print cards for each type of
1560analysis.
1561.sp 0.2i
1562.sh 2 ".plot cards"
1563.sp 0.2i
1564.b "General form:"
1565.(l
1566 .plot pltype ov1 <(plo1,phi1)> <ov2 <(plo2,phi2)> ... Ov8>
1567.)l
1568.b "Examples:"
1569.(l
1570 .plot dc v(4) v(5) v(1)
1571 .plot tran v(17,5) (2,5) i(vin) v(17) (1,9)
1572 .plot ac vm(5) vm(31,24) vdb(5) vp(5)
1573 .plot disto hd2 hd3(r) sim2
1574 .plot tran v(5,3) v(4) (0,5) v(7) (0,10)
1575.)l
1576.pp
1577This card defines the contents of one plot of from one to eight output
1578variables. Pltype is the type of analysis (dc, ac, tran, noise, or distortion)
1579for which the specified outputs are desired. The syntax for the ovi is
1580identical to that for the .print card, described above.
1581.pp
1582The optional plot limits (plo,phi) may be specified after any of the
1583output variables. All output variables to the left of a pair of plot limits
1584(plo,phi) will be plotted using the same lower and upper plot bounds. If plot
1585limits are not specified, spice will automatically determine the minimum and
1586maximum values of all output variables being plotted and scale the plot to fit.
1587More than one scale will be used if the output variable values warrant (i.e.,
1588mixing output variables with values which are orders-of-magnitude different
1589still gives readable plots).
1590.pp
1591The overlap of two or more traces on any plot is indicated by the letter
1592x.
1593.pp
1594When more than one output variable appears on the same plot, the
1595first variable specified will be printed as well as plotted. If a printout
1596of all variables is desired, then a companion .print card should be included.
1597.pp
1598There is no limit on the number of .plot cards specified for each
1599type of analysis.
1600.bp
1601.sh 1 "APPENDIX A: EXAMPLE DATA DECKS"
1602.sp 0.2i
1603.sh 2 "circuit 1"
1604.pp
1605The following deck determines the dc operating point and small-signal
1606transfer function of a simple differential pair. In addition, the ac
1607small-signal response is computed over the frequency range 1hz to 100meghz.
1608.(l
1609Simple differential pair
1610Vcc 7 0 12
1611Vee 8 0 -12
1612Vin 1 0 ac 1
1613Rs1 1 2 1k
1614Rs2 6 0 1k
1615Q1 3 2 4 mod1
1616Q2 5 6 4 mod1
1617Rc1 7 3 10k
1618Rc2 7 5 10k
1619Re 4 8 10k
1620 .model mod1 npn bf=50 vbf=50 js=1.e-12 rb=100 cjc .5pf tf .6ns
1621 .tf v(5) vin
1622 .ac dec 10 1 100meg
1623 .plot ac vm(5) vp(5)
1624 .print ac vm(5) vp(5)
1625 .end
1626.)l
1627.sp 0.2i
1628.sh 2 "circuit 2"
1629.sp 0.2i
1630The following deck computes the output characteristics of a mosfet
1631device over the range 0-10v for vds and 0-5v for vgs.
1632.sp 0.2i
1633.(l
1634Mos output characteristics
1635 .option nonode nopage
1636Vds 3 0
1637Vgs 2 0
1638M1 1 2 0 0 mod1 l=4u w=6u ad=10p as=10p
1639 .model mod1 nmos vto=-2 nsub=1.0e15 uo=550
1640 * vids measures id, we could have used vds, but id would be negative
1641Vids 3 1
1642 .dc vds 0 10 .5 vgs 0 5 1
1643 .print dc i(vids) v(2)
1644 .plot dc i(vids)
1645 .end
1646.)l
1647.sp 0.2i
1648.sh 2 "circuit 3"
1649.sp 0.2i
1650.pp
1651The following deck determines the dc transfer curve and the transient
1652pulse response of a simple rtl inverter. The input is a pulse from 0 to 5
1653volts with delay, rise, and fall times of 2ns and a pulse width of 30ns. The
1654transient interval is 0 to 100ns, with printing to be done every nanosecond.
1655.sp 0.2i
1656.(l
1657Simple rtl inverter
1658Vcc 4 0 5
1659Vin 1 0 pulse 0 5 2ns 2ns 2ns 30ns
1660Rb 1 2 10k
1661Q1 3 2 0 q1
1662Rc 3 4 1k
1663 .plot dc v(3)
1664 .plot tran v(3) (0,5)
1665 .print tran v(3)
1666 .model q1 npn bf 20 rb 100 tf .1ns cjc 2pf
1667 .dc vin 0 5 0.1
1668 .tran 1ns 100ns
1669 .end
1670.)l
1671.sp 0.2i
1672.sh 2 "circuit 4"
1673.pp
1674The following deck simulates a four-bit binary adder, using several sub-
1675circuits to describe various pieces of the overall circuit.
1676.sp 0.2i
1677.(l
1678Adder - 4 bit all-nand-gate binary adder
1679.sp 0.2i
1680 *** subcircuit definitions
1681.sp 0.2i
1682.subckt nand 1 2 3 4
1683 * nodes: input(2), output, vcc
1684Q1 9 5 1 qmod
1685D1clamp 0 1 dmod
1686Q2 9 5 2 qmod
1687D2clamp 0 2 dmod
1688Rb 4 5 4k
1689R1 4 6 1.6k
1690Q3 6 9 8 qmod
1691R2 8 0 1k
1692Rc 4 7 130
1693Q4 7 6 10 qmod
1694Dvbedrop 10 3 dmod
1695Q5 3 8 0 qmod
1696 .ends nand
1697 .subckt onebit 1 2 3 4 5 6
1698 * nodes: input(2), carry-in, output, carry-out, vcc
1699X1 1 2 7 6 nand
1700X2 1 7 8 6 nand
1701X3 2 7 9 6 nand
1702X4 8 9 10 6 nand
1703X5 3 10 11 6 nand
1704X6 3 11 12 6 nand
1705X7 10 11 13 6 nand
1706X8 12 13 4 6 nand
1707X9 11 7 5 6 nand
1708 .ends onebit
1709 .subckt twobit 1 2 3 4 5 6 7 8 9
1710 * nodes: input - bit0(2) / bit1(2), output - bit0 / bit1,
1711 * carry-in, carry-out, vcc
1712X1 1 2 7 5 10 9 onebit
1713X2 3 4 10 6 8 9 onebit
1714 .ends twobit
1715 .sp 0.2i
1716 .subckt fourbit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1717 * nodes: input - bit0(2) / bit1(2) / bit2(2) / bit3(2),
1718 * output - bit0 / bit1 / bit2 / bit3, carry-in, carry-out, vcc
1719X1 1 2 3 4 9 10 13 16 15 twobit
1720X2 5 6 7 8 11 12 16 14 15 twobit
1721 .ends fourbit
1722.sp 0.2i
1723 *** define nominal circuit
1724.sp 0.2i
1725 .model dmod d
1726 .model qmod npn(bf=75 rb=100 cje=1pf cjc=3pf)
1727Vcc 99 0 dc 5v
1728Vin1a 1 0 pulse(0 3 0 10ns 10ns 10ns 50ns)
1729.sp 0.2i
1730.sp 0.2i
1731Vin1b 2 0 pulse(0 3 0 10ns 10ns 20ns 100ns)
1732Vin2a 3 0 pulse(0 3 0 10ns 10ns 40ns 200ns)
1733Vin2b 4 0 pulse(0 3 0 10ns 10ns 80ns 400ns)
1734Vin3a 5 0 pulse(0 3 0 10ns 10ns 160ns 800ns)
1735Vin3b 6 0 pulse(0 3 0 10ns 10ns 320ns 1600ns)
1736Vin4a 7 0 pulse(0 3 0 10ns 10ns 640ns 3200ns)
1737Vin4b 8 0 pulse(0 3 0 10ns 10ns 1280ns 6400ns)
1738X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 fourbit
1739Rbit0 9 0 1k
1740Rbit1 10 0 1k
1741Rbit2 11 0 1k
1742Rbit3 12 0 1k
1743Rcout 13 0 1k
1744 .plot tran v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8)
1745 .plot tran v(9) v(10) v(11) v(12) v(13)
1746 .print tran v(1) v(2) v(3) v(4) v(5) v(6) v(7) v(8)
1747 .print tran v(9) v(10) v(11) v(12) v(13)
1748.sp 0.2i
1749 .tran 1ns 6400ns
1750 *** (for those with money (and memory) to burn)
1751.sp 0.2i
1752 .opt acct list node limpts=6401
1753 .end
1754.)l
1755.sp 0.2i
1756.sh 2 "circuit 5"
1757.pp
1758The following deck simulates a transmission-line inverter. Two
1759transmission-line elements are required since two propagation modes are excited.
1760In the case of a coaxial line, the first line (t1) models the inner conductor wi
1761respect to the shield, and the second line (t2) models the shield with respect
1762to the outside world.
1763.sp 0.2i
1764.(l
1765Transmission-line inverter
1766V1 1 0 pulse(0 1 0 0.1n)
1767R1 1 2 50
1768X1 2 0 0 4 tline
1769R2 4 0 50
1770 .subckt tline 1 2 3 4
1771T1 1 2 3 4 z0=50 td=1.5ns
1772T2 2 0 4 0 z0=100 td=1ns
1773 .ends tline
1774 .tran 0.1ns 20ns
1775 .plot tran v(2) v(4)
1776 .end
1777.)l
1778.bp
1779.sh 1 "APPENDIX B: NONLINEAR DEPENDENT SOURCES"
1780.pp
1781Spice allows circuits to contain dependent sources characterized by any of
1782the four equations
1783.sp 0.2i
1784 i=f(v) v=f(v) i=f(i) v=f(i)
1785.sp 0.2i
1786where the functions must be polynomials, and the arguments may be
1787multidimensional. The polynomial functions are specified by a set of coefficien
1788p0, p1, ..., pn. Both the number of dimensions and the number of coefficients
1789are arbitrary. The meaning of the coefficients depends upon the dimension of
1790the polynomial, as shown in the following examples:
1791.pp
1792Suppose that the function is one-dimensional (that is, a function of one
1793argument). Then the function value fv is determined by the following
1794expression in fa (the function argument):
1795.sp 0.2i
1796 fv = p0 + (p1*fa) + (p2*fa**2) + (p3*fa**3) + (p4*fa**4)
1797.sp 0.2i
1798 + (p5*fa**5) + ...
1799.pp
1800Suppose now that the function is two-dimensional, with arguments fa and
1801fb. Then the function value fv is determined by the following expression:
1802.sp 0.2i
1803 fv = p0 + (p1*fa) + (p2*fb) + (p3*fa**2) + (p4*fa*fb) + (p5*fb**2)
1804.sp 0.2i
1805 + (p6*fa**3) + (p7*fa**2*fb) + (p8*fa*fb**2) + (p9*fb**3) + ...
1806.pp
1807Consider now the case of a three-dimensional polynomial function with
1808arguments fa, fb, and fc. Then the function value fv is determined by the
1809following expression:
1810.sp 0.2i
1811 fv = p0 + (p1*fa) + (p2*fb) + (p3*fc) + (p4*fa**2) + (p5*fa*fb)
1812.sp 0.2i
1813 + (p6*fa*fc) + (p7*fb**2) + (p8*fb*fc) + (p9*fc**2) + (p10*fa**3)
1814.sp 0.2i
1815 + (p11*fa**2*fb) + (p12*fa**2*fc) + (p13*fa*fb**2)
1816.sp 0.2i
1817 + (p14*fa*fb*fc)
1818.sp 0.2i
1819 + (p15*fa*fc**2) + (p16*fb**3) + (p17*fb**2*fc) + (p18*fb*fc**2)
1820.sp 0.2i
1821 + (p19*fc**3) + (p20*fa**4) + ...
1822.pp
1823Note: if the polynomial is one-dimensional and exactly one coefficient is
1824specified, then spice assumes it to be p1 (and p0 = 0.0), in order to
1825facilitate the input of linear controlled sources.
1826.pp
1827For all four of the dependent sources described below, the initial
1828condition parameter is described as optional. If not specified, spice assumes 0
1829the initial condition for dependent sources is an initial 'guess' for the value
1830of the controlling variable. The program uses this initial condition to obtain
1831the dc operating point of the circuit. After convergence has been obtained,
1832the program continues iterating to obtain the exact value for the controlling
1833variable. Hence, to reduce the computational effort for the dc operating
1834point (or if the polynomial specifies a strong nonlinearity), a value fairly
1835close to the actual controlling variable should be specified for the initial
1836condition.
1837.sh 2 "voltage-controlled current sources"
1838.sp 0.2i
1839.b "General form:"
1840.(l
1841gxxxxxxx n+ n- <poly(nd)> nc1+ nc1- ... P0 <p1 ...> <ic=...>
1842.)l
1843.sp 0.2i
1844Examples: g1 1 0 5 3 0 0.1mmho
1845 gr 17 3 17 3 0 1m 1.5m ic=2v
1846 gmlt 23 17 poly(2) 3 5 1 2 0 1m 17m 3.5u ic=2.5, 1.3
1847.pp
1848N+ and n- are the positive and negative nodes, respectively. Current flow
1849is from the positive node, through the source, to the negative node. Poly(nd)
1850only has to be specified if the source is multi-dimensional (one-dimensional is
1851the default). If specified, nd is the number of dimensions, which must be
1852positive. Nc1+, nc1-, ... Are the positive and negative controlling nodes,
1853respectively. One pair of nodes must be specified for each dimension. P0, p1,
1854p2, ..., pn are the polynomial coefficients. The (optional) initial condition
1855is the initial guess at the value(s) of the controlling voltage(s). If not
1856specified, 0.0 is assumed. The polynomial specifies the source current as a
1857function of the controlling voltage(s). The second example above describes a
1858current source with value
1859.sp 0.2i
1860 i = 1e-3*v(17,3) + 1.5e-3*v(17,3)**2
1861.sp 0.2i
1862note that since the source nodes are the same as the controlling nodes, this
1863source actually models a nonlinear resistor.
1864.sp 0.2i
1865.sp 0.2i
1866.sp 0.2i
1867.sp 0.2i
1868.sp 0.2i
1869.sh 2 "voltage-controlled voltage sources"
1870.sp 0.2i
1871.b "General form:"
1872.(l
1873exxxxxxx n+ n- <poly(nd)> nc1+ nc1- ... P0 <p1 ...> <ic=...>
1874.)l
1875.sp 0.2i
1876Examples: e1 3 4 21 17 10.5 2.1 1.75
1877 ex 17 0 poly(3) 13 0 15 0 17 0 0 1 1 1 ic=1.5,2.0,17.35
1878.pp
1879N+ and n- are the positive and negative nodes, respectively. Poly(nd)
1880only has to be specified if the source is multi-dimensional (one-dimensional is
1881the default). If specified, nd is the number of dimensions, which must be
1882positive. Nc1+, nc1-, ... Are the positive and negative controlling nodes,
1883respectively. One pair of nodes must be specified for each dimension. P0, p1,
1884p2, ..., pn are the polynomial coefficients. The (optional) initial condition
1885is the initial guess at the value(s) of the controlling voltage(s). If not
1886specified, 0.0 is assumed. The polynomial specifies the source voltage as a
1887function of the controlling voltage(s). The second example above describes a
1888voltage source with value
1889.sp 0.2i
1890 v = v(13,0) + v(15,0) + v(17,0)
1891.sp 0.2i
1892(in other words, an ideal voltage summer).
1893.sh 2 "current-controlled current sources"
1894.sp 0.2i
1895.b "General form:"
1896.(l
1897fxxxxxxx n+ n- <poly(nd)> vn1 <vn2 ...> p0 <p1 ...> <ic=...>
1898.)l
1899.sp 0.2i
1900Examples: f1 12 10 vcc 1ma 1.3m
1901 fxfer 13 20 vsens 0 1
1902.pp
1903N+ and n- are the positive and negative nodes, respectively. Current flow
1904is from the positive node, through the source, to the negative node. Poly(nd)
1905only has to be specified if the source is multi-dimensional (one-dimensional is
1906the default). If specified, nd is the number of dimensions, which must be
1907positive. Vn1, vn2, ... Are the names of voltage sources through which the
1908controlling current flows; one name must be specified for each dimension. The
1909direction of positive controlling current flow is from the positive node,
1910through the source, to the negative node of each voltage source. P0, p1,
1911p2, ..., pn are the polynomial coefficients. The (optional) initial condition
1912is the initial guess at the value(s) of the controlling current(s) (in amps).
1913If not specified, 0.0 is assumed. The polynomial specifies the source current
1914as a function of the controlling current(s). The first example above describes
1915a current source with value
1916.sp 0.2i
1917 i = 1e-3 + 1.3e-3*i(vcc)
1918.sp 0.2i
1919.sp 0.2i
1920.sp 0.2i
1921.sp 0.2i
1922.sp 0.2i
1923.sh 2 "current-controlled voltage sources"
1924.sp 0.2i
1925.b "General form:"
1926.(l
1927hxxxxxxx n+ n- <poly(nd)> vn1 <vn2 ...> p0 <p1 ...> <ic=...>
1928.)l
1929.sp 0.2i
1930Examples: hxy 13 20 poly(2) vin1 vin2 0 0 0 0 1 ic=0.5 1.3
1931 hr 4 17 vx 0 0 1
1932.pp
1933N+ and n- are the positive and negative nodes, respectively. Poly(nd)
1934only has to be specified if the source is multi-dimensional (one-dimensional is
1935the default). If specified, nd is the number of dimensions, which must be
1936positive. Vn1, vn2, ... Are the names of voltage sources through which the
1937controlling current flows; one name must be specified for each dimension. The
1938direction of positive controlling current flow is from the positive node,
1939through the source, to the negative node of each voltage source. P0, p1,
1940p2, ..., pn are the polynomial coefficients. The (optional) initial condition
1941is the initial guess at the value(s) of the controlling current(s) (in amps).
1942If not specified, 0.0 is assumed. The polynomial specifies the source voltage
1943as a function of the controlling current(s). The first example above describes
1944a voltage source with value
1945.sp 0.2i
1946 v = i(vin1)*i(vin2)