A given FSM has an input w, and an output,z. During four consecutive clock pulses, a sequence of four values of the w is applied. Derive a state table for the FSM that produces z = 1 when it detects that either the sequence w: 0010 or w: 1110 has been applied; otherwise, z = 0. After the fourth clock pulse, the machine has to be again in the reset state, ready for the next sequence. Minimize the number of states needed.