# sequential circuits

Joined Dec 2, 2012
89
Hi everyone,

I am stuck on the attached homework and i'm stuck on TASK 2. I have also attached the beginning of my solution but i'm stuck.

I know i have to find the minterms and create a karnaugh map.

Can anyone please start off by showing me how to go about
getting the minterms, then the karnagh maps please?

Thanks.

#### Attachments

• 269.5 KB Views: 56
• 264.2 KB Views: 60

#### tshuck

Joined Oct 18, 2012
3,534
I feel I can best explain this by showing what the steps are, so, I will do a portion so that I may explain the reasoning behind the choices made....

First, we need the excitation table for a JK flip flop:

Given this, we know that when the output of the flip flop is 0, J controls the next state with a don't care on K, conversely, when the output is 1, K controls the next state with J being a don't care.

That being said, you have three variables: Q0, Q1, and Q2, representing the current count with Q0 being the LSB. In addition to this, you have another variable that determines what the next state is, Count. This means you will need a four input K-map for each of your flip flop inputs(J & K). We need to determine next-state logic.

I will show you the K-maps for the first flip flop(Q0):
For J0(J on Q0)
Q2 Q1\Q0 Count| 00 | 01 | 11 | 10
00|0|1|X|X
01|0|1|X|X
11|0|0|X|X
10|0|1|X|X
The left-most column contains the information when Q0 is 0 and Count is not enabled(active-high input), this means the state should not change, which is determined by J.

The next column is determined by the count, what the next count should be.
The following two columns are determined while D0 is 1, which isn't determined by J, so they are don't cares.
For K0(J on Q0)
Q2 Q1\Q0 Count| 00 | 01 | 11 | 10
00|X|X|1|0
01|X|X|1|0
11|X|X|1|0
10|X|X|1|0
**I have made it so that if caught in a state outside of 0-5, it will return to 0**

So far, the next state logic can be determined for Q0. Applying the same idea, finish the rest of the K-maps...

Joined Dec 2, 2012
89
Thanks very much for taking the time to reply. Ill be digesting them and get
back to you ASAP. Thanks again.

#### WBahn

Joined Mar 31, 2012
26,398
I am stuck on the attached homework and i'm stuck on TASK 2. I have also attached the beginning of my solution but i'm stuck.
It actually looks like you've got most of it done. The only thing that you haven't included is the Count input. Follow tshuck's suggestion and that will be taken care of.
I know i have to find the minterms and create a karnaugh map.

Can anyone please start off by showing me how to go about
getting the minterms, then the karnagh maps please?
This is backwards from they way you normally do it. You do a K-map in order to find the minterms (or maxterms). Again, tshuck has you started down the right road.

One good exercise to consider before you go any further. See if you can design the logic for the LSB (Q0) by inspection. If you think about how it behaves when Count is HI and how it behaves when Count is LO, you'll see that the logic is trivial (so trivial, in fact, that it requires no gates at all for a JKFF implementation).

Joined Dec 2, 2012
89
I remember you helped me with my previous assignment.
I'm in a daze at the moment with the replies iv had. I'll hopefully
get them all right.
Thanks again

Joined Dec 2, 2012
89
I feel I can best explain this by showing what the steps are, so, I will do a portion so that I may explain the reasoning behind the choices made....

First, we need the excitation table for a JK flip flop:

Given this, we know that when the output of the flip flop is 0, J controls the next state with a don't care on K, conversely, when the output is 1, K controls the next state with J being a don't care.

That being said, you have three variables: Q0, Q1, and Q2, representing the current count with Q0 being the LSB. In addition to this, you have another variable that determines what the next state is, Count. This means you will need a four input K-map for each of your flip flop inputs(J & K). We need to determine next-state logic.

