Skip to content

Instantly share code, notes, and snippets.

@Siddhant
Created February 9, 2015 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Siddhant/15177b466f14fc79d24b to your computer and use it in GitHub Desktop.
Save Siddhant/15177b466f14fc79d24b to your computer and use it in GitHub Desktop.
wrong plots
.title AND gate simulation
A1 [1 2] 3 and
.model and d_and(rise_delay=0.1ps fall_delay=0.2ps)
* now test it
Asource [1 2] d_source_model
.model d_source_model d_source(input_file="2bit_input_for_and") ;note that only lowercase file names are allowed
.tran 1ns 60ns
* ngspice needs at least one "regular" circuit node while this code has only "xspice" nodes.
* To work around this issue we add a dummy resistor:
Runused Nunused 0 1k
* t n n
* i o o
* m d d
* e e e
* 1 2
0ns Uu Uu
1ns 0s 0s
10ns 0s 1s
20ns 0s 0s
30ns 1s 1s
40ns 0s 1s
50ns 0s 0s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment