2
\$\begingroup\$

For a class project, I am required to design a Moore Machine based on a problem that we were given. I have already done this with a Mealy Machine, but I am encountering errors with the Moore Machine. Specifically, my design won't "stick" to a state when it's supposed to. For example, when the input is 1,0 and it is in State1, and I toggle the clock but keep the input the same, it does not stay in State1. Referring to the state diagram may help you better understand what I am talking about.

state diagram

As you can see, my design needs to have 2 inputs. The input 0,1 is not valid for my design. The number in parentheses is the output for each state.

Here is my state transition table and karnaugh maps. The inputs are in the form (P,N), I forgot to add. Also, the input 0,1 is meaningless in my design.

state table

Karnaugh maps

Based on those, I got the equations

D2 = (N' * q2' * q1' * q0) + (P * N * q2 * q0') + (P * q2' * q1' * q0)

D1 = (P * N * q2' * q0') + (N' * q2 * q0')

D0 = P * N' * q0'

I'm afraid that my equations may be incorrect, I actually have no idea how to solve 5 variable K Maps (and we're not expected to for this class), so I used a program to solve them instead.

Using these equations, I tried to simulate it using LogicWorks. This is where I encountered the problem above. In certain situations it works, but it really doesn't work when I am trying to make it stay in a state. Any help?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ It seems quite likely that those equations are incorrect. Take a look at the D0 equation. One of the terms of D0 is q0'. Based on this equation it is never possible for D0 to be 1 if q0 is 1, but yet you're asserting that the state machine is allowed to stay in state1 based on the inputs. I'd suggest to recheck your equations again. \$\endgroup\$
    – Tim
    Apr 9, 2013 at 6:23
  • \$\begingroup\$ And if you're interested in doing so solving a 5-term karnaugh map isn't terribly difficult, you just have to imagine it as 2 4-term karnaugh maps stacked on top of each other, where you can draw '3d cubes' around terms just like how you would draw 'squares' around terms on a flat k-map. \$\endgroup\$
    – Tim
    Apr 9, 2013 at 6:27
  • \$\begingroup\$ Thank you, I didn't recognize that in my equation. I will try to manually check them. Hopefully the problem is something as easy as that. \$\endgroup\$
    – Bill
    Apr 9, 2013 at 6:32

2 Answers 2

2
\$\begingroup\$

Your state diagram has a number of errors so you need to fix those before you try to actually implement the machine. For example, from S0 you have two transitions labeled 0,0 and from S1 you have two transitions labeled 1,0. Carefully check all of the states and all of their transitions. There's no point in going any further until you have a correct specification for the machine.

\$\endgroup\$
0
\$\begingroup\$

If state encoding q2q1q0 = 001 = State1, and (P, N) = (1, 0) then

I can see that in equation,

D2 = (N' * q2' * q1' * q0) + (P * N * q2 * q0') + (P * q2' * q1' * q0)

N'=1, q2'=1, q1'=1 and q0=1, so first term (N' * q2' * q1' * q0) = 1 forcing q2 to 1 on next clock. That's definitely a problem.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.