What you need
A simple state machine for the ant
- 3 outputs
- Go forward
- Turn left
- Turn right
Two 7-bit counters to hold X and Y
- With preload, increment, decrement
4-bit shift register to hold the ant’s heading
- Rotate right when ant turns right
- Rotate left when ant turns left