First let me tell you, I am not expert in VHDL, just recently I started working on CPLDs and it was very exciting and hence sharing this experience with you all.
Overview
CPLDs(or FPGA) are very interesting devices, you can put any digital circuit of your choice in them, provided it fits within available resources. We can implement simple circuits like adders, counters, PWM generators and even complex microprocessors on CPLDs ! In this tutorial we will implement simple MOD-4 counter and see how to use Xilinx’s XC9536 CPLD.