= Solution
The unconstrained cases can be treated as <don't-care conditions> during <Boolean function> minimization. One particularly small, deliberately asymmetric choice is
$$
\boxed{q^+=ab+cq.}
$$
Use the same two history <D flip-flops> and one output <D flip-flop>, with this expression at the output D input. It requires two two-input <AND gates> and one <OR gate>.
To verify every required case, first set $q=0$. If zero occurs at least twice among $a,b,c$, then $ab=0$, so $q^+=0$ as required. If all three samples are one, then $ab=1$, so $q^+=1$. The remaining triples have exactly two ones and hence exactly one sample agreeing with the old zero; either output is allowed.
Now set $q=1$. If at least two samples are one, either $c=1$ or $a=b=1$, giving $q^+=1$. If all three samples are zero, both terms vanish, giving $q^+=0$. The remaining triples have exactly one one and are the allowed <don't-care conditions>. Thus the expression meets both requirements, including every constant-input triple.
For minimality, consider these required one-entries in $(a,b,c,q)$ order: $1110$, $1101$, $1011$ and $0111$ have no common literal. Therefore a product covering all four would be the constant one, which violates required zero-entries. Also no single-literal product is safe: each of $a,b,c,q$ is one at some required zero-entry, and each complemented literal is one at $0000$. Hence at least two products with at least two <Boolean literals> each are needed. The displayed expression attains two products and four literals.
Back to article page