	TITLE "ALU SWAP";

PARAMETERS (
	WIDTH=16
);

SUBDESIGN alu_7 (
	op1[WIDTH-1..0]	: input;
	op2[WIDTH-1..0]	: input;
	cmd[3..0]	: input;
	res[WIDTH-1..0]	: output;
)
VARIABLE
	logic[WIDTH-1..0]	: LCELL;
BEGIN
	CASE cmd[] IS
		WHEN 0 => logic[] = op2[]; -- swap
		WHEN 1 => logic[] = op1[] + 1; -- inc
		WHEN 2 => logic[] = op1[] - 1; -- dec
		WHEN 3 => logic[] = - op1[]; -- neg
	END CASE;
	res[] = logic[];
--	res[] = H"00A7";
END;