5

I want to draw a pseudo-random number generator. I found this image at a paper and now I want to know how it draws this beautiful image.

Is there a special library for this? I didn't something at my search. Maybe you have few ideas?

enter image description here

1 Answer 1

15

The trapezium shape from the shapes.geometric library can be convenient for this case. You will need to add rounded corners option also to get these nice rounded edges.

\documentclass[tikz,border=3pt]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}

\begin{tikzpicture}[thick, rounded corners=7pt]  
  \node(T)  [trapezium, inner xsep=1.5pt, minimum height=4em, rotate=-90, draw,label=center:\textsf{next}] {};
  \node(S)  at(-2,0) {$S$};
  \node(S') at(2,0)  {$S'$};
  \node(R)  at(2,-1) {$R$};
  \draw [->](S) -- (T);
  \draw [->](T) -- (S');
  \draw [->](T.90) to[out=0,in=150] (R);
\end{tikzpicture}

\end{document}

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .