From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 macros/latex/contrib/eltex/eltex7.tex | 139 ++++++++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)
 create mode 100644 macros/latex/contrib/eltex/eltex7.tex

(limited to 'macros/latex/contrib/eltex/eltex7.tex')

diff --git a/macros/latex/contrib/eltex/eltex7.tex b/macros/latex/contrib/eltex/eltex7.tex
new file mode 100644
index 0000000000..d311940d5c
--- /dev/null
+++ b/macros/latex/contrib/eltex/eltex7.tex
@@ -0,0 +1,139 @@
+%%%%%%%%%%%%basic logical circuits%%%%%%%%%%
+%%%AND (NAND)
+\newcommand{\andnand}[3]{
+\put(0,0){\framebox(10,15){}}
+   \ifnum#1=2
+\multiput(0,5)(0,5){2}{\line(-1,0){5}}  % 2 inputs
+   \else \ifnum#1=3
+\multiput(0,2.5)(0,5){3}{\line(-1,0){5}} % 3 inputs
+   \fi  \fi
+    \ifnum#2=0
+\put(4,10){\&}                % normal
+\ifx#3I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#3N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else  \ifnum#2=1
+\put(3,10){\&$\triangleright$} % power
+\ifx#3I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#3N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else \ifnum#2=2
+\put(4,10){\&}               %normal open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#3I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#3N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \else \ifnum#2=3
+\put(3,10){\&$\triangleright$}   %power open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#3I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#3N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \fi \fi \fi \fi
+}
+%%%%%%OR (NOR)
+\newcommand{\ornor}[3]{
+\put(0,0){\framebox(10,15){}}
+   \ifnum#1=2
+\multiput(0,5)(0,5){2}{\line(-1,0){5}}  % 2 inputs
+   \else \ifnum#1=3
+\multiput(0,2.5)(0,5){3}{\line(-1,0){5}} % 3 inputs
+   \fi  \fi
+    \ifnum#2=0
+\put(4,10){$1$}                % normal
+\ifx#3I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#3N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else  \ifnum#2=1
+\put(3,10){$1\triangleright$} % power
+\ifx#3I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#3N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else \ifnum#2=2
+\put(4,10){$1$}               %normal open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#3I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#3N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \else \ifnum#2=3
+\put(3,10){$1\triangleright$}   %power open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#3I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#3N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \fi \fi \fi \fi
+
+}
+%%%inverter
+\newcommand{\invert}[2]{
+\put(0,0){\framebox(10,15){}}
+\put(0,7.5){\line(-1,0){5}}  % 1 input
+    \ifnum#1=0
+\put(4,10){$1$}                % normal
+\ifx#2I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#2N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else  \ifnum#1=1
+\put(3,10){$1\triangleright$} % power
+\ifx#2I
+\put(10.75,7.5){\circle{1.5}} %inverted output
+\put(11.5,7.5){\line(1,0){3}}
+      \else  \ifx#2N
+\put(10,7.5){\line(1,0){5}}    %noninverted output
+      \fi \fi
+     \else \ifnum#1=2
+\put(4,10){$1$}               %normal open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#2I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#2N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \else \ifnum#1=3
+\put(3,10){$1\triangleright$}   %power open collector
+\put(5,5){$\diamondsuit$}
+\put(5.5,4.5){\line(1,0){2}}
+\ifx#2I
+     \put(10.75,4.5){\circle{1.5}} %inverted output
+     \put(11.5,4.5){\line(1,0){3}}
+           \else \ifx#2N
+      \put(10,4.5){\line(1,0){5}}    %noninverted output
+           \fi \fi
+     \fi \fi \fi \fi
+}
+
+
+\endinput
-- 
cgit v1.2.3

