= Solution
Each stage has $J=K=1$ and therefore toggles. The printed clock symbols have no inversion bubble, so they are positive-edge triggered; each later clock is driven by the previous uncomplemented $Q$ output. Consequently the circuit is a <ripple counter> that \b[counts down modulo eight]. A zero <least significant bit> rises to one and propagates the transition; a one falls to zero and stops it. For example, the settled transition from $001$ is $000$, whereas $000$ is followed by $111$.
After $N$ input pulses the settled value is $(1-N)\bmod 8$, giving
$$
\begin{array}{c|c|ccc}
N&Q_2Q_1Q_0&Q_0&Q_1&Q_2\\\hline
20&101&1&0&1\\
101&100&0&0&1\\
257&000&0&0&0
\end{array}
$$
\b[The answers are $101$, $100$, and $000$], respectively, in most-significant-first order. Treating these as falling-edge stages would reverse the counting direction and would not follow the drawn clock symbols.
Back to article page