Designing a 4-bit ALU to compute various functions
In terms of "separating" the functions, that's not really how digital logic works.  Digital logic is "always doing everything".  You need a mux (multiplexer) in there.  The multiplexer is used to pick the right output from all of those generated.

Assume inputs A and B, output Q.  Assume the ALU does two different things: Q=A+B, or Q=A&amp;B.

The ALU will have an adder.  It will also have a big AND gate.

A and B both go to the adder, and the AND gate.  Always.  Every moment of every day, the adder is adding A and B, and the gate is ANDing A and B.

The mux is used to select which one of the outputs we want to pass to Q.  If the control signals to the ALU say "add", then the mux will select the output of the adder and pass it to Q; the output of the AND gate is unused.  If the control says "and", the mux will select the output of the AND gate and pass it to Q instead, while the output of the adder is unused.

Imagine A = 0b0001 and B = 0b0010 on the inputs of the ALU.  The adder is always producing 0b0011, and the AND gate is always producing 0b0000.  If you provide the "add" control signal, the 0b0011 is passed to Q.  You can leave A and B alone, and change the control signal to "and", then 0b0000 is passed to Q.