Comments on Code listings
Counter has the header: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all;
The std_logic_arith package declares common arithmetic functions for std_logic types. The std_logic_unsigned package causes these arithmetic functions to operate on unsigned numbers. The std_logic_signed package would operate on signed numbers (affects comparisons, multiplications).