Introduction - If you have any usage issues, please Google them yourself
In the ISE environment using vhdl to write a lock program. Downloaded to the board spartan6 xilinx' s proven, there are simulation code. Mainly the conversion between several states, with a moore state machine.