Docsity

Using Sources and Stimuli Final Exam - Lecture Notes | ECE 323, Exams of Electronics

Toggle sidebar
bg1
hspice.book : hspice.ch05 1 Thu Jul 23 19:10:43 1998
Star-Hspice Manual, Release 1998.2 5-1
Chapter 5
Using Sources and Stimuli
This chapter describes element and model statements for independent sources,
dependent sources, analog-to-digital elements, and digital-to-analog elements. It
also provides explanations of each type of element and model statement. Explicit
formulas and examples show how various combinations of parameters affect the
simulation.
The chapter covers the following topics:
■Independent Source Elements
■Star-Hspice Independent Source Functions
■Voltage and Current Controlled Elements
■Voltage Dependent Current Sources — G Elements
■Current Dependent Current Sources — F Elements
■Voltage Dependent Voltage Sources — E Elements
■Dependent Voltage Sources — H Elements
■Digital Files and Mixed Mode — U Elements
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a

Partial preview of the text

Download Using Sources and Stimuli Final Exam - Lecture Notes | ECE 323 and more Exams Electronics in PDF only on Docsity!

Star-Hspice Manual, Release 1998.2 5-

Chapter 5

Using Sources and Stimuli

This chapter describes element and model statements for independent sources, dependent sources, analog-to-digital elements, and digital-to-analog elements. It also provides explanations of each type of element and model statement. Explicit formulas and examples show how various combinations of parameters affect the simulation. The chapter covers the following topics: n Independent Source Elements n Star-Hspice Independent Source Functions n Voltage and Current Controlled Elements n Voltage Dependent Current Sources — G Elements n Current Dependent Current Sources — F Elements n Voltage Dependent Voltage Sources — E Elements n Dependent Voltage Sources — H Elements n Digital Files and Mixed Mode — U Elements

Independent Source Elements Using Sources and Stimuli

5-2 Star-Hspice Manual, Release 1998.

Independent Source Elements

Use source element statements to specify either DC, AC, transient, or mixed independent voltage and current sources. Some types of analysis use the associated analysis sources. For example, in a DC analysis, if both DC and AC sources are specified in one independent source element statement, the AC source is taken out of the circuit for the DC analysis. If an independent source is specified for an AC, transient, and DC analysis, transient sources are removed for the AC analysis and DC sources are removed after the performance of the operating point. Initial transient value always overrides the DC value.

Source Element Conventions

Voltage sources need not be grounded. Positive current is assumed to flow from the positive node through the source to the negative node. A positive current source forces current to flow out of the N+ node through the source and into the N- node. You can use parameters as values in independent sources. Do not identify these parameters using any of the following keywords: AC ACI AM DC EXP PE PL PU PULSE PWL R RD SFFM SIN

Independent Source Element Statements

Syntax Vxxx n+ n- <<DC=> dcval> <AC=acmag, > or Iyyy n+ n- <<DC=> dcval> <AC=acmag, > <M=val> where: Vxxx independent voltage source element name. Must begin with a “V”, which can be followed by up to 1023 alphanumeric characters.

Independent Source Elements Using Sources and Stimuli

5-4 Star-Hspice Manual, Release 1998.

DC Sources For a DC source, you can specify the DC current or voltage in different ways: V1 1 0 DC=5V V1 1 0 5V I1 1 0 DC=5mA I1 1 0 5mA The first two examples specify a DC voltage source of 5 V connected between node 1 and ground. The third and fourth examples specify a 5 mA DC current source between node 1 and ground. The direction of current is from node 1 to ground.

AC Sources AC current and voltage sources are impulse functions used for an AC analysis. Specify the magnitude and phase of the impulse with the AC keyword. V1 1 0 AC=10V, VIN 1 0 AC 10V 90 The above two examples specify an AC voltage source with a magnitude of 10 V and a phase of 90 degrees. Specify the frequency sweep range of the AC analysis in the .AC analysis statement. The AC or frequency domain analysis provides the impulse response of the circuit.

Transient Sources For transient analysis, you can specify the source as a function of time. The functions available are pulse, exponential, damped sinusoidal, single frequency FM, and piecewise linear function.

Using Sources and Stimuli Independent Source Elements

Star-Hspice Manual, Release 1998.2 5-

Mixed Sources Mixed sources specify source values for more than one type of analysis. For example, you can specify a DC source specified together with an AC source and transient source, all of which are connected to the same nodes. In this case, when specific analyses are run, Star-Hspice selects the appropriate DC, AC, or transient source. The exception is the zero-time value of a transient source, which overrides the DC value, and is selected for operating-point calculation for all analyses. VIN 13 2 0.5 AC 1 SIN (0 1 1MEG) The above example specifies a DC source of 0.5 V, an AC source of 1 V, and a transient damped sinusoidal source, each of which are connected between nodes 13 and 2. For DC analysis, the program uses zero source value since the sinusoidal source is zero at time zero.

Using Sources and Stimuli Star-Hspice Independent Source Functions

Star-Hspice Manual, Release 1998.2 5-

