Advertisement
AntonioAndreas

Cls benes Configuration

Apr 28th, 2014
1,315
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \documentclass{article}\usetikzlibrary{switching-architectures}\begin{document}\begin{tikzpicture} \node[N=8, r1=4, M=10, clos snb] {};\end{tikzpicture}\end{document}
  2.  
  3.  
  4. Clos Network Strictly Non Blocking 8x10 with modules 2x2
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. Clos Network 8x10 with modules 2x2
  13. \documentclass{article}\usetikzlibrary{switching-architectures}\begin{document}\begin{tikzpicture} \node[N=8, r1=4, M=10, clos rear] {};\end{tikzpicture}\end{document}
  14.  
  15.  
  16.  
  17. A simple example of Benes Networks
  18. This example represents a Benes Network 32x32 drawn in its whole completexity.
  19.  
  20.  
  21.  
  22. \documentclass{article}\usetikzlibrary{switching-architectures}\begin{document}\begin{tikzpicture}[ module size=0.6cm, pin length factor=0.5, module ysep=1] \node[P=32,benes complete] {};\end{tikzpicture}\end{document}
  23.  
  24.  
  25. Benes Configuration
  26.  
  27.  
  28. \documentclass{beamer}\usepackage{lmodern}\usepackage{tikz}\usetikzlibrary{switching-architectures} % http://www.ctan.org/pkg/sa-tikz\newcounter{port}% legend image\newcommand{\leg}[1]{%  \tikz[baseline=-0.5ex]\draw[#1,ultra thick](0,0)--(1.5em,0);}% arrow\newcommand{\tikzarrow}[1]{%  \tikz[baseline=-0.5ex]\draw[-stealth](0,0)--(0.75em,0);}% connection description\newcommand{\mydescription}[3]{%  \item[\leg{#1}] in #2 \tikzarrow\ out #3}\begin{document}\begin{frame}{A Benes Network: a possible configuration}\begin{columns}[T]% The network\begin{column}{0.7\textwidth}%\centering% Style to customize the module's aspect \tikzset{module size definition/.style={  module size=0.75cm,  pin length factor=0.75,  module xsep=2.25,  module ysep=1.25,  }}\begin{tikzpicture}[scale=0.9,transform shape]\node[module size definition,benes complete={module label opacity=0}] {};% Labels% * * * % input\setcounter{port}{0}\foreach \startmodule in {1,...,4}{  \foreach \port in {1,...,2}{    \stepcounter{port}    \node[left,font=\tiny] at (r1-\startmodule-front input-\port)     {in~\theport};  }}% * * * % output\setcounter{port}{0}\foreach \startmodule in {1,...,4}{  \foreach \port in {1,...,2}{    \stepcounter{port}    \node[right,font=\tiny] at (r5-\startmodule-front output-\port)     {out~\theport};  }}% * * * % Connections% overlay starts with 2 such that the newtork is empty at the beginning\draw[red,ultra thick](r1-2-input-1)--(r1-2-output-2)-- (r2-3-input-2)--(r2-3-output-1)-- (r3-3-input-1)--(r3-3-output-2)-- (r4-4-input-1)--(r4-4-output-1)-- (r5-3-input-2)--(r5-3-output-2);\draw[blue,ultra thick](r1-4-input-1)--(r1-4-output-1)-- (r2-2-input-2)--(r2-2-output-1)-- (r3-1-input-2)--(r3-1-output-1)-- (r4-1-input-1)--(r4-1-output-1)-- (r5-1-input-1)--(r5-1-output-2);\draw[orange,ultra thick](r1-4-input-2)--(r1-4-output-2)-- (r2-4-input-2)--(r2-4-output-1)-- (r3-3-input-2)--(r3-3-output-1)-- (r4-3-input-1)--(r4-3-output-2)-- (r5-2-input-2)--(r5-2-output-2);\draw[green!50!black,ultra thick](r1-3-input-2)--(r1-3-output-2)-- (r2-4-input-1)--(r2-4-output-2)-- (r3-4-input-2)--(r3-4-output-1)-- (r4-3-input-2)--(r4-3-output-1)-- (r5-1-input-2)--(r5-1-output-1);\draw[violet!70,ultra thick](r1-1-input-2)--(r1-1-output-2)-- (r2-3-input-1)--(r2-3-output-2)-- (r3-4-input-1)--(r3-4-output-2)-- (r4-4-input-2)--(r4-4-output-2)-- (r5-4-input-2)--(r5-4-output-2);\draw[blue!50!cyan,ultra thick](r1-3-input-1)--(r1-3-output-1)-- (r2-2-input-1)--(r2-2-output-2)-- (r3-2-input-2)--(r3-2-output-2)-- (r4-2-input-2)--(r4-2-output-1)-- (r5-3-input-1)--(r5-3-output-1);\draw[brown,ultra thick](r1-2-input-2)--(r1-2-output-1)-- (r2-1-input-2)--(r2-1-output-1)-- (r3-1-input-1)--(r3-1-output-2)-- (r4-2-input-1)--(r4-2-output-2)-- (r5-4-input-1)--(r5-4-output-1);\draw[gray,ultra thick](r1-1-input-1)--(r1-1-output-1)-- (r2-1-input-1)--(r2-1-output-2)-- (r3-2-input-1)--(r3-2-output-1)-- (r4-1-input-2)--(r4-1-output-2)-- (r5-2-input-1)--(r5-2-output-1);\end{tikzpicture}\end{column}% avoids to much space between columns\hspace*{-4em}% Column with connections: they are displayed one frame% before being drawn\begin{column}{0.35\textwidth}%\raggedleftConnections\begin{description}\scriptsize\mydescription{red}{3}{6}\mydescription{blue}{7}{2}\mydescription{orange}{8}{4}\mydescription{green!50!black}{6}{1}\mydescription{violet!70}{2}{8}\mydescription{blue!50!cyan}{5}{5}\mydescription{brown}{4}{7}\mydescription{gray}{1}{3}\end{description}\end{column}\end{columns}\end{frame}\end{document}
Advertisement
RAW Paste Data Copied
Advertisement