瀏覽代碼

added d-latch-try

Martin Thoma 12 年之前
父節點
當前提交
1e096fcac6
共有 3 個文件被更改,包括 73 次插入0 次删除
  1. 17 0
      circuits/Readme.md
  2. 31 0
      circuits/d-latch-with-nand/Makefile
  3. 25 0
      circuits/d-latch-with-nand/d-latch-with-nand.tex

+ 17 - 0
circuits/Readme.md

@@ -0,0 +1,17 @@
+Circuits
+========
+circuitikz
+----------
+Here are some examples how to use `circuitikz`
+
+See also:
+ * [Manual](http://ftp.gwdg.de/pub/ctan/graphics/pgf/contrib/circuitikz/circuitikzmanual.pdf)
+ * [tex.stackexchange.com](http://tex.stackexchange.com/questions/tagged/circuitikz)
+
+TikZ circuit library
+--------------------
+I have read about TikZ circuit library, but I didn't find any examples / manuals.
+If you have some, please let me know.
+
+See also:
+ * [tex.stackexchange.com](http://tex.stackexchange.com/questions/tagged/tikz-circuit-lib)

+ 31 - 0
circuits/d-latch-with-nand/Makefile

@@ -0,0 +1,31 @@
+SOURCE = d-latch-with-nand
+DELAY = 80
+DENSITY = 300
+WIDTH = 500
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+svg:
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg

+ 25 - 0
circuits/d-latch-with-nand/d-latch-with-nand.tex

@@ -0,0 +1,25 @@
+\documentclass{article}
+\usepackage[pdftex,active,tightpage]{preview}
+\setlength\PreviewBorder{0mm}
+
+\usepackage{circuitikz}
+\usepackage{tikz}
+\usetikzlibrary{positioning}
+
+\begin{document}
+\begin{preview}
+  \begin{circuitikz}
+    \draw (0,2) node[european nand port] (mynand1){};
+    \draw (0,0) node[european nand port] (mynand2){};
+    \draw (2.5,1.73) node[european nand port] (mynand3){};
+    \draw (2.5,0.28) node[european nand port] (mynand4){};
+
+    \draw (mynand1.in 1) node[ocirc,label=left:$D$]{};
+    \draw (mynand2.in 2) node[circ] (lowerConnection) {};
+    \draw (-2.3,-0.27) node[ocirc,label=left:$E$] (E) {};
+    \draw (E) -- (lowerConnection);
+    \draw (mynand1.out) -- (mynand3.in 1);
+    \draw (mynand2.out) -- (mynand4.in 2);
+  \end{circuitikz}
+\end{preview}
+\end{document}