-2

For the input of 101, one needs to have 7 bits, but I dunno how to start drawing a k-map with 7 variables...

Here's a tutorial on doing 5 variable k-map, and the SOP equation is:

F = a' b' e + a' b' c' d + b c d' e + a c d e + b' c' e + a' c' d e

Which I guess can be used in VHDL, you input some number, and F will output 1 if the number is prime (e.g. 7) or 0 if it's not. But this equation only supports number up to 31, how do I find an equation that'll cover prime numbers between 0 and 101??

How would I start doing the k-map? Would my a input also be separate kind of like the in the youtube example?

toolic
  • 57,801
  • 17
  • 75
  • 117
Jack
  • 121
  • 4
  • 1
    Note that Wikipedia tells us 1 isn't generally considered a [prime number](https://en.wikipedia.org/wiki/Prime_number) in the last century and a half or so. Not doing so produces 8 terms instead of the 6 shown. –  Apr 26 '16 at 22:13

1 Answers1

3

Follow the steps:

  1. Make truth table for 0 to 101, in which F should be 1 for prime number.
  2. Insert that truth table here.
  3. Obtain reduced boolean equation and Rock!!

For more than six variable, It is too much tedious to handle K-Map Squares as it is too much. You can use Tabulation Method (Quine-McCluskey). See link.

Prakash Darji
  • 990
  • 6
  • 13
  • that's doing with truth table, but how does one do it with a k-map? would I have "abc defg" variables, right? Would abc be on the horizontal lines, and "defg" on the vertical? – Jack Apr 26 '16 at 21:36
  • The red lines delineate the two 4 element Karnaugh maps for the 5 variable version (it duplicates the work shown in the video), or the eight 4 element Karnaugh maps for the 7 variable problem. The web page should do splendidly for learning to organize larger variables into 4 element K maps. –  Apr 26 '16 at 22:11
  • What? can't you just show how a k-map table will look like with 7 variables? – Jack Apr 27 '16 at 01:00
  • 1
    @Jack: K-map for 7 variables is **not really doable by hand**. You can certainly draw a K-map for 2^7 = 128 truth-table's rows, but you would not easily see, which cells are neighbouring. That is why you should use the Quine-McCluskey method, where you can compute/find the difference between each of the combinations of the 7 variables. Maybe there is another way dealing with the problem, but I would not recommend drawing a K-map. – Kit Ostrihon May 20 '16 at 17:50