JK Flip-Flop Characteristic Equation

Discussion in 'Homework Help' started by Ryzaar, Jun 12, 2012.

1. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
Howdy. I've been struggling with a homework assignment to create a 4-bit combinational lock. I've so far created the state diagram, truth table (current state, next state etc) and karnaugh maps, but cannot simplify my equations to fit the JK format. Currently I have:

X(t+1)= I' Y' Z + I X' Z' + X Y'

Y(t+1) = X' Y Z' + I X Y' + I Y' Z + X Z

Z(t+1) = I' X' Y' + I' X' Z' + X Y' Z' + I X Y'

But of course I need it to follow the X'(Jx)+X(Kx') format. Could someone give me a hint as to how I might simplify it down? I have tried simplifying it from a POS and a SOP expression, but just can't seem to get it right. I can supply my diagrams/tables if it helps - I may have made a mistake!

EDIT: I represents the input. X, Y and Z represent the three flip-flops required, and (t+1) represents its value at the next clock cycle.
EDIT2: Just watched one of my lectures on this again, and it has totally confused me! I think I have this conversion process all wrong!
EDIT3: So by my new understanding, I've come up with this, but it means some terms are ignored:

Jx = IZ’
Kx = Y

Jy = IX + IZ
Kx = X’Z’

Jz = I’X’ + XY’
Kz = 1

I have a feeling this is wrong, but I'm just not understanding it!

Last edited: Jun 12, 2012
2. WBahn Moderator

Mar 31, 2012
18,087
4,917
There are a number of ways of approaching it, some more brute force than others.

Just to be sure we are working on the same page:

Q1) What is the truth table for a JK flip flop? Give inputs J and K and current state Q, what is Qn (Qn=Qnext)?

Q2) Let's say that I have a logic circuit, the details of which you know nothing about, but it puts out a logic value, A, and I tell you that whatever the output of that circuit is I want stored in a JK flip flop. Can you do that? If not, we can take a step back and do it in a couple of smaller steps.

While the approach used in Q2 will work in general, it will not result in the most efficient (in terms of minimal) logic. But let's deal with that once we have something that at least works.

3. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
This is what I've been taught for the JK flip-flop truth table

J | K | Qn
0 | 0 | Q (stays the same)
0 | 1 | 0 (reset)
1 | 0 | 1 (set)
1 | 1 | Q' (toggle)

J | K | Q | Qn
0 | 0 | 0 | 0
0 | 0 | 1 | 1
0 | 1 | 0 | 0
0 | 1 | 1 | 0
1 | 0 | 0 | 1
1 | 0 | 1 | 1
1 | 1 | 0 | 1
1 | 1 | 1 | 0

Is that what you were after?

As for Q2, know that they are used for storing values, but I can't quite remember how as it's been awhile since I touched up on JK flip-flops.

Oh and just to reiterate (I may have been unclear) - I am required to manipulate the equations to fit the format of the JK flip flops (e.g. X'(Jx) + X(Kx)).

EDIT: Going over some old notes, I see how we touched up on memory using two inputs S and R and NANDING them with the outputs of the opposite NAND gate, giving outputs P and Q. Are you asking for something similar to this?

Last edited: Jun 12, 2012
4. WBahn Moderator

Mar 31, 2012
18,087
4,917
Yes. We are on the same page.

When you set it, you are storing a 1 in it. When you clear it, you are storing a 0 in it. No more complicated than that.

Are you sure that isn't supposed to be

$
X_{next} = \bar{X}(J_x) + X(\bar{K_x})
$

Note the inversion on Kx compared to what you have.

Let's use an example that is similar to what you have:

An = A'BC'D + AB'C' + ABC + A'C'D' + BCD

Q3) What does this amount to if you gather terms so that you can write it in the form:

An = A(something) + A'(something_else) + (everything_else)

Q4) Given a logic expression B, what can I AND it with involves both A and A' but that is always 1 (and thereby not changing the value of the expression)?

Q5) With the answer to Q4 in hand, can you go back to Q3 and get the (everything_else) term to expand into something that can be incorporated into the (something) and (something_else) terms so that you have:

An = A(something) + A'(something_else)

Q6) What part of the answer to Q5 matches up with Jx and what part matches up with Kx?

5. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
Ah good, I was worried it was more complicated than that. And yes, that is what I meant, little typo there on my behalf

Q3)
An = A'BC'D + AB'C' + ABC + A'C'D' + BCD
An = A'(BC'D + C'D') + A(BC B'C') + BCD
An = A'(BC'D + C'D') + A(B XNOR C) + BCD

