module alu(A,B,X,res);
input [3:0] A , B;
input [1:0] X ;
output [3:0] res;
wire [3:0] A, B;
wire [1:0] X;
reg [3:0] res;

always
begin
if(X==2'b00)
begin
res=4'b0000;
end
else if (X==2'b01)
begin
res=A+B;
end
else if (X==2'b10)
begin
res=A-B;
end
else 
begin
res=A*B;
end
end
endmodule 