Sketching the Moore state diagram of a sequential circuit with J-K Flip Flops

  • Context: Engineering 
  • Thread starter Thread starter bd411
  • Start date Start date
  • Tags Tags
    Circuit Diagram State
Click For Summary
SUMMARY

The discussion focuses on sketching the Moore state diagram for a sequential circuit utilizing J-K Flip Flops, with the input variable A and an initial state of Q[2:0] = 000. Participants emphasize the importance of creating a truth table to determine state transitions based on the input A, which can be either 0 or 1. Key insights include the necessity of representing all possible states (000 to 111) and ensuring that illegal states have transitions back to the reset state to prevent circuit lockup. The final diagram should clearly indicate state transitions and outputs for each state.

PREREQUISITES
  • Understanding of Moore state machines
  • Knowledge of J-K Flip Flops operation
  • Familiarity with state transition diagrams
  • Ability to create truth tables for sequential circuits
NEXT STEPS
  • Learn how to construct truth tables for sequential circuits
  • Study the differences between Moore and Mealy state machines
  • Explore J-K Flip Flop timing diagrams and their implications
  • Investigate techniques for handling illegal states in state diagrams
USEFUL FOR

Electrical engineers, digital circuit designers, and students studying sequential logic design will benefit from this discussion, particularly those working with state diagrams and J-K Flip Flops.

bd411
Messages
39
Reaction score
0

Homework Statement


Sketch the moore state diagram for the circuit shown in the figure, where A is the input variable. You may assume initially that Q[2:0] = 000.

CLK = clock.

The box with the & inside is an AND gate.

Q[2:0] means that initially Q0, Q1, and Q2 = 0 and hence there inverses are equal to one.

Homework Equations



None.

The Attempt at a Solution



I understand the layout of the Moore diagram, a bubble for each state, with a slash and the corresponding output next to it.

XX / XX

STATE NUMBER
OUTPUT OF THAT STATE

Furthermore, an arrow is used to represent all possible transitions between states and the labels on the arrows show the required conditions for the transit.

What I am having issues with is actually drawing the diagram. Supposing A = 0, when the first clock pulse arrives, Q2 will still be 0. This will happen continuously as long as A = 0.

The difficulty arrives when we set A=1, then as far as I can see the output of Q2 will STILL be 0 ? Do I represent this as an intermediary state, with output still 0 as was the output of Q2 was in state 1, or just draw an arrow from state 1 to itself ?

Supposing the next A=1 is input at the clock pulse, will the output of Q2 STILL not be 0? (as the one hasn't travlled through the circuit yet). Once again, intermediary state ? I believe that at the next A = 1 clock pulse the output of Q2 will be 1.

Supposing another A = 1 (this time K=1 too), the output of Q2 will now be 0 again.

I haven't even considered instances where a 1 is followed be a 0, or 2 1's are followed be a 0. I feel like I am thoroughly overcomplicating this problem and any guidance will be very much appreciated !

I have attached the question and my partial solution.

 

Attachments

  • photo.jpg
    photo.jpg
    48.1 KB · Views: 880
Physics news on Phys.org
My working solution :)
 

Attachments

  • solution.jpg
    solution.jpg
    53 KB · Views: 656
bd411 said:

Homework Statement


Sketch the moore state diagram for the circuit shown in the figure, where A is the input variable. You may assume initially that Q[2:0] = 000.

CLK = clock.

The box with the & inside is an AND gate.

Q[2:0] means that initially Q0, Q1, and Q2 = 0 and hence there inverses are equal to one.

Homework Equations



None.

The Attempt at a Solution



I understand the layout of the Moore diagram, a bubble for each state, with a slash and the corresponding output next to it.

XX / XX

STATE NUMBER
OUTPUT OF THAT STATE

Furthermore, an arrow is used to represent all possible transitions between states and the labels on the arrows show the required conditions for the transit.

What I am having issues with is actually drawing the diagram. Supposing A = 0, when the first clock pulse arrives, Q2 will still be 0. This will happen continuously as long as A = 0.

The difficulty arrives when we set A=1, then as far as I can see the output of Q2 will STILL be 0 ? Do I represent this as an intermediary state, with output still 0 as was the output of Q2 was in state 1, or just draw an arrow from state 1 to itself ?

