This note presents a digital signal processing module for the real-time nonlinearity compensation of a homodyne interferometer. The nonlinearity is corrected by using the parameter values describing two phase-quadrature signals, through simple arithmetic calculation of the quadrature signals at specific phases, which are multiples of pi/4. A field-programmable gate array was employed for the real-time implementation of a processing module since it has reconfigurable input/output and high precision synchronization. The developed module has a minimum loop time of 4.4 mu s and can compensate the nonlinearity error less than +/- 0.5 nm, which is comparable with the elliptical fitting method. We also proved the performance of the module by examining the convergence and the stability of parameter values under various operational conditions.