For some good intro to CPLD and VHDL examples ... see Starting Electronics website and their section on VHDL CPLD course.
Some videos ..