-1
\$\begingroup\$

For a lab exercise I have to design a 2-input sequence and I'm struggling with the state diagram, as It has 2 inputs, A,B and it says that in the start if we have same values the exit Y=1 and Y=0 when are different. When it finds 3 continuously same values of inputs the exit will reverse. So what can I do? is this diagram state correct? enter image description here

enter image description here

\$\endgroup\$
6
  • 3
    \$\begingroup\$ When someone asks for help with a homework problem we expect them to show a significant amount of effort to solve the problem themselves and to ask a specific question. Your description is also a bit confusing...by "exit" do you mean "output"? What does "exit will reverse" mean? \$\endgroup\$ Commented Sep 8, 2019 at 12:51
  • \$\begingroup\$ yes exit is the output and let me rephrase the "reverse sentence". Initially the output Y is set to 1 when the values of A and B are different and to 0 when they are the same. When the circuit detects that three consecutive samples of A and B have the same value then (from the next clock pulse) or output Y is set to 1 when the values A and B are the same and to 0 when they are different. \$\endgroup\$ Commented Sep 8, 2019 at 12:57
  • \$\begingroup\$ I mean that if A: 1 1 1 0 1 0 1 0 and B: 1 0 1 0 1 1 1 0 then output would be Y: 0 1 0 0 0 0 1 1. I certainly do not want the solution. I just kindly request if my above state diagram is right? Do I misunderstand something? Because I know how to make state diagram. But this seems something new to me. That's why, if you could help me... \$\endgroup\$ Commented Sep 8, 2019 at 12:58
  • \$\begingroup\$ Why don't you try writing a state table. Make a table that shows, for every possible combination of values of A, B, and the current state, what the next state and output value should be. You have two state bits (plus A and B) so it looks like you need at total of 16 rows in the table. \$\endgroup\$ Commented Sep 8, 2019 at 13:02
  • \$\begingroup\$ thank you very much for your previous advice. I have done the truth table of the problem. Is this right? \$\endgroup\$ Commented Sep 8, 2019 at 14:28

1 Answer 1

1
\$\begingroup\$

You will need 6 states for this, 3 to correspond to 0 output, 3 for 1. So your state diagram and truth table are wrong.

And there is a slight advantage if you pick the 6 (of 8) states properly.

This should get you started in the right direction.

State diagram

\$\endgroup\$
1
  • \$\begingroup\$ thank you very much \$\endgroup\$ Commented Sep 9, 2019 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.