summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/doc/SRffMan.m4
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-06-01 03:03:23 +0000
committerNorbert Preining <norbert@preining.info>2023-06-01 03:03:23 +0000
commita378d2379e220fa1022ae052bcd1aed6bf0d2c41 (patch)
treeea7474d9b63bd7343446152da818a0f51b4b4f26 /graphics/circuit_macros/doc/SRffMan.m4
parent63f5147c70933ab652aa5c700beabb6685d1139a (diff)
CTAN sync 202306010303
Diffstat (limited to 'graphics/circuit_macros/doc/SRffMan.m4')
-rw-r--r--graphics/circuit_macros/doc/SRffMan.m439
1 files changed, 39 insertions, 0 deletions
diff --git a/graphics/circuit_macros/doc/SRffMan.m4 b/graphics/circuit_macros/doc/SRffMan.m4
new file mode 100644
index 0000000000..1c3a95e5bb
--- /dev/null
+++ b/graphics/circuit_macros/doc/SRffMan.m4
@@ -0,0 +1,39 @@
+.PS
+# `SRffMan.m4'
+log_init
+
+# Here is how to include an arbitrary circuit
+# (an SR-flipflop, for example)
+# that is not one of the standard gates.
+# First, define the circuit with a name ending
+# in _gate. Put its inputs named In1, In2, ...
+# on the left and the output Out on the right.
+define(`SR_gate',`[ u = 2*L_unit
+ S: NOR_gate
+ line right_ 2*u from S.Out
+ Out: Here
+ R: NOR_gate at S+(0,-5*u)
+ TS: S.In2-(u,0)
+ TR: (TS,R.In1)
+ dot(at S.Out+(u,0))
+ line down u*3/2 then to TR+(0,u) then to TR then to R.In1
+ line from R.Out right u then up u*3/2 then to TS+(0,-u) \
+ then to TS then to S.In2
+ In1: S.In1
+ In2: R.In2 ]')
+# Now define the function by which the circuit
+# will be invoked using the built-in _AutoGate:
+define(`SRff',`_AutoGate(SR,$@)')
+
+# You are done. Here is an example:
+G: [
+ F: Autologix(SRff(And(x,y),Nand(x,y)),LRV)
+
+ "$x$" at F.Inx rjust
+ "$y$" at F.Iny rjust
+ "\sl Out" at F.Out ljust
+ ]
+ `"{\tt Autologix(SRff(And(x,y),Nand(x,y)),LRV)}"' wid 253pt__ ht 7pt__ \
+ with .w at last [].sw+(0,-10pt__)
+
+.PE