added test bench for encoder