Q4) [I think this is where I've made the breakthrough I was looking for ]
An = A'(BC'D + C'D') + A(B XNOR C) + A'ABCD

Q5)
An = A'(BC'D + C'D' + ABCD) + A(B XNOR C)

Q6)
I'm not sure whether last term is inverted from (Kx)':
An = A'(BC'D + C'D' + ABCD) + A(B XOR C)
Or stays as I have it in Q5

Thanks for your help so far, you've really cleared things up!

EDIT: Let's say I'm drawing a circuit diagram for the equation you've given me above. The equation for the WHOLE JK flip-flop is what I've been working on. But for each input, is it:

Or do I still need to AND the A/A'?

Last edited: Jun 12, 2012
6. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
Wow, that wasn't very well thought out of me. Just realised that:

A'(BC'D + C'D' + ABCD)

Not A and A cannot be achieved at the same time... whoops. I'm honestly not sure where to go from here. A(0) ?

A(BCD) + A'(BCD) ?

7. MrChips Moderator

Oct 2, 2009
12,636
3,454
You do not use A and A' in the final solution.

There is an error in the term AA'BCD.

Maybe you meant (A + A')BCD.

Edit: We're cross posting.

8. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
Oops, don't know how that worked.

Nope, didn't mean that, but now I realise my error. Instead, I'm thinking this may be correct:

A(BCD) + A'(BCD)
[pretty much the expansion of what you've just posted]

EDIT: going by this, would this be the correct answer for my equations?

I don't need to complement the last term at all, do I?

Last edited: Jun 12, 2012
9. MrChips Moderator

Oct 2, 2009
12,636
3,454
Sorry to confuse you. I thought I had made an error and I deleted my post.
(A + A')BCD.

Once again, a Karnaugh map is a useful tool.
When you draw the Karnaugh map, you draw a line separating X and X'.
Hence you do not allow the X and X' terms to cross over.

The equation for JK flip-flop is

X(t+1) = JX' + K'X

Hence you have to complement K' in order to get K.

10. WBahn Moderator

Mar 31, 2012
18,087
4,917
I see that Mr. Chips has probably got you squared away, so I will just comment on your answers to my questions for completeness.

Good except for a typo in the second equation. The second term should be A(BC+B'C')

Write idea, wrong implementation. As you've already noted, A'A is always 0. But (A'+A) is always 1. So you have:

An = A'(BC'D + C'D') + A(B XNOR C) + (A'+A)BCD
An = A'(BC'D + C'D') + A(B XNOR C) + A'BCD+ABCD
An = A'(BC'D + C'D' + BCD) + A(B XNOR C + BCD)

Basically, you collect all of the terms that share A and all the terms that share A' and then you add all of the terms that have neither to both sets.

Look at what you are matching things up to.

You have:
An = A'(BC'D + C'D' + BCD) + A(B XNOR C + BCD)

You want:
An = A'J + AK'

That means that:

J = (BC'D + C'D' + BCD)
K' = (B XNOR C + BCD)

Note: I wouldn't have put in the XNOR so soon, because it can mask things. For instance, in the expression for K', if we expand it back out we have

K' = (B'C' + BC + BCD)
K' = (B'C' + BC(1+D))
K' = (B'C' + BC)

Which, now that we have the final SOP form, we can look for XORs and XNORs:

K' = (B XNOR C)
K = B XOR C

11. Ryzaar Thread Starter New Member

Jun 12, 2012
10
0
Thanks alot for your help, you've cleared everything up now!!

EDIT: Logically when I see this:
X(Y + I'Y'Z)
I feel it can be shortened to:
X(Y + I'Z)

As Y' will always be satisfied if the Y part isn't. E.g. if the first part of the OR function isn't satisfied, then it will always be Y', so there is no point including it in the second term.

Is there any proper way of cancelling this out?

EDIT: would I be allowed to add Y to both terms in the equation? E.g.

X(Y + I'Y'Z)
X(YY + I'YY'Z)
X(Y + I'Z)

Last edited: Jun 12, 2012
12. MrChips Moderator

Oct 2, 2009
12,636
3,454
No. You are still making the same mistake. YY' = 0.

13. WBahn Moderator

Mar 31, 2012
18,087
4,917
No, but your description is on the right track. Since it is true if Y is true, that means it is also true if ANY expression that is ANDed with Y is true (i.e., such an expression is sufficient, though not necessary, for the expression in parentheses to be true).

Consider this:

X(Y + I'Y'Z)
X(Y(1+I'Z) + I'Y'Z)
X(Y(1)+ YI'Z + I'Y'Z)
X(Y+ (Y+Y')I'Z)
X(Y+ I'Z)