Theory of Digital Automata