v1 initial value of the voltage or current, before the pulse onset v2 pulse plateau value td delay time in seconds from the beginning of transient interval to the first onset ramp (default=0.0 and for td < 0.0, td=0.0 is used as well) tr duration of the onset ramp, from the initial value to the pulse plateau value (reverse transit time) (default=TSTEP) tf duration of the recovery ramp, from the pulse plateau back to the initial value (forward transit time) (default=TSTEP) pw pulse width (the width of the pulse plateau portion of the pulse) (default=TSTEP) per pulse repetition period in seconds (default=TSTEP, the transient timestep)

Example 1 VIN 3 0 PULSE (-1 1 2NS 2NS 2NS 50NS 100NS) V1 99 0 PU lv hv tdlay tris tfall tpw tper The first example specifies a pulse source connected between node 3 and node

  1. The pulse has an output high voltage of 1 V, an output low voltage of -1 V, a delay of 2 ns, a rise and fall time of 2 ns, a high pulse width of 50 ns, and a period of 100 ns. The second example specifies pulse value parameters in the .PARAM statement. Single pulse Time Value 0 v td v td + tr v td + tr + pw v td + tr + pw + tf v tstop v Intermediate points are determined by linear interpolation.

Star-Hspice Independent Source Functions Using Sources and Stimuli

5-8 Star-Hspice Manual, Release 1998.

Note: TSTEP is the printing increment, and TSTOP is the final time.

Example 2 file pulse.sp test of pulse .option post .tran .5ns 75ns vpulse 1 0 pulse( v1 v2 td tr tf pw per ) r1 1 0 1 .param v1=1v v2=2v td=5ns tr=5ns tf=5ns pw=20ns

  • per=50ns .end

Figure 5-1: Pulse Source Function

Star-Hspice Independent Source Functions Using Sources and Stimuli

5-10 Star-Hspice Manual, Release 1998.

Time Value

0 to td

td to tstop

TSTOP is the final time; see the .TRAN statement for a detailed explanation.

Figure 5-2: Sinusoidal Source Function

Example *File: SIN.SP THE SINUSOIDAL WAVEFORM *

vo va SIN 2 ⋅ Π ⋅ϕ 360

+ ⋅ ^ 

vo + va ⋅ Exp [ – ( Time – td ) ⋅ θ] ⋅

SIN^2 Π^ freq^ ⋅^ ( time^^ – td )

ϕ 360

Using Sources and Stimuli Star-Hspice Independent Source Functions

Star-Hspice Manual, Release 1998.2 5-

.OPTIONS POST

.PARAM V0=0 VA=1 FREQ=100MEG DELAY=2N THETA=5E

+ PHASE=

V 1 0 SIN (V0 VA FREQ DELAY THETA PHASE)

R 1 0 1

.TRAN .05N 50N

.END

Exponential Source Function

Syntax EXP <(>v1 v2 <td1 <τ1 <td2 <τ2>>>> <)> where: v1 initial value of voltage or current in volts or amps v2 pulsed value of voltage or current in volts or amps td1 rise delay time in seconds (default=0.0) td2 fall delay time in seconds (default=td1+TSTEP) τ 1 rise time constant in seconds (default=TSTEP) τ 2 fall time constant in seconds (default=TSTEP)

Example VIN 3 0 EXP (-4 -1 2NS 30NS 60NS 40NS) The above example describes an exponential transient source that is connected between nodes 3 and 0. It has an initial t=0 voltage of -4 V and a final voltage of -1 V. The waveform rises exponentially from -4 V to -1 V with a time constant of 30 ns. At 60 ns it starts dropping to -4 V again, with a time constant of 40 ns. TSTEP is the printing increment, and TSTOP is the final time. Waveform shape Time Value

Using Sources and Stimuli Star-Hspice Independent Source Functions

Star-Hspice Manual, Release 1998.2 5-

V 1 0 EXP (V1 V2 TD1 TAU1 TD2 TAU2)

R 1 0 1

.TRAN .05N 200N

.END

Piecewise Linear Source Function

Syntax PWL <(>t1 v1 <t2 v2 t3 v3…> <R <=repeat>> <TD=delay> <)> MSINC and ASPEC PL <(>v1 t1 <v2 t2 v3 t3…> <R <=repeat>> <TD=delay> <)> where v1 … specifies current or voltage values t1 … specifies segment time values R causes the function to repeat repeat specifies the start point of the waveform which is to be repeated TD is keyword for time delay before piecewise actually starts delay specifies the length of time to delay the piecewise linear function Each pair of values (t1, v1) specifies that the value of the source is v1 (in volts) at time t1. The value of the source at intermediate values of time is determined by linear interpolation between the time points. ASPEC style formats are accommodated by the “PL” form of the function, which reverses the order of the time-voltage pairs to voltage-time pairs. Star-Hspice uses the DC value of the source as the time-zero source value if no time-zero point is given. Also, Star- Hspice does not force the source to terminate at the TSTOP value specified in the .TRAN statement.

Star-Hspice Independent Source Functions Using Sources and Stimuli

5-14 Star-Hspice Manual, Release 1998.

