23.01.2015 Views

Download - Wolfram Research

Download - Wolfram Research

Download - Wolfram Research

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

66 2. Tutorial<br />

B<br />

C<br />

E<br />

RB<br />

gm*VBE<br />

E<br />

Figure 3.4: Transistor model with voltage-controlled current source<br />

Although the global subcircuit database still contains a definition of NPNTransistor/ACsimple we<br />

can safely use the same name and selector for a local subcircuit without changing the global definition,<br />

provided we specify Scope −> Local. Upon subcircuit expansion, Analog Insydes first looks<br />

for a local subcircuit with the requested name and selector. The global definition is retrieved only if<br />

no matching local definition is present.<br />

In[24]:= darlWithLocalModel =<br />

Circuit[<br />

Netlist[<br />

{I1, {0, 1}, 1},<br />

{Q1, {1 −> "B", 2 −> "C", 3 −> "E"},<br />

Model −> NPNTransistor, Selector −> ACsimple},<br />

{Q2, {3 −> "B", 2 −> "C", 0 −> "E"},<br />

Model −> NPNTransistor, Selector −> ACsimple},<br />

{Load, {0, 2}, Type −> Resistor, Value −> RL,<br />

Pattern −> Impedance}<br />

],<br />

Model[<br />

Name −> NPNTransistor,<br />

Selector −> ACsimple,<br />

Scope −> Local,<br />

Ports −> {"B", "C", "E"},<br />

Parameters −> {RB, gm},<br />

Definition −><br />

Netlist[<br />

{RB, {"B", "E"}, RB},<br />

{VC, {"B", "E", "C", "E"}, gm}<br />

]<br />

]<br />

];<br />

Now, ExpandSubcircuits will use the local definition of NPNTransistor/ACsimple. The global<br />

definition has not been altered, as we can see by expanding the netlist of the Darlington amplifier<br />

from Section 2.3.5 (see Figure 3.3) without models again.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!