FPGA-based multi-channel time-tagging code