Square wave generator J1772
A common way to do this is to use an integrator and comparator in a loop to form a triangle wave generator.  The triangle output feeds a second comparator with an adjustable reference input.  The output is an adjustable pulse width ratio.  This is the basis of many class-D audio amplifiers.