Case Statement Example:Function of Arithmetic Mod.
architecture arithmetic_module_arch of arithmetic_module is
-- multiplication returns a result with length = sum of lengths of operands
signal ext_result : std_logic_vector(OPERAND_WIDTH*2-1 downto 0);
EVAL_ARITH: process(operandA, operandB, operation)
ext_result(OPERAND_WIDTH-1 downto 0) <= operand1 + operand2;
ext_result(OPERAND_WIDTH-1 downto 0) <= operand1 - operand2;
ext_result <= operand1 * operand2;
ext_result(OPERAND_WIDTH-1 downto 0) <= ZERO - operand1;
-- cover all cases not explicitly stated in case statement
ext_result <= (others => '0');
end arithmetic_module_arch;