How to assign an input to a switch?
If you have an Altera DE2 board, then you should use the Altera Quartus-II software. To change the pin assignments, follow these steps:


Write your VHDL code.
Change Flow to "Compilation" using the drop-down on the left side in the middle sub-window named "Tasks".
Double-click the step "Analysis &amp; Synthesis". Check the log on the bottom for any errors and fix them.
Select menu "Assignments" --> "Pin Planner". In the new window, you will find the input and outputs of your design in a table. Edit the column "location" to connect an input/output to a specific pin of the FPGA. The required pin can be found in the documentation of the FPGA board.