summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-05 22:33:48 +0000
committerKarl Berry <karl@freefriends.org>2019-09-05 22:33:48 +0000
commite25c6ee4ea5169bf31ab28ebddcc94c8b4992453 (patch)
tree855a21705c8e75ed71066d3e6215752d04dd43ba /Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4
parent1047c66359c02d8f8852e0dbdd69f5cf1cd1a76b (diff)
circuit-macros (all except boxdims.sty in doc due to generic file names)
git-svn-id: svn://tug.org/texlive/trunk@52035 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4')
-rw-r--r--Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4 b/Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4
new file mode 100644
index 00000000000..f6686bf139e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/circuit-macros/examples/Decoder.m4
@@ -0,0 +1,24 @@
+.PS
+# Decoder.m4
+log_init
+
+ define(`nlines',3) # OK for nlines from 1 to approximately 4
+
+ define(`ndata',`eval(2**nlines-1)')
+ for_(0,nlines-1,1,
+ `{right_; A`'m4x: dot(at rsvec_(0,m4x*AND_ht))
+ "$A_{m4x}$" at last [].w rjust}')
+
+ for_(0,ndata,1,
+ `define(`m4y',m4x) down_
+ G`'m4y: AND_gate(nlines) \
+ at A0+svec_(AND_ht*3/2,(m4y+1/2)*AND_ht*3/2)
+ line down linewid/3; dot; "$\;D_{m4y}$" at last [].s below
+ for_(0,nlines-1,1,
+ `ifelse(eval(m4y/2**m4x%2),0,
+ `up_; NOT_circle with .s at',`move to') G`'m4y.In`'eval(nlines-m4x)
+ line to (Here,A`'m4x) ifelse(m4y,ndata,`then to A`'m4x',`; dot')
+ ')
+ ')
+
+.PE