1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Design a Moore type synchronous state machine with only two

  1. Apr 21, 2007 #1
    1. The problem statement, all variables and given/known data
    (Problem 226) Design a Moore type synchronous state machine with only two
    states, two external inputs X1 and X2, and one output Z. When X1 X2 = 1 at the
    next clock timing event, output Z goes to 1. Output Z then goes to 0 unless X2 = 1
    causing the output to stay at 1. Use positive edge-triggered JK
    flip-flops in your
    design.


    2. Relevant equations


    3. The attempt at a solution

    would like tips on how to even begin an attempt
    currently reading wakerly chapter 7 to cover the basis of the problem
     
    Last edited: Apr 21, 2007
  2. jcsd
  3. Apr 25, 2007 #2

    berkeman

    User Avatar

    Staff: Mentor

    What does a Moore machine look like. Show us your state transition diagram, and we can help if you still are confused.
     
  4. Apr 25, 2007 #3
    I posted the digital design problems and I actually have solved two out of the three of them.

    My major question was with :

    In the lecture notes we're taught how to design an FSM with one input and depending on the output equation if it includes the external input - then we decide whether its a mealy or a moore machine.

    However here we have two external inputs - i'm having trouble coming up with the truth table -

    a 1 input truth table may look like this:
    Code (Text):

             | x = 0  x = 1 | (OUTPUT)
    states |  Q1Q0     Q1Q0|   Z1  Z2
    A..........A ........B....|1    1
    B..........B ........C....|1    0
    C..........C ........D....|1    1
    D..........D ........A....|0    0

    where
    A = 00
    B = 01
    C = 10
    D = 11
     
    my problem is i don't know how to structure the truth table nor the state diagram with two inputs.

    All i know is that
    1) its a moore model
    i.e. the output equation is only a function of its present state and not the input
    2) I know how to design the problem once i get the logic table or state diagram.

    3) the only time the output is z = 1
    is when

    X1' . X2 = 1

    how would we describe that?

    would that be like ...

    Code (Text):


             | X1 = 0  X1 = 1 |  X2 = 0   X2 = 1
    states   |  Q1Q0      Q1Q0| Q1Q0     Q1Q0  
    A..........A ........B... |.........ETC ETC..
    B..........B ........C....|
    C..........C ........D....|
    D..........D ........A....|
     
    then how would we show both X1'X2 = 1 ?

    we would have a feedback design with these extra inputs asserted.

    or ...

    Code (Text):

            |X1X2 = 00  X1X2=01   X1X2=10    X1X2 = 11|
    states|Q2.Q1.Q0  Q2.Q1.Q0   Q2.Q1.Q0   Q2.Q1.Q0| OUTPUTS  
    ....................................................................................
    .....................................................................................
    .....................................................................................
    .....................................................................................
    .....................................................................................
     
    then using the J/K flip flop excitation table - which is
    lol i'm very lost. Please help
     
    Last edited: Apr 25, 2007
  5. Apr 25, 2007 #4

    berkeman

    User Avatar

    Staff: Mentor

    Have you learned how to draw the state transition diagram? Draw the states as circles, and the transitions from state to state depend on the two inputs (and which state you are in, obviously). The outputs depend only on the state you are in, as you said.
     
  6. Apr 25, 2007 #5
    I've learned how to draw state diagrams but should we tackle this question from the timing diagram first?

    Edit: I think i may have the state diagram
    I'll draw the state diagram up on paint just one second
     
    Last edited: Apr 25, 2007
  7. Apr 25, 2007 #6
    Sorry ... i don't know what i was thinking with the above post

    [​IMG]
     
  8. Apr 25, 2007 #7

    berkeman

    User Avatar

    Staff: Mentor

    The diagram is a mix of Mealy and Moore styles. Remember, the output is determined only by the state in a Moore machine, so you don't label the transitions with an output:

    http://en.wikipedia.org/wiki/State_diagram
     
  9. Apr 25, 2007 #8
    so in this case - would it be safe to say that
    states are
    A = 0
    B = 1

    would it then look like this?
    [​IMG]
     
  10. Apr 25, 2007 #9

    berkeman

    User Avatar

    Staff: Mentor

    That better. I'm still a bit confused by your statement of the problem, though:

    X1 X2 = 1 ? X1 X2 is a 2-bit binary number. Do you mean X1 X2 = 01 ?
     
  11. Apr 25, 2007 #10
    sorry i still don't know how to implement this with two inputs - wouldn't that mean that our states would have arrows dependent on 8 combinations of arrows?
     
  12. Apr 25, 2007 #11
    this is what the question says
    actually to be quite honest i don't know if the professor meant x1 and x2 or if both x1 and x2 = 1 ... i think they may be the same thing lol.

    I think the professor might have and'ed both x1' x2 so that its only asserted high when x1 = 0 and x2 = 1.

    Its a guess - let me check out the student help forum on our webct. Just a sec
     
  13. Apr 25, 2007 #12
    fraid not. The help section is riddled with "How do I draw a timing diagram" like questions. The professor didn't state anything else. I think it has to be :
    __
    X1 = 1
    X2 = 1

    then we have like a latching effect, as long as x2 is 1 the state doesn't change unless x2 changes.

    thanks for your help thus far
     
  14. Apr 25, 2007 #13

    berkeman

    User Avatar

    Staff: Mentor

    Once you have the state transition diagram, you can put it into tabular form something like this:

    Present State (with output), Inputs, Next State. Kind of like in this tutorial:

    http://www.mee.tcd.ie/~flooddk/2e6/Tutorial4Solutions.pdf

    Can you take a cut at writing this table out?
     
  15. Apr 25, 2007 #14
    Code (Text):

    initial state final state
             X2 = 1               z
    q2 q1 q0      Q2  Q1   Q0
    0   0   1     1   1    1       1
    0   1   0     1   1    1       1
    0   1   1     1   1    1       1
    1   0   0       ETC
    1   0   1
    1   1   0
    1   1   1

             X2 = 0                   z
    q2 q1 q0       Q2   Q1 Q0
    0   0   1      0    0   0        0
    0   1   0      0    0   0        0
    0   1   1         ETC
    1   0   0
    1   0   1
    1   1   0
    1   1   1
     
    WHEN X2 = 1 are all values asserted positive? if its a moore model than the values of x shouldn't matter when determining z.

    what do we fill in for the next state since no sequence is given

    I've done these problems when designing a a ckt from a sequence or a state diagram but not where theres two inputs such as x1,x2 - does that mean i need four columns for

    q2 q1 q0 | Q1 Q2 Q0

    ?
     
    Last edited: Apr 25, 2007
  16. Apr 25, 2007 #15

    berkeman

    User Avatar

    Staff: Mentor

    I think that your interpretation is probably correct here. You can draw the 2-state transition diagram based on this interpretation. And then the implementation is fairly easy I think. You just need to design the combinatorial logic that feeds X1 and X2 into a JK flip-flop, and results in the two outputs shown in your diagram.
     
  17. Apr 25, 2007 #16
    [​IMG]
    [​IMG]

    is the example we have - as you can see we have two mini tables for one input x - so does that mean we need 4 mini tables for 2 inputs x. Also what goes in for our Q state? i know we calculate it using J/K equations but since we have only two states does that mean we have a 2 x 4 row table?

    or
    Code (Text):

       x1x2 = 00    x1x2 = 01  x1x2 = 01     x1x2 = 01
       q2q1q0       q2q1q0      q2q1q0        q2q1q0      
    ------------------------------------------------
    A|
    B|
     
    do we design a latch like circuit such that the circuit continues only when x2 = 1, or asserted? Then workout the J/k equations for our intial states q2q1q0 ?

    ALso with the above table idea we don't know the combinations we need for the output. Only that
    Code (Text):

    q Q | J  K
    0 0    0x
    0 1    1x
    1 0    x1
    1 1    x0
     
    yet we don;t have a pattern for the final inout - i'm lost.
     

    Attached Files:

  18. Apr 25, 2007 #17
    berkman i think i got the truth table

    Code (Text):

    for states
    A=0
    B=1



    [img]http://img248.imageshack.us/img248/6757/truthtablevk1.jpg[/img]
     
  19. Apr 25, 2007 #18
  20. Apr 25, 2007 #19
    [​IMG]

    lol i can get the ckt diagram from this alone now.

    Thanks a tonne for the push in the right direction. I guess I was sleep deprived last night and couldn't think straight. Thanks alot for your help.
     
  21. Apr 26, 2007 #20

    berkeman

    User Avatar

    Staff: Mentor

    Good job! :biggrin:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Design a Moore type synchronous state machine with only two
  1. Moore Machine Design (Replies: 0)

Loading...