This is a program we designed as an extension:
when "0000" => Q <= "11110110100000"; --turn off all lights in succession
when "0001" => Q <= "00001100000011"; --reload acc with zeros and invert light reg
when "0011" => Q <= "11111100000101"; --loop through until 1 in low bit
when "0101" => Q <= "00101100000011";
when others => Q <= "00000000000000"; --start the process over
Click here to see a simulation of this program (this must be downloaded and simulated in Altera Max+2).