Set the 4 bit input to determine the width of the pulse. Lower binary counter runs on a loop generating the pulse clock and the 4 binary outputs. Feeds a binary comparator that generates a pulse when the clock output matches the input bits, setting the RS latch output.