Design and Characterization of a Low-Cost FPGA-Based TDC