created dfa2_hardware.py and modify dfa2.py to work with software and hardware