# I don't understand this part.

#### Uyet123

Joined Jan 25, 2015
29
Hi, I am looking at my lecture notes but I don't understand how he got the state equations from this state table

and this part as well

Please tell me how they came up with those equations.

#### Papabravo

Joined Feb 24, 2006
14,883
He got those equations by looking at the rows of the state transition table.
Ask your self what condition(s) exist among the present inputs, the present state, and the present outputs, that should allow the bits of the state register to be set to 1.

#### Uyet123

Joined Jan 25, 2015
29
Yeah I get that, but for the first table for DG0, shouldn't it be T0S + T1 + T1A3 + T1A3A4. Why is it only T0S + T1

#### Papabravo

Joined Feb 24, 2006
14,883
Yeah I get that, but for the first table for DG0, shouldn't it be T0S + T1 + T1A3 + T1A3A4. Why is it only T0S + T1
Because T1=1 covers 3 rows and the values of A3 and A4 don't matter, then T0S covers the remaining row and again A3 and A4 don't matter.

#### djsfantasi

Joined Apr 11, 2010
7,250
To answer your last question, you need to do a little Boolean algebra. What state is present in several of the terms? Can you simplify the equation at all using the answer to the previous question? What is the result?

#### Uyet123

Joined Jan 25, 2015
29
Why do A3 and A4 do not matter, isn't it set to 1 in one of the rows?

#### Uyet123

Joined Jan 25, 2015
29
Ok I did the simplification: = T0S + T1 + T1A3 + T1A3A4
= T0S + T1 + T1(A3 + A3A4)
= T0S + T1 + T1(A3) //X + XY = X
= T0S + T1 //X + XY = X

Is this right? Haven't done simplification in ages.

#### Papabravo

Joined Feb 24, 2006
14,883
In the row coverd by the term T0⋅S, A3 and A4 are marked with X's which stand for don't care.
In the three rows covered by the term T1, A3 can be either a 0 or 1, and A4 can be either 0 or 1. When a Boolean variable can be either a 0 or a 1 it becomes a don't care.

#### Uyet123

Joined Jan 25, 2015
29
How about the T0S then? The S can be either 0 or 1 so it becomes a don't care too? But it includes it in the equation.

And the first equation why did it include A3A4 aswell?

#### Papabravo

Joined Feb 24, 2006
14,883
The S cannot be a zero or a 1 and cause the state transition. The state transition only happens when S is 1 AND T0 is a 1
OR when T1 is a 1.
In the first equation the state transition can only happen when T1 is a 1 AND A3 is a 1 AND A4 is a 1. You don't see any other rows that allow G1 to become a 1 do you?

#### Uyet123

Joined Jan 25, 2015
29
Ok I get you now. Do I have to do the same thing for the other state table? I can't apply what you told me to that table.

#### Papabravo

Joined Feb 24, 2006
14,883
I think the other table is for generating the output function and yes the same types of rules apply there as well. You want to find the minimum number of terms that will get you the desired behavior.

#### Uyet123

Joined Jan 25, 2015
29
I still dont't understand the second table. So to get T0, I have to check which row is set to 1 in T0, which are rows 1 and 2. The S input is either 0 or 1 so it becomes a don't care, the G1 are both 0 so it doesn't go to the equation and G0 is either 0 or 1. Then there is no equation for T0? How did they get G'0? Im confused.

#### Papabravo

Joined Feb 24, 2006
14,883
You notice that the output column T0 is the complement of the G0 column under present state for all values of present state.
Next you notice that T1 is a 1 for all cases where G1 is a 0 and G0 is a 1, thus G0'G1
Lastly you notice that T2 is a 1 only when G1 is a 1
This describes a Moore Machine where the outpus are only a function of the present state. The other kind of machine is a Mealy Machine where the outputs depend on the state and how you got there.

#### Uyet123

Joined Jan 25, 2015
29
Ok that makes sense, thanks a lot.

#### WBahn

Joined Mar 31, 2012
26,398
I still dont't understand the second table. So to get T0, I have to check which row is set to 1 in T0, which are rows 1 and 2. The S input is either 0 or 1 so it becomes a don't care, the G1 are both 0 so it doesn't go to the equation and G0 is either 0 or 1. Then there is no equation for T0? How did they get G'0? Im confused.
Ask yourself what the minimum amount of information you need to know is in order to determine the value of a particular variable.

If I tell you what the value of G0 is, can you tell me what the value of T0 is? If so, then you don't need to know anything else, do you?

If I tell you what the value of G0 is, can you tell me what the value of T1 is? If not, then you DO need to know something else, don't you? What other piece of information would be enough for you to determine what the value of T1 is?

#### Uyet123

Joined Jan 25, 2015
29
In the case of T1 can I use XOR? so it will be G1 XOR G0

#### Papabravo

Joined Feb 24, 2006
14,883
You can do whatever you want. If you do, the disallowed or unaccounted for state {10} will also set T1 = 1. Maybe that's a big deal and maybe it isn't.
If I were grading that answer I would mark you down 50% for sloppy design. Your instructor might let you get away with it.

#### WBahn

Joined Mar 31, 2012
26,398
In the case of T1 can I use XOR? so it will be G1 XOR G0
Since the assignment specifically stated that state {10} is a "don't care" state, this would be strictly legal. Most people that have worked in the real world don't believe that there is such a thing as a "don't care" state -- at least not until it has been investigated an proven that it truly is a "don't care". But that almost always requires knowledge of the system beyond that which you have access to in a homework assignment.

Even so, using an XOR is probably a suboptimal solution. It looks "simple" on paper, but an XOR generally has considerably more transistors and longer propagation times than a NAND gate or a NOR gate. Considering that most (not all) FFs bring out both the Q and Q' signals as outputs, you can do much better.