This circuit is meant to control a conveyor belt system that moves packages around a factory. A rough diagram of the system is below:
^ ^
^ ^
^ ^
\
^
^
^
The system has a branch in the belt so that packages moving from bottom to top (upward) can go either left or right. The above diagram is showing the branch currently in the left mode (packages will take the left branch).
The system can also reverse the direction of the belt, moving packages from top to bottom:
v v
v v
v v
/
v
v
v
Note the opposite direction of the arrows pointing downward. Also note the branch is now in the right mode. In this configuration, packages from the right branch will move onto the central line. If the branch was still in left mode, it would instead move packages from the left branch onto the central line.
The belt can be in one of three states:
The branch switch can be in one of two states:
Input
As input, the system has three weight sensors that detect packages on different parts of the belt and provide input to the circuit:
These sensors will have a value of 1 if there is a package on that part of the belt, and 0 otherwise.
Output
As output, the system produces C (conveyor direction) and S (branch switch direction). Since the conveyor direction has three possible values (not moving, downward, and upward), C is composed of two bits: C1 and C0, representing the MSB and LSB, respectively, of the direction (00 = not moving, 01 = downward, 10 = upward).
The S output is 0 for left and 1 for right.
Logic:
Packages at the top positions (L or R) always want to move downward, and packages at the bottom (B) always want to move upward. Packages at the bottom have priority.
The system is governed by the following rules: