Documente Academic
Documente Profesional
Documente Cultură
PHY2028 SimSheet-01
Getting Started with Spice
Reminder
Performing simulations of circuits should be approached in the same systematic manner as the laboratory
exercises. In particular, all relevant information should be recorded in 'notebooks' at the time the exercises are
undertaken. These 'notebooks' may be electronic (e.g. PDF or Word documents) or paper-based. Source les
must be included (include print-outs or copy-and-paste), and a disk copy kept. Work must be turned-in (use
BART for paper or ELE upload for electronic submission) for marking by Monday 1430hrs and will normally
be marked and returned at the next class. Use the University ELE Server to submit e-notebooks and monitor
your marks.
Homework
Read the Quickstart Tutorial for Spice 3 and answer the following questions in your notes:
1. In a Spice source le:
a. Why is it not possible to specify a component on the rst line?
b. What is the purpose of a line starting with a '*' character?
c. How would you represent a 10Mohm resistor, shown on a circuit diagram as R6 connecting nodes
3 and 7?
d. What is the meaning of the line: L18 4 8 5.0E-3 ic=1m ?
2. Briey describe the current and voltage polarity conventions used by Spice.
3. There are no 'ammeter' components in Spice, so what is the recommended way to get it to determine the
current owing through a branch?
4. What command will cause Spice to calculate the quiescent state of a circuit?
5. Explain why you would expect to nd at least one line starting .subckt in the source le used to
analyse a circuit comprising three identical op-amps.
Practical Session
We will be using the MacSpice 35f 2.10 on multiuser Mac OS X machines. MacSpice is compatible with, and a
descendant of, Berkeley Spice 3f5. The original Spice built-in help command is rather primitive. The same
information (and more!) is available in the MacSpice User's Guide.
Locate MacSpice in the /Applications folder, drag its icon into your Dock. The rst time you launch MacSpice
it will create a working directory inside your Documents folder and will assume that any lename which does
not specify an absolute path refers to les in this folder. Locate TextWrangler in the /Applications folder.
Double-click its icon to start the application. If this is the rst time you have opened TextWrangler, the user
manual and registration window will open and, if so, close them.
Observe how MacSpice interacts with TextWrangler, the 'helper application', when you save changes and close
the editor's document window.
Milestone 2
Draw and label the circuit (13.2) corresponding to the source le CW121004-03.CIR. Note: Spice 3 allows non-
numeric names for devices and nodes, except in the case of ground which is always '0'.
Milestone 3
Using what you have learned above, create your own Spice source le for circuit 13.3. Hence calculate the
power dissipated by the 1K resistor and the voltage at the output. Explain why the calculated power associated
with one of the voltage sources is negative.
Milestone 4
Circuit 13.4 is a cube with each side a 10K resistor. Use Spice to calculate the resistance between the diagonal
corners (A and B) of the cube. [Hint: connect one corner to ground, and the other to a voltage source.]
Milestone 5