Finite State Machine Design for Entering/Exiting Door Sensor
So you want to implement a Mealy Finite State Machine using the "One-Hot" method.  Basically this means you need one FF for each state.  You have 5 states so you need 5 FF.  You have 2 outputs which determine the current "state".  The next state is determined by the 2 inputs and the current state.  State transitions occur on the rising edge of the clock I assume.  

The format the author uses in the State Diagram for signals is AB/(CE UD')

The FSM provides the "control" for the circuit determining the next state to occur when a clock event happens. 

We need to implement the FSM shown above.  This is done by looking at the State Diagram and all of the "arrows" entering each state.  

So for instance, you will be at state "INIT" if the asynchronous signal "START" is asserted.  There are 5 more arrows entering INIT so we need logic for each of these five which is done with sum of products.

INIT = START + (INIT)A'B'*(CE') + R1*A'B'*(CE') + R2*A'B'*(CE)*UD' + L1*A'B'(CE') + L2*A'B'(CE)*(UD')'

The previous statement says that you will be in state "INIT" if any of the 6 conditions are met. The ' "tick" marks after a signal refer to the NOT or inverted signal.  The "*" refers to logic AND.  The "+" refers to logic OR.  The "=" is an assignment into the input of the the D-FF which corresponds to the INIT state.

Next, we have to use these states to keep track of how many students enter the room with a Up/Down counter.