I will show you the K-maps for the first flip flop(Q0):
For J0(J on Q0)
Q2 Q1\Q0 Count| 00 | 01 | 11 | 10
00|0|1|X|X
01|0|1|X|X
11|0|0|X|X
10|0|1|X|X
The left-most column contains the information when Q0 is 0 and Count is not enabled(active-high input), this means the state should not change, which is determined by J.

The next column is determined by the count, what the next count should be.
The following two columns are determined while D0 is 1, which isn't determined by J, so they are don't cares.
For K0(J on Q0)
Q2 Q1\Q0 Count| 00 | 01 | 11 | 10
00|X|X|1|0
01|X|X|1|0
11|X|X|1|0
10|X|X|1|0
**I have made it so that if caught in a state outside of 0-5, it will return to 0**

So far, the next state logic can be determined for Q0. Applying the same idea, finish the rest of the K-maps...

Hello,

Iv'e come up with the attached but i don't think the solutions from the K map is right. It looks weird. The bottom cells of each k-map have nothing.

#### Attachments

• 255.6 KB Views: 35
• 265.8 KB Views: 38

Joined Dec 2, 2012
89
Hello,

Iv'e come up with the attached but i don't think the solutions from the K map is right. It looks weird. The bottom cells of each k-map have nothing.

#### Attachments

• 264.2 KB Views: 32
• 265.8 KB Views: 33

#### WBahn

Joined Mar 31, 2012
26,398
Your K-map construction is incorrect. The whole concept of the K-map requires that only one input change and you move form one cell to an adjacent cell. This means that the input ordering HAS to be in a Gray code sequence and you have them in a binary sequence.

Joined Dec 2, 2012
89
I did one before in grey code and it looked weird as well which is why i tried the binary method. I attach the grey code type i did before.

#### Attachments

• 265.4 KB Views: 43

#### WBahn

Joined Mar 31, 2012
26,398
No matter how weird it might look, you can't just go using a binary encoding on a K-map. It simply will not work. The fact that you were even tempted to try it is a strong indicator that you don't understand what a K-map is or why/how it works.

Why do you have the 11 rows either blank or scribbled out? Each cell is either a 0, a 1, or an X. Blank is not an option.

You also can't group an odd number of cells. Your groupings have to be rectangular with each side being an integer power of two in length. Again, a strong indicator that you don't understand what a K-map is.

Look at your top left K-map. Underneath it you claim that J2=Q0. But your K-map has an entry for Q0=1 in which J2 is 0 (the top right cell). So J2=Q0 clearly is not correct.

Take a step back and go look into what a K-map is and WHY it works; don't just look at the cookbook recipe steps on how to use it.

#### tshuck

Joined Oct 18, 2012
3,534
Here is some information I wrote in another post, but it seems relevant here also:
The reason the order is 00-01-11-10 is because the K-map takes advantage of the fact that two terms which vary by a single variable can be reduced to eliminate that variable. Actually, it can be any order, so long as each subsequent state differs by only a single bit...

Let's take a look at this:

f = ABC + ABC'

So, this statement varies only by a single variable: C

Factoring out AB, we get

