--- Quote Start ---
As regards Brad "Sometimes you have to select the correct device family in the PLL MegaWizard. Sometimes you can select one family there and compile for another family. I change the selection in the MegaWizard when I get an error during compilation." Can you just elaborate it because I am a beginner .
--- Quote End ---
When you configure a megafunction like altpll with the MegaWizard, the "Currently selected device family" field defaults to the device family selected in the Quartus project you had open when you started the MegaWizard. For some megafunctions, the device family selection is important. Depending on the device family selection in the Quartus project and the family selection in the MegaWizard, you might or might not be able to compile with these two device family selections not matching. It depends on how picky the code for the megafunction is about the device family selection. (This megafunction code is in a library under the Quartus installation directory. The "Analysis & Synthesis Source Files Read" table and Analysis & Synthesis messages in the compilation report tell you which megafunction library files are used.)
For PLLs in particular, I often can change the device family in the Quartus project and still compile the PLL even though the PLL still has its device family set to something I'd been using earlier. Sometimes though I have to update the device family selection in the MegaWizard before I can compile. It just depends on what the family selections happen to be.
It is best to keep the device family selection in the MegaWizard matching the one in the Quartus project to avoid problems--always do that for a new design. But if you are converting a Quartus project to a different device family, you don't have to change the device family selections for the megafunctions if the mismatch between the megafunction device family selection and the Quartus project device family doesn't cause warnings or errors.