# Calculate the next state for flip flop sequential circuit

Based on my previous question, i managed to draw out the truth table

Inputs for flipflops sequential circruits

|------|------|------|----|----|----|----|---------|---------|---------|
| QA   | QB   | QC   | JA | KA | DB | TC | QA(t+1) | QB(t+1) | QC(t+1) |
|------|------|------|----|----|----|----|---------|---------|---------|
|  0   |  0   |  0   | 0  | 0  | 1  | 0  |    0    |    1    |    0    |
|  0   |  0   |  1   | 0  | 0  | 1  | 0  |    0    |    1    |    1    |
|  0   |  1   |  0   | 0  | 0  | 0  | 0  |    0    |    0    |    0    |
|  0   |  1   |  1   | 0  | 0  | 0  | 0  |    0    |    0    |    1    |
|  1   |  0   |  0   | 1  | 1  | 1  | 0  |    0    |    1    |    0    |
|  1   |  0   |  1   | 1  | 1  | 1  | 0  |    0    |    1    |    1    |
|  1   |  1   |  0   | 1  | 1  | 0  | 0  |    0    |    0    |    0    |
|  1   |  1   |  1   | 1  | 1  | 0  | 0  |    0    |    0    |    1    |


Start from state 7 (111) i need to have the next two states. But i am not sure if my QA(t+1) and QB(t+1) and QC(t+1) are correct. Trying to learn it by myself on youtube but it is quite hard..

|------|------|------|----|----|----|----|---------|---------|---------|
| QA   | QB   | QC   | JA | KA | DB | TC | QA(t+1) | QB(t+1) | QC(t+1) |
|------|------|------|----|----|----|----|---------|---------|---------|
|  0   |  0   |  0   | 0  | 0  | 1  | 0  |    0    |    1    |    0    |
|  0   |  0   |  1   | 0  | 0  | 1  | 0  |    0    |    1    |    1    |
|  0   |  1   |  0   | 1  | 1  | 0  | 0  |    1    |    0    |    0    |
|  0   |  1   |  1   | 1  | 1  | 0  | 0  |    1    |    0    |    1    |
|  1   |  0   |  0   | 0  | 0  | 1  | 0  |    1    |    1    |    0    |
|  1   |  0   |  1   | 0  | 0  | 1  | 0  |    1    |    1    |    1    |
|  1   |  1   |  0   | 1  | 1  | 0  | 0  |    0    |    0    |    0    |
|  1   |  1   |  1   | 1  | 1  | 0  | 0  |    0    |    0    |    1    |

• Hmm so both of my truth tables are wrong? Not too sure what u mean.Perhaps u can leave an answer to explain further? – Mason Nov 15 '19 at 15:01
• A 1 input to a T(oggle) flip-flop will cause flip-flop to toggle, a 0 input leaves the outputs unchanged. – StainlessSteelRat Nov 15 '19 at 15:15
• middle FF does divide-by-2; that output enables the J above it, which becomes a divide-by-four (if I recall the behavior of a JK); does the bottom FF ever toggle? I think not. – analogsystemsrf Nov 15 '19 at 16:08

I'm afraid you have made a mistake in filling the JA and KA columns. You need only to copy the QB(t) column for JA and KA as both JA and KA are only connected to QB(t).

Your QC(t+1) and QB(t+1) columns are correct but you need to apply the modification i stated above to your JA and KA in order to get the correct answer for QA(t+1).

If you replace JA and KA in the equation for QA(t+1), you will get: QA(t+1) = (QA(t)' AND QB(t)) + (QA(t) AND QB(t)') = QA(t) XOR QB(t)

So the fastest way to compute QA(t+1) is that you would toggle QA(t) whenever QB(t)==1 and leave QA(t) unchanged whenever QB(t)==0.

• Hi there, updated my answer because i can't really visualize the words. Would that be correct? I'm more confused now because there is another answer which seems to be quite different. – Mason Nov 15 '19 at 13:30
• Hi, yes the new version of your table seems to be correct. I find the edited version of the other answer to be consistent with my answer and your new table. – Moeen Tayebi Nov 15 '19 at 13:43
• @Mason I was wrong, Moeen was right with the T-flipflop. My bad, long time since I worked with T-flipflops – Swedgin Nov 15 '19 at 13:43
• No worries. Upvoted both for all ur efforts. Thank you. – Mason Nov 15 '19 at 13:46

Since QB is connected to both J and K we know that QA(t+1) will toggle when B is 1 and will remain the same if B is 0

QC(t+1) = QC since T is always 0

Lastly B will always toggle since the QB' goes to the input.

So starting from state 7 (111):

QC(t+1) = 1 QB(t+1) = 0 QA(t+1) = 0 (it toggles since J and K are both 1)

So now we have the state (001). Next state:

QC(t+1) = 1 (input is 0 so QC remains high) QB(t+1) = 1 (QB' = 0) QA(t+1) = 0 (it stays 0 since J and K are both 0)

~~

So in short: (111) -> (001) -> (011)

• Hi there, thanks for the answer. But the format for T flipflop seems to have 0 and it does not seem to be always 1. google.com/…: – Mason Nov 15 '19 at 12:55