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

Discussion Overview

The discussion revolves around sketching the Moore state diagram for a sequential circuit using J-K Flip Flops, with a focus on the input variable A and its effect on the state transitions. Participants explore the layout and representation of the state diagram, including the implications of different input values on the outputs of the flip-flops.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant describes the initial conditions of the circuit, noting that Q[2:0] starts at 000 and discusses the layout of the Moore diagram.
  • Concerns are raised about how to represent states when the input A changes, particularly when A=0 and A=1, and whether to depict intermediary states or self-loops in the diagram.
  • Another participant suggests starting with a truth table to determine the next states based on the current state and input A, emphasizing that not all states may be reachable from the initial state.
  • There is a discussion about the total number of states possible with three flip-flops and the need to consider transitions for both A=0 and A=1 for each state.
  • One participant expresses uncertainty about whether to include certain states that cannot be reached from the initial state in their diagram, while others suggest that all states should be represented for clarity.
  • Comments are made regarding the conventional numbering of states and the representation of illegal states in the diagram.

Areas of Agreement / Disagreement

Participants generally agree on the need to represent all possible states in the diagram, but there is disagreement on whether to include states that cannot be reached from the initial state. The discussion remains unresolved regarding the best approach to depict these states.

Contextual Notes

Some participants note the importance of ensuring that illegal states have transitions back to the reset state to prevent the circuit from hanging. There are also mentions of conventions in logic design regarding state numbering and representation.

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: 891
Physics news on Phys.org
My working solution :)
 

Attachments

  • solution.jpg
    solution.jpg
    53 KB · Views: 667
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: 526
  • moorefull.jpg
    moorefull.jpg
    39 KB · Views: 525
  • mooresimplified.jpg
    mooresimplified.jpg
    30.6 KB · Views: 653
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
7K