2

So my state diagram has seven states (000 to 110), an input B button, and four outputs P, Q, R, and S.

I've made the truth table, which has 16 rows (two of which have Xs). I'm supposed to make 7 K-Maps out of this, S2' S1' S0' P Q R and S. I understand that the input B (0, 1) will be on the column side (or row), but I'm having trouble with the rows. S2 is most significant digit, S0 least.

I've never seen a K-Map with 3 bits (S2/S1/S0) on one side, but I don't know how to represent it in any other way. And if it is three bits, what order do those numbers go in? For two, I know it's 00/01/11/10.

If it's two, which seems like the right idea, then how do you decide between two of the three (S2/S1/S0)? Does the input B side get an additional variable next to it (so it would be S2/S1 on the column and B/S0 on the rows?). How do you decide which of the S2/S1/S0 is put on the other side, does it even matter?

One big help for me would be to see an example of a truth table/k-maps for a S2/S1/S0 state diagram. I've only ever seen examples of S1/S0, so no more than 4 states (00/01/10/11).

Thank you for any help you can provide. I'm sorry if my question is confusing. Please let me know if I can be any clearer about my problem.

sumitz1212
  • 63
  • 4
  • 10

1 Answers1

0

First there are the answers to your questions:

Number of cells in every Karnaugh map matches the number of all possible input combinations. The way how the map's cells are indexed has to correspond to the truth table. In the following picture are examples of the different sizes of Karnaugh maps, where the visualisation of neighbouring cells is still pretty easy.

The different sizes of Karnaugh maps

As you can see, the point is, that two neighbouring cells differ only in one variable's value, four neighbouring cells differ in two variables' values and so on. That is why you should look for groups that have the size of the 2^n. Map's indexing could look a bit mixed up, but that is for the purpose of displaying all the relationships between each and every row in the truth table.

If you index a K-map, but do not know, which lines are for which variables and in which order they should go in, then you can check it like this:

  • index 0 = where not a single variable is true
  • index 1 = where only the least significant bit is true (for a truth table ordered abcd that would be the d)
  • index 2 = where only the second least significant bit is true (for the same truth table that would be the c)
  • index 4 = where only the third least significant bit is true (for the same truth table that would be the b)
  • index 8 = where only the fourth least significant bit is true (for the same truth table that would be the a)

As for an example: Here you can see a state diagram of a 01364 sequence generator implemented as a Moore machine. All edges of the machine are labelled by an input value of a reset button.

01364 sequence generator implemented as a Moore machine

The machine's desired behaviour and the output values matching the states can be described by this transition table:

 state || output (decimal) | reset || next state
-------------------------------------------------
  S_0  ||        0         |   0   ||    S_1
       ||                  |   1   ||    S_0
-------------------------------------------------
  S_1  ||        1         |   0   ||    S_2
       ||                  |   1   ||    S_0
-------------------------------------------------
  S_2  ||        3         |   0   ||    S_3
       ||                  |   1   ||    S_0
-------------------------------------------------
  S_3  ||        6         |   0   ||    S_4
       ||                  |   1   ||    S_0
-------------------------------------------------
  S_4  ||        4         |   0   ||    S_0
       ||                  |   1   ||    S_0

After encoding the states' representation to match the decimal outputs in binary (q_2, q_1 and q_0; d_2, d_1 and d_0), the transition table looks like this:

 state || q_2 | q_1 | q_0 | reset || d_2 | d_1 | d_0 || next state
-------------------------------------------------------------------
  S_0  ||  0  |  0  |  0  |   0   ||  0  |  0  |  1  ||    S_1
       ||     |     |     |   1   ||  0  |  0  |  0  ||    S_0
-------------------------------------------------------------------
  S_1  ||  0  |  0  |  1  |   0   ||  0  |  1  |  1  ||    S_2
       ||     |     |     |   1   ||  0  |  0  |  0  ||    S_0
-------------------------------------------------------------------
  S_2  ||  0  |  1  |  1  |   0   ||  1  |  1  |  0  ||    S_3
       ||     |     |     |   1   ||  0  |  0  |  0  ||    S_0
-------------------------------------------------------------------
  S_3  ||  1  |  1  |  0  |   0   ||  1  |  0  |  0  ||    S_4
       ||     |     |     |   1   ||  0  |  0  |  0  ||    S_0
-------------------------------------------------------------------
  S_4  ||  1  |  0  |  0  |   0   ||  0  |  0  |  0  ||    S_0
       ||     |     |     |   1   ||  0  |  0  |  0  ||    S_0

It is useful to study the transition table for every possible combination of inputs, because there are some 'do not care' (x) output values (for the states, that are not present in the sequence), which can be used for minimisation by Karnaugh maps.

 index | state || q_2 | q_1 | q_0 | reset || d_2 | d_1 | d_0 || next state
---------------------------------------------------------------------------
   0   |  S_0  ||  0  |  0  |  0  |   0   ||  0  |  0  |  1  ||    S_1
   1   |  S_0  ||  0  |  0  |  0  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
   2   |  S_1  ||  0  |  0  |  1  |   0   ||  0  |  1  |  1  ||    S_2
   3   |  S_1  ||  0  |  0  |  1  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
   4   |   -   ||  0  |  1  |  0  |   0   ||  x  |  x  |  x  ||     -
   5   |   -   ||  0  |  1  |  0  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
   6   |  S_2  ||  0  |  1  |  1  |   0   ||  1  |  1  |  0  ||    S_3
   7   |  S_2  ||  0  |  1  |  1  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
   8   |  S_4  ||  1  |  0  |  0  |   0   ||  0  |  0  |  0  ||    S_0
   9   |  S_4  ||  1  |  0  |  0  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
  10   |   -   ||  1  |  0  |  1  |   0   ||  x  |  x  |  x  ||     -
  11   |   -   ||  1  |  0  |  1  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
  12   |  S_3  ||  1  |  1  |  0  |   0   ||  1  |  0  |  0  ||    S_4
  13   |  S_3  ||  1  |  1  |  0  |   1   ||  0  |  0  |  0  ||    S_0
---------------------------------------------------------------------------
  14   |   -   ||  1  |  1  |  1  |   0   ||  x  |  x  |  x  ||     -
  15   |   -   ||  1  |  1  |  1  |   1   ||  0  |  0  |  0  ||    S_0

Finally you can see, that the functions defining the d_2, d_1 and d_0 (that is the binary encoded state/output matching the number in the 01364 sequence) can be simply marked out in the following K-maps.

Function defining the binary encoded

f(d_2) = q_1 ⋅ ¬(reset)
f(d_1) = q_0 ⋅ ¬(reset)
f(d_0) = ¬(q_2) ⋅ ¬(q_1) ⋅ ¬(reset)

(All images were generated using latex.)

Kit Ostrihon
  • 824
  • 2
  • 14
  • 36