# Build state diagram from mod 5 counter

Discussion in 'Homework Help' started by Asheara, Nov 29, 2016.

1. ### Asheara Thread Starter New Member

Nov 3, 2016
11
0
Hi guys,

I have this exercise about Moore I have to deliver today done but I would like to be sure if it is correct, so if you could take a look and validate my work that'd be great.

Si+1 = (Si + E) mod 5

This a mod 5 counter, on each clock rise Si+1 is calculated incrementing the previous S from the previous clock rise based on value received in E.
This E has 2 bits and can value 1, 2 or 3. Value 0 can't never happen.
At initialization moment, S should be 0 (S0=0)

For example, if E = 2, S values on each clock rise will be: 0,2,4,1,3,0.

E is asynchronous and can change at any moment.
S is synchronous and should be constant during the clock cycle.
The considered value of E to make the transition of each Si is the value just at the rise edge.

So far I have this state table and state diagram below, if someone could just validate if im following the correct path please or give me a clue about what am I doing wrong.

Thank you!

2. ### WBahn Moderator

Mar 31, 2012
23,384
7,096
You need to start looking at your own solutions and determining if they are correct.

Start with the low hanging fruit. If E has three possible values, then shouldn't each state have three arrows leaving it? Do they?

Isn't there a simple pattern to where the arrows go from a particular state? Do the arrows in your diagram follow that pattern?

Does it make sense for the arrows from a given state to end up in the same next state for different values of E? Do you have any states that have this behavior?

You stated that E can never be 0, yet your table includes situations in which E = 0 but does not include all situations in which E = 3.

Do you really need someone half way around the world pointing these kinds of things out to you?

3. ### Asheara Thread Starter New Member

Nov 3, 2016
11
0
Hi,

You're right, the table has errors, E can't be 0, so Im modifying it to fix it and fix the state diagram in consequence.

Thank you,

4. ### Asheara Thread Starter New Member

Nov 3, 2016
11
0
Hi,

I think this makes more sense:

5. ### WBahn Moderator

Mar 31, 2012
23,384
7,096
That looks fine.