Create the Mealy type state machine with input X and output Y. Y must be 1 whenever sequence 110 or 101 has been detected on X on last 3 consecutive rising clock edges (or ticks). Otherwise, Y=0. Use at most two D flip-flops. Example input-output combination is given below:
X 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1
Y 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 0 0 0