Question: 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: 0101 or w: 0111 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.
I am not sure how to go through the process of preparing the truth table and converting that to a K-Map.