Based on the analysis of the rules of 8B/10B encoding and decoding and the logical relationship between the input signals and the corresponding data,the new methods for encoding and decoding and to calculate the run length are put forward.The algorithm of encoding and decoding are completed with synthesizable Verilog HDL and the simulations were achieved in QuartusⅡ and ModelSim software environments.The simulation results show that the proposed method has the performance of the improved maximum working frequency,the less consumption resource and the enhanced reliability.