General Information
Moore finite state machine that recognizes the word 10010. Over the arrows is the input that causes the transition. Also, the states of the FSM are drawn blue with the corresponding name and output inside of them. When the output is 1 then the FSM has recognized the sequence 10010.
The second image depicts the circuit that implements the FSM described in the first one.
Schematic
\documentclass{standalone}\usepackage{tikz}\usetikzlibrary{automata, positioning, arrows, calc}\tikzset{->, % makes the edges directed>=stealth, % makes the arrow heads boldshorten >=2pt, shorten <=2pt, % shorten the arrownode distance=3cm, % specifies the minimum distance between two nodes. Change if nevery state/.style={draw=blue!55,very thick,fill=blue!20}, % sets the properties for each ’state’ ninitial text=$ $, % sets the text that appears on the start arrow}\begin{document}\begin{tikzpicture}\node[state with output, initial] (s0) {$S_0$ \nodepart{lower} $0$};\node[state with output, right of=s0] (s1) {$S_1$ \nodepart{lower} $0$};\node[state with output, right of=s1] (s2) {$S_2$ \nodepart{lower} $0$};\node[state with output, right of=s2] (s3) {$S_3$ \nodepart{lower} $0$};\node[state with output, right of=s3] (s4) {$S_4$ \nodepart{lower} $0$};\node[state with output, accepting, right of=s4] (s5) {$S_5$ \nodepart{lower} $1$};\draw (s0) edge[loop above] node{$0$} (s0)(s0) edge[bend left] node[above]{$1$} (s1)%(s1) edge[bend left] node[above]{$0$} (s2)(s1) edge[bend left] node[above]{$1$} (s0)%(s2) edge[bend left] node[above]{$0$} (s3)(s2) edge[bend left=40] node[above]{$1$} (s0)%(s3) edge[bend left=50] node[above]{$0$} (s0)(s3) edge[bend left] node[above]{$1$} (s4)%(s4) edge[bend left] node[above]{$0$} (s5)(s4) edge[bend left=60] node[above]{$1$} (s0)%(s5) edge[bend right=40] node[above]{$1$} (s1)(s5) edge[bend left=70] node[above]{$0$} (s0);
Circuitc
\documentclass{standalone}% Tikz\usepackage{tikz}\usetikzlibrary{arrows,shapes.gates.logic.US,shapes.gates.logic.IEC,calc}% Notation\usepackage{amsmath, siunitx}% Tikz Library\usetikzlibrary{calc}\tikzset{every picture/.style={line width=0.3mm}}% Circuitikz\usepackage[european,straightvoltages,americanresistor]{circuitikz}\ctikzset{logic ports=ieee}% Custom\tikzset{sr-ff0/.style={flipflop D, flipflop def={t1=$S'_0$, t4=, t6=$S_0$}}}\tikzset{sr-ff1/.style={flipflop D, flipflop def={t1=$S'_1$, t4=, t6=$S_1$}}}\tikzset{sr-ff2/.style={flipflop D, flipflop def={t1=$S'_2$, t4=, t6=$S_2$}}}\begin{document}\tikzstyle{branch}=[fill, shape=circle, minimum size=3pt, inner sep=0pt]\begin{circuitikz}[line cap=round, line join =round]% States\node[sr-ff0] (s0) at (0,0) {};\node[sr-ff1, yshift=3cm] (s1) at (s0) {};\node[sr-ff2, yshift=3cm] (s2) at (s1) {};\draw (s2.bdown) -- +(0,-0.2)(s1.bdown) -- +(0,-0.2)(s0.bdown) -- +(0,-0.2);% Input\coordinate (end) at ($(s0.bdown) + (0,-5)$);\draw ($(s2.pin 6)+(0,0)$) to[short, *-] ++(0,2)