module ALU(A,B,bInvert, cin, operation,Result);
    input [15:0] A;
    input [15:0] B;
    input [0:0] bInvert;
    input [0:0] cin;
	 input [1:0] operation;
	 output [15:0] Result;
	 reg [15:0] Result;

always @ (A) 
begin
case(operation)
0: 	begin
		Result = A & B;
		end
1:	   begin
		Result = A ^ B;
		end
2:		begin
		Result = A + B + cin;
		end
endcase 
end

always @ (B) 
begin
case(operation)
0:  	begin
		Result = A & B;
		end
1: 	begin
		Result = A ^ B;
		end
2: 	begin
		Result = A + B + cin;
		end
endcase 
end

always @ (cin) 
begin
case(operation)
0: 	begin
		Result = A & B;
		end
1: 	begin
		Result = A ^ B;
		end
2: 	begin
		Result = A + B + cin;
		end
endcase 
end

always @ (operation) 
begin
case(operation)
0: 	begin
		Result = A & B;
		end
1: 	begin
		Result = A ^ B;
		end
2: 	begin
		Result = A + B + cin;
		end
endcase 
end

endmodule