Specify “R” to cause the function to repeat. You can specify a value after this “R” to indicate the beginning of the function to be repeated: the repeat time must equal a breakpoint in the function. For example, if t1 = 1, t2 = 2, t3 = 3, and t4 = 4, “repeat” can be equal to 1, 2, or 3. Specify TD=val to cause a delay at the beginning of the function. You can use TD with or without the repeat function.

Example *FILE: PWL.SP THE REPEATED PIECEWISE LINEAR SOURCE *ILLUSTRATION OF THE USE OF THE REPEAT FUNCTION “R” .file pwl.sp REPEATED PIECEWISE LINEAR SOURCE .OPTION POST .TRAN 5N 500N V1 1 0 PWL 60N 0V, 120N 0V, 130N 5V, 170N 5V, 180N 0V, R 0N R1 1 0 1 V2 2 0 PL 0V 60N, 0V 120N, 5V 130N, 5V 170N, 0V 180N, R 60N R2 2 0 1 .END

Star-Hspice Independent Source Functions Using Sources and Stimuli

5-16 Star-Hspice Manual, Release 1998.

.TRAN DATA=datanam where TIME parameter for a time value provided in a .DATA statement PV parameter for an amplitude value provided in a .DATA statement You must use this source with a .DATA statement that contains time-value pairs. For each t n -v n (time-value) pair given in the .DATA block, the data driven PWL function outputs a current or voltage of the given t n duration and with the given v n amplitude. This source allows you to use the results of one simulation as an input source in another simulation. The transient analysis must be data driven.

Example *DATA DRIVEN PIECEWISE LINEAR SOURCE V1 1 0 PWL(TIME, pv1) R1 1 0 1 V2 2 0 PWL(TIME, pv2) R2 2 0 1 .DATA dsrc TIME pv1pv 0 5v 0v 5n 0v 5v 10n 0v 5v .ENDDATA .TRAN DATA=dsrc .END

Using Sources and Stimuli Star-Hspice Independent Source Functions

Star-Hspice Manual, Release 1998.2 5-

Single-Frequency FM Source Function

Syntax SFFM <(> vo va <fc <mdi >> <)> where vo output voltage or current offset, in volts or amps va output voltage or current amplitude, in volts or amps fc carrier frequency in Hz (default=1/TSTOP) mdi modulation index (default=0.0) fs signal frequency in Hz (default=1/TSTOP) Waveform shape

Note: TSTOP is discussed in the .TRAN statement description.

Example *FILE: SFFM.SP THE SINGLE FREQUENCY FM MODULATION .OPTIONS POST V 1 0 SFFM (0, 1M, 20K. 10, 5K) R 1 0 1 .TRAN .0005M .5MS .END

sourcevalue vo va SIN ( 2 ⋅ π ⋅ fc ⋅ Time ) mdi ⋅ SIN ( 2 ⋅ π ⋅ fs ⋅ Time )

[ +

]

Using Sources and Stimuli Star-Hspice Independent Source Functions

Star-Hspice Manual, Release 1998.2 5-

Example .OPTION POST .TRAN .01M 20M V1 1 0 AM(10 1 100 1K 1M) R1 1 0 1 V2 2 0 AM(2.5 4 100 1K 1M) R2 2 0 1 V3 3 0 AM(10 1 1K 100 1M) R3 3 0 1 .END

Figure 5-6: Amplitude Modulation Plot

sourcevalue = sa ⋅ { oc + SIN [ 2 ⋅ π ⋅ fm ⋅( Time – td )]}⋅

SIN [ 2 ⋅ π ⋅ fc ⋅( Time – td )]

Voltage and Current Controlled Elements Using Sources and Stimuli

5-20 Star-Hspice Manual, Release 1998.

Voltage and Current Controlled Elements

Star-Hspice has four voltage and current controlled elements, known as E, F, G and H elements. You can use these controlled elements in Star-Hspice to model both MOS and bipolar transistors, tunnel diodes, SCRs, as well as analog functions such as operational amplifiers, summers, comparators, voltage controlled oscillators, modulators, and switched capacitor circuits. The controlled elements are either linear or nonlinear functions of controlling node voltages or branch currents, depending on whether you use the polynomial or piecewise linear functions. Each controlled element has different functions: n The E element is a voltage and/or current controlled voltage source, an ideal op-amp, an ideal transformer, an ideal delay element, or a piecewise linear voltage controlled multi-input AND, NAND, OR, and NOR gate. n The F element is a current controlled current source, an ideal delay element, or a piecewise linear current controlled multi-input AND, NAND, OR, and NOR gate. n The G element is a voltage and/or current controlled current source, a voltage controlled resistor, a piecewise linear voltage controlled capacitor, an ideal delay element, or a piecewise linear multi-input AND, NAND, OR, and NOR gate. n The H element is a current controlled voltage source, an ideal delay element, or a piecewise linear current controlled multi-input AND, NAND, OR, and NOR gate. The following sections discuss the polynomial and piecewise linear functions and describe element statements for linear or nonlinear functions.

Polynomial Functions

The controlled element statement allows the definition of the controlled output variable (current, resistance, or voltage) as a polynomial function of one or more voltages or branch currents. You can select three polynomial equations through the POLY(NDIM) parameter.