Resolver-To-digital converter with synchronous demodulation for FPGA based low-latency control loops