Finite state machine for CAM to be tested