# problem on Mealy Moore State Diagram

Discussion in 'Homework Help' started by syed_husain, Apr 4, 2011.

1. ### syed_husain Thread Starter Active Member

Aug 24, 2009
61
5
it is a home work problem. i have to find the State table and diagram for both Moore and Mealy model. i have attached the question and my attempt in pdf file. Cud anyone give some feedback whether my attempt is right or wrong?

File size:
75.4 KB
Views:
62
2. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
The output (Y) of your state table is wrong. It is derived from A XOR B XOR Present State. The next state is not ready yet. Care to revise?

Also keep in mind that a 3 input XOR is a finder of odd populations of 1s. Thus 0 XOR 0 XOR 0 equals 0. You have other similar mistakes.

3. ### syed_husain Thread Starter Active Member

Aug 24, 2009
61
5
i am quite new with this state diagram. so my knowledge is quite lacking. as i understand it is a D-flipflop so next state = present state. i actually followed a bit similar problem mentioned in "Logic and Computer Design Fundamentals" -Mano, fourth edition, p225-226. as they derived the output equation based on present state. could u please elaborate why u said next state is not ready yet.

correct output eqn is A' XOR B XOR Q. A is inverted here. look at the circuit. i think that elilminates all the mistakes.

N.B. any suggestion would be much appreciated

Last edited: Apr 4, 2011
4. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
You are right about the output, it was a dumb mistake from my part. Sorry for the misconception.

Let's explain a bit about the present and the next state. I will refer to the present state as Q and the next state as Qn. You will also find it as Q' elsewhere.

The output is dependant only on present values. It cannot hold values for future use. Thus it is only reasonable that Y=A' XOR B XOR Q, as you have correctly written and calculated in your table.

If we are on discrete time k, the current output will be Y(k) = A'(k) XOR B(k) XOR Q(k). It is invalid to write Y(k)=A'(k) XOR B(k) XOR Q(k+1), even if the input seems to come from the output of the flip flop. Qn simply won't exist until the time k+1.

Mealy diagram is fine. The transitions of the Moore one are correct. The output however is wrong. Take a look here on how to build the output:
Make a note that I have made a mistake there: The output of the Moore machine is independent of the input, so it's a function of just Qa and Qb. I plan to correct it soon.

The problem with your diagram is that state 0 with output 0 is a different state than the one with FF state 0 with output 1. (First and second line of your state table). So in total you need 4 states to build the Moore machine.

5. ### syed_husain Thread Starter Active Member

Aug 24, 2009
61
5
i have corrected the moore model and attached it. please let me know whether it is correct or not.

btw, is my mealy model right?

• ###### Moore Model_corrected.pdf
File size:
56 KB
Views:
25
Last edited: Apr 6, 2011
6. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
The Mealy diagram is fine, as I said in the previous post.

Now, about the Moore one, well, yes and no. The problem is that the given circuit has an output dependent on the input de facto, so it is kinda unneeded and awkward to produce a Moore diagram from it. You have to make something not quite straightforward.

The rule is that the Moore diagram state names will be of the form State Name/Output. Each State Name must be unique for each state, so you can't use "1" and "0" for two separate states. But that means that you will need two bits to encode four states and consequently two Flip Flops, that will mean that you need to rebuild your state table.
Just forget it. It's not worth it. The Moore Diagram is typically correct, as long as you rename the states to have different names.

Those are my two cents.

syed_husain likes this.