There are three methods you can use to design the control unit.
To simplify output and input variables that rely on the current state, we can use a decoder at the output of the state machine where a single line represents each state.
This is similar to using N flip-flops for N states in that you have N outputs from the state machine, each one corresponding uniquely to a state.
We can design with multiplexers by using them to calculate the next state values
Design a circuit that counts the number of times a laser beam is broken (by someone walking through it, for example). The inputs to the circuit are: Clear, Laser. Clear should reset the counter to 0, Laser indicates whether the beam is broken (1) or not (0). If someone decides to stand in the beam for more than one clock cycle, that should still count as only one "break".