FPGA implementation of a cnc controller