Fast, high bit number pattern generator for electron and ion beam lithographies