# Need help with timing diagram of Flipflop

#### koshi

Joined Sep 25, 2014
27
Hi, can anyone teach me how to derive the timing diagram for J?

#### WBahn

Joined Mar 31, 2012
27,392
Just walk through each signal in turn making changes to the output of each logic element when the inputs to that element change.

You are given CLK, A, and B, right? You also have to be given the initial state of Q, which is apparently LO.

Do you see how K is derived from A throughout the diagram?

Do you see how B' was derived from B throughout the diagram?

Given the initial value of B' and Q, do you see how the initial value of J is determined (not throughout the diagram, since it depends on feedback from Q)?

At the first falling edge of CLK (which is what the FF is sensitive to) what are the values of J and K?

Do you see why the FF changes the way it does at the first falling edge?

Does that help?

#### koshi

Joined Sep 25, 2014
27
Hi Bahn, the initial question only provide the timing diagram for A and B and I was told to find Q/Q+. I know how to find the rest of the values, I am just confused how you derive J, since Q is not provided. The only thing that is provided for Q is low before the 1st CLK cycle. How do J get high for 4 clk cycles?

#### WBahn

Joined Mar 31, 2012
27,392
You are given CLK, A, B, and the initial value of Q, right? So, at that moment, what are the inputs to the OR gate?

#### koshi

Joined Sep 25, 2014
27
From Bbar is high and initial of Q is low so OR gate outputs high?

#### koshi

Joined Sep 25, 2014
27
Actually this is the original question. I am not sure whether you thought that the Q is given.

#### WBahn

Joined Mar 31, 2012
27,392
From Bbar is high and initial of Q is low so OR gate outputs high?
Okay, so add B' to your diagram. Since it only depends on B and since you know B for the entire time, can you draw B' for the entire time?

Add J to the diagram. Since you know B' and Q initially, can you draw J initially? What is the first time that Q can possibly change? Draw J up to that point.

Add K to the diagram. Can you draw K for the entire time?

Now look at that first time that Q can possibly change. What information do you need to know in order to know what Q becomes next? Do you have that information? If so, then draw the next value of Q and extend it ad far as you can before you reach the next moment when Q could change.

Now update your other signals with that new information. Keep repeating this process until you get to the end of the diagram.

#### JoeJester

Joined Apr 26, 2005
4,390