problem on Mealy Moore State Diagram

Thread Starter

syed_husain

Joined Aug 24, 2009
61
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?:)

thanks in advance.
 

Attachments

Georacer

Joined Nov 25, 2009
5,182
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.
 

Thread Starter

syed_husain

Joined Aug 24, 2009
61
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?
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.


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.
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:

Georacer

Joined Nov 25, 2009
5,182
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:
http://www.allaboutcircuits.com/vol_4/chpt_11/5.html
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.
 

Georacer

Joined Nov 25, 2009
5,182
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.
 
Top