A localized DNA finite-state machine with temporal resolution