Morse code has following rules for signaling:
dot is 1 time unit
dash is 3 time units
the space between symbols of the same letter is 1 time unit
the space between words is 7 time units
Following these rules SOS signal timing diagram will look like this:

We see that 34 independent logical states are needed. This introduces a problem as we could reduce logical circuit complexity by using 32 states instead as it will require 5 inputs for our truth table.
I decided to violate last Morse code signaling rule and use 5 time units for spacing between words instead of 7.
I'm using Logism, it can take truth table as input and generate logical circuit. Generated circuit is not perfect and can be improved manually by removing duplicated components and changing number of inputs for logical gates.
Final circuit that generates SOS signal in Morse code
