Groan. I know English is perhaps not your first language, but even so, you must know that's a pathetic request.
What sort of a counter? What's it for, speed, size, up down etc. etc. Have you ever interfaced anything to a Mega 8, or to anything at all? If so, design the CPLD to interface like whatever you did before. If not, find out how to. Have you designed anything with a CPLD before? If not, find out how to. Then come back to us with any specific questions on the application.
Otherwise it's no use talking, even if we give you chapter and verse you won't be able to use it.
Oh, and we don't do homework.
Paul Burke