summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/circ/gate.def
blob: 8524e1aab5bca9d64bfec0dd8e74a0c6eeb76fbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%%
%% This is file `gate.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% circ.dtx  (with options: `gate')
%% CIRC is a LaTeX package to typeset circuit and optics diagrams.
%% Copyright (C) 1997,1998,2003  Sebastian Tannert and Andreas Tille
%% 
%%   This program is free software; you can redistribute it and/or modify
%%   it under the terms of the GNU General Public License as published by
%%   the Free Software Foundation; either version 2 of the License, or
%%   (at your option) any later version.
%% 
%%   This program is distributed in the hope that it will be useful,
%%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%%   GNU General Public License for more details.
%% 
%%   You should have received a copy of the GNU General Public License
%%   along with this program; if not, write to the Free Software
%%   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
%% 
%% For error reports concerning UNCHANGED versions of this file no
%% more than one year old, see CIRC.DVI after installation.
%% If installation fails search thru this file for 'bug'.
\ProvidesFile{gate.def}
\freecirc
\def\g*iio#1 #2 #3 #4 #5 {\dimen4\*X*\dimen5\*Y*
  \rud*{#1}\getc*0
  \stopos*\add*y\ic*\X*check\store*{\the\ru*pin}\rstpos*
  \add*y{-\ic*}\store*{\the\ld*pin}\rstpos*
  \add*x{.5\wd*}\store*:\add*x{.5\wd*}\X*check\store*{\the\m*pin}%
  \ifhvcen*\shift*Ilist:\else\shift*Ilist{#2}\fi
  \setbox\*bbox=\hbox{\ifpin\pinnumberfont
    \dimen0\ic*\advance\dimen0\pinnum*spc
    \raise\dimen0\rlap{\kern\pin*ind\hc*{#3}}%
    \dimen0-\ic*\advance\dimen0\pinnum*spc
    \raise\dimen0\rlap{\kern\pin*ind\hc*{#4}}%
    \raise\pinnum*spc\rlap{\kern\wd*\kern-\pin*ind\hc*{#5}}\fi
    \the\ldd*\box\box*}\put*box\reset*ifs
  \*X*\dimen4\*Y*\dimen5}
\def\g*io#1 #2 #3 #4 {\dimen4\*X*\dimen5\*Y*
  \rud*{#1}\getc*0
  \store*{\the\ld*pin}%
  \add*x{.5\wd*}\store*:\add*x{.5\wd*}\X*check\store*{\the\m*pin}%
  \ifhvcen*\shift*Ilist:\else\shift*Ilist{#2}\fi
  \setbox\*bbox=\hbox{\ifpin\pinnumberfont
    \raise\pinnum*spc\rlap{\kern\pin*ind\hc*{#3}}%
    \raise\pinnum*spc\rlap{\kern\wd*\kern-\pin*ind\hc*{#4}}\fi
    \the\ldd*\box\box*}\put*box\reset*ifs
  \*X*\dimen4\*Y*\dimen5}
\def\gateIIO#1 #2#3 #4#5 #6 #7 {\expandafter
  \def\csname#1\endcsname##1 {\name*{#1##1}\ldd*{#4}%
    \ld*pin{#5}\m*pin{#6}\ru*pin{#7}\cc*#3 #2\g*iio}}
\def\ldd*gN#1{\raise\fontdimen10\c*fntb
                 \blap{\hc*{\kern\wd*\symfont\,#1}}%
              \lower\dp*
                 \vtop{\kern\*spc\hc*{\labelfont\kern\wd*\the\rud*}}}
\def\ldd*OV{\ac*{\kern.8\wd*\ctextfont\the\rud*}}
\def\NgateIIO#1 #2#3 #4 {\expandafter
  \def\csname#1\endcsname##1 {\name*{#1##1}\ldd*{\ldd*gN{#4}}%
    \ld*pin{I2}\m*pin{O}\ru*pin{I1}\cc*#3 #2\g*iio}}
\def\gateIO#1 #2#3 #4#5 #6 {\expandafter
  \def\csname#1\endcsname##1 {\name*{#1##1}\ldd*{#4}%
    \ld*pin{#4}\m*pin{#5}\cc*#3 #2\g*io}}
\def\NgateIO#1 #2#3 #4 {\expandafter
  \def\csname#1\endcsname##1 {\name*{#1##1}\ldd*{\ldd*gN{#4}}%
    \ld*pin{I}\m*pin{O}\cc*#3 #2\g*io}}
\gateIIO      OV          \c*fntb  255 \ldd*OV  + O -
\gateIIO      ov          \c*fntb  254 \ldd*OV  - O +
\NgateIIO     NAND        \c*fntb  132 {$\&$}
\NgateIIO     AND         \c*fntb  131 {$\&$}
\NgateIIO     OR          \c*fntb  131 {$\ge$1}
\NgateIIO     NOR         \c*fntb  132 {$\ge$1}
\NgateIIO     XOR         \c*fntb  131 {$=$1}
\NgateIIO     XNOR        \c*fntb  131 {$=$\vrule width 0pt height 1.5ex\,}
\NgateIO      INV         \c*fntb  130 {1\,}
\NgateIO      ST          \c*fntb  128 {{\c*fnts\char7}}
\NgateIO      STINV       \c*fntb  130 {{\c*fnts\char7}}
\NgateIO      BUF         \c*fntb  130 {{\c*fnts\char25}}
\protectcirc
\endinput
%%
%% End of file `gate.def'.