summaryrefslogtreecommitdiffstatshomepage
path: root/nl_examples/cdelay.c
diff options
context:
space:
mode:
Diffstat (limited to 'nl_examples/cdelay.c')
-rw-r--r--nl_examples/cdelay.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/nl_examples/cdelay.c b/nl_examples/cdelay.c
new file mode 100644
index 00000000000..9a6bdcc1aff
--- /dev/null
+++ b/nl_examples/cdelay.c
@@ -0,0 +1,31 @@
+/*
+ * cdelay.c
+ *
+ */
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(7400_astable)
+
+ /*
+ * delay circuit
+ *
+ */
+
+ /* Standard stuff */
+
+ SOLVER(Solver, 48000)
+ PARAM(Solver.ACCURACY, 1e-20)
+ CLOCK(clk, 5000)
+
+ TTL_7400_NAND(n1,clk,clk)
+ CAP(C, 1e-9)
+ NET_C(n1.Q, C.2)
+ NET_C(GND, C.1)
+ TTL_7400_NAND(n2,n1.Q, n1.Q)
+
+ LOG(logclk, clk)
+ LOG(logn1Q, C.2)
+ LOG(logn2Q, n2.Q)
+
+NETLIST_END()