The printed word “even” conflicts with the displayed numbers: all ten listed prime numbers are odd, and is the only even prime number. The scan confirms that wording.[ref] We first construct the detector for the explicitly listed numbers, then add as requested. The literal even-prime detector is also given below.
Let the five input bits be with value . Every listed number has . For that plane, the four-variable Karnaugh map is
The entire plane is zero. Five valid groups in the displayed Karnaugh map give the product terms
Including , their accepted numbers are respectively , , , , and . Their union is exactly the ten listed numbers. Hence an explicit Boolean circuit is: invert where needed, feed the five products into five AND gates, combine those outputs with an OR gate, and AND with . Its output is
Any gate with more than two inputs can be replaced by a tree of two-input gates. To include the exceptional prime number , detect its exact binary representation and add one OR branch:
If “even prime” is read literally instead of following the listed numbers, the complete first detector is simply
All three formulas classify all possible inputs, including and as nonprime.

Articles by others on the same topic (0)

There are currently no matching articles.