Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/dpv/DecoderDPV.m4

raw
1 .PS
2 # Decoder.m4
3 log_init(svg_font(sans-serif,11bp__))
4
5 define(`nlines',3) # OK for nlines from 1 to approximately 4
6
7 define(`ndata',`eval(2**nlines-1)')
8 for_(0,nlines-1,1,
9 `{right_; A`'m4x: dot(at rsvec_(0,m4x*AND_ht))
10 "svg_it(A`'svg_sub(m4x))" wid 0.2 at last [].w rjust}')
11
12 for_(0,ndata,1,
13 `define(`m4y',m4x) down_
14 G`'m4y: AND_gate(nlines) \
15 at A0+svec_(AND_ht*3/2,(m4y+1/2)*AND_ht*3/2)
16 line down linewid/3; dot; "svg_it(D`'svg_sub(m4y))" at last [].s below
17 for_(0,nlines-1,1,
18 `ifelse(eval(m4y/2**m4x%2),0,
19 `up_; NOT_circle with .s at',`move to') G`'m4y.In`'eval(nlines-m4x)
20 line to (Here,A`'m4x) ifelse(m4y,ndata,`then to A`'m4x',`; dot')
21 ')
22 ')
23
24 command "</g>" # end font
25 .PE