How to construct a signal with only unit functions?
How can I write a ramp function in the form of a step function?


You are not writing a ramp function in the form of a step function. The ramp function is t or to be more generic (t-a), where a is the value where the ramp function crosses the x-axis.

The step function u(t), when multiplied by the ramp function, determines the start of the combined function. For example, u(t-4)*(t-2) defines a function that is zero before t=4 due to u(t-4), and that crosses the x-axis again when t=2 due to (t-2).

So, in general, you could define r(t-b) = u(t-b)*(t-b) as your ramp function which is zero for t &lt; b and goes up with slope of 1 for t > b.