state decoder