3.3 Inverter Schematic and Simulation in Xscheme
This section introduces an example how to make an inverter’s schematic and simulate it.
1. Create an Inverter Schematic in Xscheme
This requires two transistors, PMOS and NMOS.
-
M1: sg13_lv_pmos
-
M2: sg13_lv_nmos
-
V1, V2: vsource.sym
The overview schematic of an inverter is illustrated as follows.
2. Create the Power Supply and Input Signal
With the above schematic, change the voltage source as follows.
-
Change
V1
intoVIN
withvalue=0
-
Change
V2
intoVDD
withvalue=1.2
The final schematic is shown as follows.
3. Add the Lab Pins
-
Create the lab pins for the input signal
vin
and the output signalvout
by using thelab_pin.sym
-
Similarly, create a lab pin for the power supply
vdd
4. Setup the Library
- Use
cornerMOSlv.lib
andmos_tt
section and insert acode_shown.sym
into the schematic and modify its properties as follows.
.lib cornerMOSlv.lib mos_tt
5. Setup the Simulation
We need to sweep the VGS
and VDS
from 0
to 1.2V
.
- Insert a
code_shown.sym
and change its name intoSTIMULI
and its properties as follows.
.param temp=27
.control
save all
op
dc VIN 0 1.2 0.01
.endc
6. Generate Netlist and Run the Simulation
-
Click on
Netlist
button to generate the netlist -
Click on
Simulation
»Edit Netlist
to view the netlist -
Click on
Simulate
button to start the simulation
7. Plot the Waveform
- Plot the voltage of
vin
andvout
by running the following command inngspice
shell:
plot vin vout
8. Modify the Circuit for Transient Simulation
-
Based on the schematic from the previous section, delete
VIN
symbol (select it, then pressdelete
key) -
Insert
vsource_arithm.sym
and connect the wires, respectively.
- Change
E1
source’s properties as follows.
9. Change the Simulation Type
- Change the simulation type from
DC
totransient
by editing theSTIMULI
as follows.
10. Generate Netlist again and Run the Simulation
-
Click on
Netlist
button to generate the netlist -
Click on
Simulation
»Edit Netlist
to view the netlist -
Click on
Simulate
button to start the simulation
11. Plot the Waveform
- Plot the voltage of
vin
andvout
by typing the following command inngspice
shell.
plot vin vout