Simple yet confusing JK FF conversion to D FF

Thread Starter

danatic

Joined Jul 4, 2015
34
https://imgur.com/a/wc86a06

This is a really confusing question because of the next state input. What would be the answer? I got XOR but I am not confident whether it is the correct way to approach this question. Could someone help verify if I am correct?

My workings is as follows:
Q is taken from the previous clock and J is always dictated by A.

If Q=0 and A=0, then both inputs need to be 0 (keep previous state).

If Q=1 and A=0, then we need J=0 and K=1 (kill). J=K=1 (toggle) would do the same, but is not possible, because J would contradict with A.

If Q=0 and A=1, then we can either use J=1 and K=0 (jump), or we can also use J=K=1 (toggle). We do the latter.

If Q=A=1, then we need J=0 and K=0 (keep current state) - this is however not possible with the given circuit (J=A is always the case), but we can try J=1 and K=0 (jump), which will do the same now.

Now we can make a simple truth table for K.

Q A K
0 0 0
0 1 1
1 0 1
1 1 0
This table is equivalent to K = Q XOR A

Note that for JK FF conversion to D FF, the logic circuit is an inverter without the feedback input. So if we try and force the K input to be inverted and equate K=Function(A,Q(n+1), I think XOR gate is the answer.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,086
First start with the defining behavior of a J-K FF

J | K | Q(n) | Q(n+1)
0 | 0 | Q | Q
0 | 1 | x | 0
1 | 0 | x | 1
1 | 1 | Q | Q'

Now consider the defining behavior of a D FF

D | Q(n) | Q(n+1)
0 | x | 0
1 | x | 1

Now apply the constraints of your circuit and the desired behavior

A| Q(n) | J | K | Q(n+1)
0 | 0 | 0 | ? | 0
0 | 1 | 0 | ? | 0
1 | 0 | 1 | ? | 1
1 | 1 | 1 | ? | 1

Now determine what K has to be for each combination

A| Q(n) | J | K | Q(n+1)
0 | 0 | 0 | x | 0
0 | 1 | 0 | 1 | 0
1 | 0 | 1 | x | 1
1 | 1 | 1 | 0 | 1

So K can be one of four functions of A and Q. These are

A'·Q
A'⊕Q
A'
(A·Q)'

Of these, I know which one I'd pick. Don't use feedback if it's not needed, so just set K = A'

If I HAD to use a two-input function, I'd also use the NAND before the XOR. In fact, I'd use the XOR last since the first one can be rewritten as

A'·Q = (A+Q')'

which is just a NOR on two already available signals.
 

Thread Starter

danatic

Joined Jul 4, 2015
34
Thanks alot WBahn!

Your approach in analyzing this question is systematic and rigorous, which is exactly what I am looking for.

If this question was tweaked alittle, I would be able to use your method to try and solve it. You are awesome! :)
 

WBahn

Joined Mar 31, 2012
30,086
Thanks alot WBahn!

Your approach in analyzing this question is systematic and rigorous, which is exactly what I am looking for.

If this question was tweaked alittle, I would be able to use your method to try and solve it. You are awesome! :)
Thanks for the compliment.

Usually the hardest part of solving any engineering problem is understanding the problem. So one of the most valuable skills that you can develop is the ability to come at a problem description from many different angles and pick it apart and determine the most reasonable way of interpreting it (as well as any reasonable alternatives). Then, in the real world, you take those to the customer and see if the two of you can get on the same page -- which is sometimes the second hardest part of solving an engineering problem.

So while no one likes poorly phrased questions, in reality they offer the greatest opportunity to learn this highly valuable skill -- as frustrating as it can be.
 
Top