This is what I have so far, but I'm getting so confused.
The first step toward implementing a state machine is to draw the state diagram that it will implement. A state diagram shows every state that the machine can be in, along with all of the conditions that cause it to switch from one state to another (or not).
A timing diagram is actually an incomplete specification for a state machine, because it does not cover all of the possible combinations of current state and inputs. This means that you can come up with one possible answer, but there may be others. In this case, you should pick the simplest answer that meets the requirements.
The outputs are simple; we can see that OUT1 corresponds to state B and OUT2 corresponds to state D.
In the given timing diagram we see the following transitions:
The following combinations are unspecified:
One interpretation is to assume that the unspecified combinations do not cause state transitions.
Other interpretations are possible — for example,
Together, these assumptions cover all of the unspecified transitions.
Only after you have a complete state diagram can you start designing the logic for an implementation. The nice thing about "one-hot" designs (one FF per state) is that the logic pretty much follows the state diagram one-for-one.
Sorry, no full solutions to homeworks, only quidance!
Take 4 ff:s of D-type. Lets's name them a,b,c and d according the states. Everyone gets the same clock. Everyone have a different gate that produces the D-input for the ff. The gate at the D-input of ff X should give out 1 exactly when the variables have such combination that the next state should be X.
One of the states should be the reset state. The master reset signal sets that ff and resets others.
ADDENDUM: This is more difficult case than I believed (not the circuit, it's simple). But let's add some clarifications.
The pulse diagram has named states a, b, c and d for the machine. It's especially simple because the original demand was the states are directly shown by the outputs of the flip-flops (=one ff per state). That's why I named the flip-flops as the states. In state a only the output of ff a is 1, in state b only the output of ff b is 1, etc...
D type flip-flop copies the logic value from its D-input to its output Q every time when the clock pulse jumps from 0 to 1. To make the Q-output of ff a to 1 at the right moment one must feed 1 to its D-input just when the machine is expected to jump into state a from another state or from state a.
The pulse diagram gives several different cases when the next state is a. Thus quite a complex gate circuit is needed to produce proper input to the D-input of ff a.
The conditions that lead to state b are simpler. The machine jumps to state b (= sets the output of ff b to 1) exactly when the current state is a and the input IN1 is 1. Thus connect to the D-input of ff b the output of an AND-gate. The inputs of that AND are the Q-output of ff a and the signal IN1. There really is nothing more needed to D of ff b. Actually the pulse diagram is shortened. It makes me free to assume that IN2 doesn't affect to the transition from a to b.
The pulse diagram shows 4 different cases when the D of ff a should be =1. they are:
You need a gate circuit (=logic combination circuit) that produces 1 to D of ff a just in these cases. I see it needs a multi input OR and a couple of ANDs and inverters.
Now: try to continue
Hopefully you can see how to produce OUT1 and OUT2.