Creating a tikzpicture using nodes

tikz-pgf

Could anyone help me create a tikzpicture using nodes The picture I want and the code I have so far are shown below. There are two things I'm struggling with: First, how to make two arrows coming out of the last rectangle? Second, how to add that switch element between the circle and the first rectangle?
enter image description here

% Tikz block diagram for the product processor
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{calc}



% Definition of styles for blocks and multiplier
\tikzstyle{block} =  [rectangle, draw=black, thick, text width=2em,align=center,
minimum height=2em, node distance=8em]
\tikzstyle{mult}=[draw=black, thick, circle, node distance = 2cm] % multiplier


%-----------------------------------------------------------------------
\begin{document}
\begin{tikzpicture}[font=\sffamily, >=latex]
  \node [align=center,color=black] at (-2,-1) (snlabel) {$c$};
  \node[circle, draw,node distance=5em, right of=snlabel, color=black] (circlelabel1){$\times$}; 
  \node[block, right of=circlelabel1, color=black, node distance=5em] (sumlabel)  {text1}; 
  \node[block, right of=sumlabel, color=black, node distance=7em] (detlabel)  {$d=e$\\$f=g$}; 
  
 
  \draw[->, color=black] (snlabel) -- node [above] {}(circlelabel1); 
  \draw[->, color=black] (circlelabel1) -- node [above] {} (sumlabel); 
  \draw[->, color=black] (sumlabel) -- node [above] {\color{black} $b$} (detlabel); 




  % add whitespace to bottom and top
  \node at (4.5,-3.5) {\hspace*{1em}};  
  \node at (4.5,-.4) {\hspace*{1em}}; 

\end{tikzpicture}

\end{document}

Best Answer

I strongly recommend the positioning library and the usage right=of A not right of=A. Also, note the use of tikzset for defining styles; \tikzstyle should no longer be used.

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning, arrows.meta}

\tikzset{
    block/.style={draw, text width=4em, align=center, minimum height=2em},
    mult/.style={draw, circle, minimum size=6mm, path picture={\draw(path picture bounding box.south east)--(path picture bounding box.north west)
        (path picture bounding box.south west)--(path picture bounding box.north east);}}
}

\begin{document}

\begin{tikzpicture}[node distance=1.5cm, thick]
\coordinate(A) at (0,0);
\node[mult, right=of A](B){};
\coordinate[right=of B](C){};
\node[block, right=of C](D){text1};
\node[below=1cm of D](M){$d$};
\node[block, right=of D](E){$d=e$\\[2ex]$f=g$};
\node[right=1cm of E.25](F){$h_1$};
\node[right=1cm of E.-25](G){$h_2$};
\draw[->] (A)--node[above]{$c$}(B);
\draw (B)--(C);
\draw[->] (M)--(D);
\draw[->] (D)--node[above]{$b$}(E);
\draw[->] (E.25)--(F);
\draw[->] (E.-25)--(G);
\draw[<->] (D)--([xshift=8mm]C)--([shift={(.2,.5)}]C);
\draw[<-] ([xshift=3mm]C) arc(180:90:.5)node[above]{$t=0$};
\end{tikzpicture}

\end{document}