This chip will be incorporated in the microrobot that is being developed in lab.
The inputs consist of two bits I0 and I1, each one for a sensor that detects contamination in water to the left and right fo the robot respectively. The input bus goes to logic gates along with the Current State to calculate the Next State, which is then saved in a register (D-FlipFlop).
There are a total of four states:
The register will store the Current State (which is given by S0 and S1) at any given time.
This is a Moore Finite State Machine, meaning that the output only depends on the current state. The outputs consist of two bits M0 and M1, each one turns on the motor on the right or left of the robot respectively.
The truth table for the FSM can be found below.
I0 | I1 | S0 | S1 | S0+ | S1+ | M0 | M1 |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 |
0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 |
1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 |
1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
3-electrode sensor and motors
# | Input | Output |
---|---|---|
0 | clock | Enable Right Motor |
1 | reset | Enable Left Motor |
2 | segment c | |
3 | segment d | |
4 | segment e | |
5 | segment f | |
6 | Sensor Left Input | segment g |
7 | Sensor Right Input | dot |