1
\$\begingroup\$

No idea how to attack this question, full question being:

"Design a combination circuit which can detect prime numbers from 0 to 15. There should be a single output line, which would be 1 if the input is a prime number, otherwise the output line would be 0"

How would I go about completing this question? It looks fairly involved.

\$\endgroup\$
2
  • 4
    \$\begingroup\$ 2, 3, 5, 7, 11 and 13 are the primes between 0 and 15, can you make a circuit to output one when the input is one when it's a number in that list and 0 otherwise? \$\endgroup\$
    – Gorloth
    Apr 3, 2014 at 15:41
  • 4
    \$\begingroup\$ Hint: Write down all of the possible input combinations and the corresponding output for each. \$\endgroup\$
    – Dave Tweed
    Apr 3, 2014 at 15:45

1 Answer 1

7
\$\begingroup\$

Procedure:

  1. Identify all the prime numbers between 0 and 15 (2, 3, 5, 7, 11, 13).
  2. Determine how many bits you need for a maximum value of 15 (four bits).
  3. Construct a Karnaugh map of the appropriate size and mark all prime numbers as logical 1 and all non-primes as logical 0.
  4. Reduce the Karnaugh map to find your logic function.

I'll leave you to do the grunt work yourself.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Doesn't even need a K-map. Just group them into bit-difference groups: 2-3, 5-7, 3-7-11, 5-13. \$\endgroup\$ Apr 3, 2014 at 18:24
  • \$\begingroup\$ It's lucky if the input is just 4-bits, How about 64-bit input? Should I use KMap and identifying manually from 0 until 2⁶⁴-1 \$\endgroup\$ Jun 5, 2022 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.