Design a simple ALU (Arithmetic Logic Unit) which has three 4-bit inputs x = x3x2x1x0, y=y3y2y1y0 and z= z3z2z1z0, two control signals A and B and output S. The ALU should support the operations described in the following table:
Control input operation
A B
0 0 S=x+y
0 1 S=x+z
1 0 S=y+z
1 1 S=Max(x,y,z)