FPGA counter structure for GCD