
This chip implements a 3-state finite state machine for obstacle avoidance. It reads two sensor inputs (obstacle detected, too close) and transitions between FORWARD, TURNING, and STOPPED states. State is stored in a 2-bit register updated on each clock rising edge. Each output pin corresponds directly to one active state.
Apply clock signal to clk pin. Set ui[0] HIGH to simulate an obstacle in range — chip transitions from FORWARD to TURNING. Set ui[1] HIGH to simulate a dangerously close obstacle chip transitions to STOPPED regardless of current state. Pull both LOW to return to FORWARD. Monitor uo[0], uo[1], uo[2] for current state only one will be HIGH at a time.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | obstacle - object in range | motor_forward - drive straight | |
| 1 | too_close - object dangerously close | motor_turn - turning | |
| 2 | motor_stop - stopped | ||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 |