# How can I draw a Moore diagram for a given circuit?

I have a circuit and I should draw a moore diagram (state diagram) for that. ​ The problem is that every state can have 5 inputs and this makes the question hard for me. ​ I tried about 20 times to draw that diagram and every time I failed. ​ Can anyone help?

• " I tried about 20 times to draw that diagram and every time I failed." -- What specifically did you try? (Are there even that many potential automata?!) How did you fail? The more specific your question, the more likely is it you'll get a helpful answer. Also, it is not clear what "a Moore diagram for a circuit" should be. An automaton? A truth table? What are the inputs and outputs?
– Raphael
Feb 4 '16 at 13:53
• @raphael inputs are the keys and the output is the lamp. and about moore diagram, i mean something like this : american.cs.ucdavis.edu/academic/ecs154a/html.notes/moore.gif Feb 4 '16 at 14:00
• What's the input alphabet going to be? Are there 5 characters, each representing flipping one switch? Feb 4 '16 at 14:16
• @DylanSp assume every state as a five digit number. the first letter from the left is for 5th key. if 5th key is connected, that letter is 1 and if it's not, the letter is 0. Feb 4 '16 at 14:19
• @ArmanMalekzade But then how do we handle inputs/transitions? We can't distinguish whether an input of 1 means to turn switch 1, 2, 3, 4, or 5 on. I'm assuming we'd use an input alphabet of $\alpha, \beta, \gamma, \delta, \zeta$ (using $\zeta$ instead of $\epsilon$ to distinguish it from the no-input transition), with each character representing one switch. Feb 4 '16 at 14:24

Don't try to draw the automata. Because there will be 32 states each having five transitions. Rather try to describe the transition function and output as hinted by DylanSp. i.e.

q01001 -> 1 -> q11001 (output 1), meaning if switches 2,5 are on and you put on switch 1, the lamp is lighted.

Another one. q11001->2->q10001 (output 0), meaning if switch 1,2 and 5 are on and you put off switch 2 than the lamp is unlighted.

I assume that input consists of a sequence of 1,2,3,4,5 indicating which switch is flipped. starting state is q00000. I assume, final state will be probably those transitions where lamp is lighted, if that is what you are trying to do.

• you told me not to draw 32 states, but again what you're doing is working with 32 states ! Feb 4 '16 at 14:44
• Shreesh is saying to work out a table describing the transition function and output (which completely specifies the automata), but don't try to draw out all 32 states and their connection. Feb 4 '16 at 14:46
• @DylanSp i understand, but what should i do with my teacher ? :)) Feb 4 '16 at 14:49
• @ArmanMalekzade Pull out your textbook's formal definition of a Moore machine; it should be something along the lines of the tuple $(S, S_0, \Sigma, \Lambda, T, G)$ where $S$ is the list of states, $S_0 \in S$ is the initial state, $\Sigma$ is the input alphabet, $\Lambda$ is the output alphabet, $T$ is the transition function, and $G$ is the output function. Then make clear that your table completely specifies all of these. Feb 4 '16 at 14:55
• Giving a Moore machine as a 6-tuple is enough for any teacher. i.e. As $(S,S_0,\Sigma,\Lambda,T,G)$ according to Moore Machine Feb 4 '16 at 14:56