# I need help with Extended Finite State Machines

Discussion in 'Homework Help' started by Ems1s7, Nov 28, 2014.

1. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
Last edited: Nov 30, 2014
2. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
What does the '/' symbol mean in your notation?

For instance, when you have "/T+ = T-1", what does that mean and how would it be different from "T+ = T-1"?

3. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
The symbol "/" just separate the states of the other things. Just for aesthetics
No difference between "/T+ = T-1" and "T+ = T-1".

4. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
Okay, thanks.

What are the inputs? s and x, or just s. What is x? Is it a 'always' condition?

When do the values of the variables change, upon entry into a state or on the next clock cycle?

5. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
The input is just s and yes, x is a 'always' condition.
The values do of the variables change, when upon entry into a state.

6. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
Okay, I think I have everything that I need to look over your work.

On the first clock when the system goes into the ERR state, what should the value of D become according to the diagram?

Ems1s7 likes this.
7. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
I think, that into the ERR state D = 2, because we see from the diagram, that before the first clock D = 2.

8. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
But in the bubble for the ERR state it says "D+ = 1" and you said that these take effect upon entering the state. I don't quite understand what the + means, but I've been assuming that it just means that the next value of D will be 1. This is why I asked if the changes take affect upon entering a state or on the next clock.

Is your nomenclature that "Fred = 5" means that Fred changes upon entering the state and "Fred+ = 5" means that Fred changes upon leaving the state? Note that in this context, if the system remains in the same state it can be considered to leave that state and then enter a new state that happens to just be the same one it left.

9. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
It's my mistake. Sorry! The values do of the variables change, on the next clock cycle.
You're right - "+" means that the next value of D will be 1.

Last edited: Nov 29, 2014
10. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
On the first clock, when the machine goes into the ERR state, the value of the variable T will be "-1", because T+ = T-1 => T+ = 0-1 = -1 (hexadecimal).
But I don't know, how to represent this value "-1"?

11. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
To represent negative values you need two things: First, you need a fixed width representation, so it's not enough to say that the value is represented in hex, you need to know if it is 8-bit or 32-bit or whatever. Second, you need an agreed upon representation for negative values. The most common representation is 2's complement. Are you familiar with that? If not, then that makes me suspicious that whoever came up with that diagram meant for things to be interpreted in such a way that nothing ever went negative -- but I'm speculating on that. In 2's comp, the values roll around life you would expect, so just as 0xFF would become 0x00 if you added 1 (for an 8-bit representation), so to will 0x00 become 0xFF if you subtract 1. Hence, 0xFF is the representation for -1. The representable values are positive if the most significant bit is 0 and negative if the most significant bit is 1. That's probably a good enough understanding for now for this problem.

Ems1s7 likes this.
12. ### Ems1s7 Thread Starter New Member

Nov 21, 2014
11
0
I understand that, but I don't know if it's 8-bit, 16-bit or 32-bit.
In the condition not write anything about a negative numbers.
So, I think that we have to interpret in such a way that nothing ever went negative.

In this case, what should the value of T, when the system goes into the ERR state?
We know that before the first clock T = 0.

Last edited: Nov 29, 2014
13. ### WBahn Moderator

Mar 31, 2012
18,079
4,917
Then I think you need to determine (not guess) what exactly is meant by, say, "T+ = N" versus "T = N". Hopefully your course material defines that terminology at the point that it is first introduced.

Ems1s7 likes this.