f = AB(C + C')

using the identity A + A' = 1, we get

f = AB(1)

Using A(1) = A, we are left with

f = AB

this is the same reasoning behind the K-map:
A\BC|00|01|11|10
0|A'B'C'|A'B'C|A'BC|A'BC'
1|AB'C'|AB'C|ABC|ABC'

So, Using the above example, we get:
f = ABC + ABC'
A\BC|00|01|11|10
0|0|0|0|0
1|0|0|1|1
Since the variable(s) that differs among a grouping, is eliminated, we get AB, same as the Boolean manipulation we did before.

Hope this helps!
Now, as WBahn said, and I simply want to reiterate/stress this, K-Map states cannot be blank. The output of a flip flop is not blank. The don't care states are eventually broken into either a 1 or 0, depending on whether or not it is grouped in the minimization. Grouping is only valid for 2^n states(where n > 0), this means you can group 1,2,4,8,16, etc. and is only valid for rectangles.

This thread and some others made me realize the counters section of the e-book is lacking, so I wrote an section explaining counters from a design perspective and took on the modulus counter design. I will have it up in a thread for review in the next few days or so...

Joined Dec 2, 2012
89
Yes I know I cant group 3 cells. I know its not allowed. I know I can group 1, 2, 4, 6, 8. Im thinking maybe those empty cells are dont cares. You know ive done it before in mu previous assignment. May be I missed something in my lectutre.

#### WBahn

Joined Mar 31, 2012
26,398
Yes I know I cant group 3 cells.
Then why did you do it?

I know its not allowed.
Then why did you do it?

I know I can group 1, 2, 4, 6, 8.
Then why didn't you do it?

Im thinking maybe those empty cells are dont cares.
"Maybe" they are don't cares?

They either are or they aren't.

Until you are sure which of the three possibilities (0,1,X) each cell is, then there is absolutely no point going on because the validity of any result is entirely dependent on the correctness of the cells in map.

You know ive done it before in mu previous assignment. May be I missed something in my lectutre.
I'm thinking so. If you've been this sloppy in previous assignments and gotten "correct" answers, then either you were lucky or the grader was pretty bad. Actually, even if you got lucky, the grader was still pretty bad to let you get away with it, because it set you up for your current state of confusion.

So go back and for each on of those blank cells, examine what you want that signal to be for that set of input conditions and then make it a 0, a 1, or an X.

Joined Dec 2, 2012
89
Thanks very much. I'll go right back to basics.

#### WBahn

Joined Mar 31, 2012
26,398
Good. Post you work after that and we'll see where it leads. You are pretty close to the answer, so I won't be surprised if your next shot hits the mark fully.

Joined Dec 2, 2012
89
Fogive me for my typing error as im using my phone to do them at work.

Joined Dec 2, 2012
89
I hope iv'e done them all right.
I worked out out why i was having the empty cells.
And it was because for a modulo 6 counter it toggles to
000 next state after present state 101. So the empty cells on the K-map
become Don't Cares.

Fingers crossed.

Is there any link here for making donations to this website?
Because there are lots of people here all the time trying to help others but i'm sure it costs money to run this site.

#### Attachments

• 253.6 KB Views: 31
• 278.2 KB Views: 29
• 264.6 KB Views: 29
Last edited:

Joined Dec 2, 2012
89
Here is some information I wrote in another post, but it seems relevant here also:

Now, as WBahn said, and I simply want to reiterate/stress this, K-Map states cannot be blank. The output of a flip flop is not blank. The don't care states are eventually broken into either a 1 or 0, depending on whether or not it is grouped in the minimization. Grouping is only valid for 2^n states(where n > 0), this means you can group 1,2,4,8,16, etc. and is only valid for rectangles.

This thread and some others made me realize the counters section of the e-book is lacking, so I wrote an section explaining counters from a design perspective and took on the modulus counter design. I will have it up in a thread for review in the next few days or so...
Thanks very much. I appreciate your guidance. The info you provided has been very useful.

Is there any link here for making donations to this website?
Because there are lots of people here all the time trying to help others but i'm sure it costs money to run this site.

#### tshuck

Joined Oct 18, 2012
3,534
I hope iv'e done them all right.
I worked out out why i was having the empty cells.
And it was because for a modulo 6 counter it toggles to
000 next state after present state 101. So the empty cells on the K-map
become Don't Cares.

Fingers crossed.
Looks like you understand the Karnaugh maps a little better now. I would suggest you learn to check your work. A simulator can help figure out the way your circuit behaves. I find that visualizing the behavior helps with the understanding. LogiSim is a good, easy-to-use simulator designed for digital circuits, and open-source to boot. That way, instead of crossing your fingers, you can know that the circuit works the way you expect it to!

Looking at your circuit, it appears to work and your logic sound. The circuit works in simulation. Good job!