This circuit is on circuitverse: https://circuitverse.org/users/151941/projects/airlock-fsm
This is a FSM circuit.
This circuit is an airlock system, essentially the only input is a door control switch which will open and close doors, 1 being open, 0 being close.
This fsm has four states, s0 the reset with both doors closed, s1 with only door 1 open, s2 with both doors closed and a pressurizing counter active, and s3 with only door 2 open.
This pressurizing ripple counter gets reset at s1, then when state 2 is triggered, it will begin counting, I set this to 4 seconds for ease of testing, however the clock speed for it can be adjusted to allow for a longer time interval for this state. Once this ripple counter reaches 4 seconds, it will hold this value, signaling that it is done pressurizing or depressurizing. I have the outputs of the FSM slightly altered to allow for a depressurizing/ pressurizing led and an led signaling it is done with the action and holding. The done pressurizing led uses the ripple counter msb since it will only be on when the counter is at 8, and the pressurizing led uses the state output of 11 anded with the msb inverted, meaning the msb controls these outputs and only 1 will activate at a time. For all states, the fsm will hold its current state until the control input is switched, so if the door is open, it will remain open until told to close and vice versa.
Equations:
AB=flip flop outputs, C=door control input, D = ripple counter output
FSM A+=C'B+CA+AB
FSM B+=(C+B)(A'+B)(C'+D'+A')
Door 1 output=A'B
Pressurizing output=AB'D'
Pressurized output=D
Door 2 output=AB
Ripple counter clock signal=(AB)CLK
Ripple counter enable signal={[(C(CLK)')'AB](RC LSB)}' (Ripple counter LSB)
Ripple counter reset signal=A+B'C'D'
Below is the work for the fsm and ripple counter inputs and outputs: