diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-01 03:03:23 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-01 03:03:23 +0000 |
commit | a378d2379e220fa1022ae052bcd1aed6bf0d2c41 (patch) | |
tree | ea7474d9b63bd7343446152da818a0f51b4b4f26 /graphics/circuit_macros/examples/Alogix.m4 | |
parent | 63f5147c70933ab652aa5c700beabb6685d1139a (diff) |
CTAN sync 202306010303
Diffstat (limited to 'graphics/circuit_macros/examples/Alogix.m4')
-rw-r--r-- | graphics/circuit_macros/examples/Alogix.m4 | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/graphics/circuit_macros/examples/Alogix.m4 b/graphics/circuit_macros/examples/Alogix.m4 index 1bafd90681..fd586869b7 100644 --- a/graphics/circuit_macros/examples/Alogix.m4 +++ b/graphics/circuit_macros/examples/Alogix.m4 @@ -28,28 +28,26 @@ B: Autologix(Or(And(B,Not(C)),And(Not(A),B,C)),N) \ "{\sf\small\sl B.In5}" at B.In5+(0,-1.5bp__) rjust # 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. Make sure its inputs are on the left -# and named In1, In2, ... and the output Out -# is on the right. -define(`SR_gate',`[ +# in _gate. Put its inputs named In1, In2, ... +# on the left and the output Out on the right. +define(`SR_gate',`[ v = 2*L_unit S: NOR_gate - R: NOR_gate at S+(0,-L_unit*(AND_ht+4)) - w = (S.Out.x-R.In1.x)/3 - v = 2*L_unit - line right_ dimen_/2 from S.Out + line right_ 4*L_unit from S.Out Out: Here - TR: R.In1-(v,0) - line from S.Out+(v,0) down w*3/2 then left S.Out.x-TR.x+v down w \ - then to TR then to R.In1 - TS: S.In2-(v,0); - line from R.Out right v then up w*3/2 then left R.Out.x-TS.x+v up w \ - then to TS then to S.In2 + R: NOR_gate at S+(0,-10*L_unit) + TS: S.In2-(v,0) + TR: (TS,R.In1) + dot(at S.Out+(v,0)) + line down v*3/2 then to TR+(0,v) then to TR then to R.In1 + line from R.Out right v then up v*3/2 then to TS+(0,-v) \ + then to TS then to S.In2 In1: S.In1 In2: R.In2 ]') # Now define the function by which the circuit -# will be invoked: +# will be invoked using the built-in _AutoGate: define(`SRff',`_AutoGate(SR,$@)') # You are done. Here is an example: |