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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
| \documentclass{article}
\usepackage{tikz} \usetikzlibrary{arrows,graphs,decorations.markings}
\begin{document} \pagestyle{empty}
% 辅助计数器 \newcounter{x} \newcounter{y}
\begin{tikzpicture}[ yscale=.5, xscale=1.5, %node distance=1cm, auto, > = stealth, -> /.style={thick, black}, -- /.style={thick, black}, ->-/.style={decoration={ markings, mark=at position #1 with {\arrow{>}}}, postaction={decorate}}, n/.style={ circle, draw, minimum size=2pt, inner sep=0pt, outer sep=0pt}, ] % The strategy is to create nodes with names: N-column-row -> N-列-行
%----------------------- 输入输出 ------------------------------------------------------- % 输入结点命名规则 N-0-0 ... N-0-15 % 输出结点命名规则 N-8-0 ... N-8-15 % Draw inputs \foreach \y in {0,...,15} \node[n,pin={[pin edge={<-}]left:$x[\y]$}] (N-0-\y) at (0,-\y) {};
% Draw outputs \y计数 idx显示 \foreach \y / \idx in {0/0,1/8,2/4,3/12,4/2,5/10,6,7/14, 8/1,9,10/5,11/13,12/3,13/11,14/7,15} \node[n, pin={[pin edge={->}]right:$X[\idx]$}] (N-8-\y) at (6,-\y) {};
%-------------------------- 画连接点 --------------------------------------------------- % 0 1 2 3 4 5 6 7 8 % in o - o o - o o - o - o out
% 7个中间连接点 \foreach \y in {0,...,15} \foreach \x / \c in {1/1, 1.5/2, 2.5/3, 3/4, 4/5, 4.5/6, 5.5/7} \node[n] (N-\c-\y) at (\x,-\y) {};
%----------------------- 画连接线 ----------------------------------------------------- % 水平线连接
\foreach \y in {0,...,15}%行 \foreach \x in {0,2,4,6}%列 { \setcounter{x}{\x}\stepcounter{x} \path (N-\x-\y) edge[->-=.87] (N-\arabic{x}-\y); }
\foreach \y in {0,...,15}%行 \foreach \x in {1,3,5,7}%列 { \setcounter{x}{\x}\stepcounter{x} \path (N-\x-\y) edge[->-=.5] (N-\arabic{x}-\y); }
% 斜线连接 \foreach \sourcey / \desty in {0/8,1/9,2/10,3/11, 4/12,5/13,6/14,7/15, 8/0,9/1,10/2,11/3, 12/4,13/5,14/6,15/7} \path (N-0-\sourcey) edge[->-=.04] (N-1-\desty);
\foreach \sourcey / \desty in {0/4,1/5,2/6,3/7, 4/0,5/1,6/2,7/3, 8/12,9/13,10/14,11/15, 12/8,13/9,14/10,15/11} \path (N-2-\sourcey) edge[->-=.97] (N-3-\desty);
\foreach \sourcey / \desty in {0/2,1/3,2/0,3/1, 4/6,5/7,6/4,7/5, 8/10,9/11,10/8,11/9, 12/14,13/15,14/12,15/13} \path (N-4-\sourcey) edge[->-=.95] (N-5-\desty);
\foreach \sourcey / \desty in {0/1,1/0,2/3,3/2, 4/5,5/4,6/7,7/6, 8/9,9/8,10/11,11/10, 12/13,13/12,14/15,15/14} \path (N-6-\sourcey) edge[->-=.3] (N-7-\desty);
%----------------------- 标注旋转因子 -----------------------------------------------
% W_16 \setcounter{y}{8} \foreach \i in {0,...,7} { \path (N-1-\arabic{y}) edge[->-=.5] node {\tiny $W^{\i}_{16}$} (N-2-\arabic{y}); \node[below] at (N-1-\arabic{y}.south) {\tiny -1}; \stepcounter{y} }
% W_8 \setcounter{y}{4} \foreach \j in {1,2} { \foreach \i in {0,2,4,6} { \path (N-3-\arabic{y}) edge[->-=.5] node {\tiny $W^{\i}_{16}$} (N-4-\arabic{y}); \node[below] at (N-3-\arabic{y}.south) {\tiny -1}; \stepcounter{y} } \addtocounter{y}{4} }
% W_4 \setcounter{y}{2} \foreach \j in {1,...,4} { \foreach \i in {0,4} { \path (N-5-\arabic{y}) edge[->-=.5] node {\tiny $W^{\i}_{16}$} (N-6-\arabic{y}); \node[below] at (N-5-\arabic{y}.south) {\tiny -1}; \stepcounter{y} } \addtocounter{y}{2} }
% W_2 \setcounter{y}{1} \foreach \j in {1,...,8} { \foreach \i in {0} { \path (N-7-\arabic{y}) edge[->-=.5] node {\tiny $W^{\i}_{16}$} (N-8-\arabic{y}); \node[below] at (N-7-\arabic{y}.south) {\tiny -1}; \stepcounter{y} } \addtocounter{y}{1} }
\end{tikzpicture} \end{document}
|