Supposing the next A=1 is input at the clock pulse, will the output of Q2 STILL not be 0? (as the one hasn't travlled through the circuit yet). Once again, intermediary state ? I believe that at the next A = 1 clock pulse the output of Q2 will be 1.

Supposing another A = 1 (this time K=1 too), the output of Q2 will now be 0 again.

I haven't even considered instances where a 1 is followed be a 0, or 2 1's are followed be a 0. I feel like I am thoroughly overcomplicating this problem and any guidance will be very much appreciated !

I have attached the question and my partial solution.

bd411 said:
My working solution :)

Welcome to the PF.

You have 3 FFs, so how many possible states are there?

And when you are in a particular state, the input A can be either a 1 or a 0 to affect the transition to the next state at the next clock rising edge.

So I would start with a truth table with all the states listed, and then list what the next state will be for both the case of A=0 and A=1. Once you have the table, you can draw the diagram.

Note that all the states in the table may not be reachable starting with the outputs = 000. In real circuit design, we make sure that these "illegal" states have a transision back to the reset state (in this case 000), to be sure the circuit does not hang if there is a disturbance (like an ESD hit) that temporarily scrambles the circuit.
 
Okay, I see what you mean. So with 3 flip flops I have the following states,

000, 001, 010, 011, 100, 101, 110, 111.

So what you're saying is that these states should be the contents of my bubbles and then I need to consider what state they would transition to if A = 1 or A = 0, and draw my arrows accordingly.

I'll give that a go. Many thanks and much appreciated !
 
Ok, I have considered the A= 0 and A= 1 case for each and every state and here are my results. If you could verify them, as well as checking my diagrams and telling me if I could omit certain states (as they cannot be obtained from 000), then I would be extremely grateful !

Thanks for your time,

Biren
 

Attachments

  • states.jpg
    states.jpg
    34.7 KB · Views: 510
  • moorefull.jpg
    moorefull.jpg
    39 KB · Views: 513
  • mooresimplified.jpg
    mooresimplified.jpg
    30.6 KB · Views: 639
bd411 said:
Ok, I have considered the A= 0 and A= 1 case for each and every state and here are my results. If you could verify them, as well as checking my diagrams and telling me if I could omit certain states (as they cannot be obtained from 000), then I would be extremely grateful !

Thanks for your time,

Biren

Looks like good work. I didn't check the state transitions in detail, but a few comments:

** Note how in the original problem statement, even though the FF outputs are numbered left to right as Q0, Q1, Q2, the ordered triple Q[2:0] has the FF outputs listed right to left. that is generally the convention in logic design, so you should re-number your HDL listing (the left page) and the state diagram accordingly.

** Also, it is the convention to call the first state "0" and go up from there. So instead of numbering the states 1-8, you should probably renumber them 0-7.

** In the full diagram in the middle, you can move the final "illegal" state (now to be renumbered as state 7) over to the left to put it adjacent to the 000 state. Does it actually naturally go to the 000 state? (I'll check that when I have time)

** I'm not sure what you mean by your 2nd state diagram, only showing some of the states. The circuit with 3FFs is capable of all 8 states, so I'm thinking you should show them all. Did I miss something?

:smile:
 
Does it actually naturally go to the 000 state? (I'll check that when I have time)

Yes, it looks like it does.
 
Thanks so much ! I really appreciate it.

With regards to the second state diagram, I was thinking that certain states cannot be obtained by starting from 000 (bar some external factor), and therefore wondered if leaving those states out (perhaps with an explanation) would be ok ? Of course, this shouldn't make any difference as long as my solution has the full state diagram too !
 
bd411 said:
Thanks so much ! I really appreciate it.

With regards to the second state diagram, I was thinking that certain states cannot be obtained by starting from 000 (bar some external factor), and therefore wondered if leaving those states out (perhaps with an explanation) would be ok ? Of course, this shouldn't make any difference as long as my solution has the full state diagram too !

Yes, definitely show the full diagram first. You could even highlight the "illegal" states, and mention that they are shown to ensure that there is a path back to the "normal" states from them. That is what we have to do in the real world, or else you can end up with a chip that can lock up and not recover after a transient event.

You could optionally then show a simplified diagram of just the regular states that the machine goes through in normal operation. Or alternately, you could draw the full diagram with a box around the normal states, and the "illegal" states outside that box, with their transitions shown going to the states inside the box.
 

Similar threads

  • · Replies 31 ·
2
Replies
31
Views
4K
Replies
5
Views
4K
Replies
20
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
6K