# Getting overly complicated logic functions when designing a state machine, is there any way to simplify them?

I am having a bit of problem when trying to solve a state machine exercise. Basically I am supposed to design lock, when we get the right input in sequence etc it will open.

The problem are the complex logic expressions I get for q1+, q0+ and u from the state table, is there any way to simplify them? I have already done the Karnaugh maps on them but they still seem to be too complex.

q1+ = q0*x1*x0' + q1*x1*x0 + q1*q0*x0

q0+ = q1*q0 + q1*x1*x0 + q1'*q0'*x1'*x0'

u = q1*x1*x0 + q1*q0*x0 + q1*q0*x1

• Have you learnt any logic rules of simplification yet? – Tony Stewart Sunnyskyguy EE75 Feb 13 '18 at 20:51
• I did learn about De morgan etc but when I apply it here it doesn't really get any simpler. – Lukas Feb 13 '18 at 20:52
• Looks like 3 state registers and a bunch of gates. So finish what you started – Tony Stewart Sunnyskyguy EE75 Feb 13 '18 at 20:54
• Those expressions are far from complex. Even it they could be simplified there are only a few gates involved. Wait till you get to something really complex with 10 or 12 state variables dozens of inputs and outputs. – Michael Karas Feb 13 '18 at 22:55

you can simplify the resulting number of logic gates visually (not by using formulas)

just reformat the equations and you will see patterns

q1+ = (q0)(q1)(x0)  + (q0)(x1)(x0') + (q1)(x0)(x1)

q0+ = (q0)(q1)      +                 (q1)(x0)(x1)  + (q0')(q1')(x0')(x1')

u   = (q0)(q1)(x0)  + (q0)(x1)(q1)  + (q1)(x0)(x1)