1. Truth table:
First I fill in the conditions from the list:
[code] | S1 | S2 | S3 | S4 | M1 | M2 | M3 | M4 |
0 | 0 | 0 | 0 | 0 | | | | |
1 | 0 | 0 | 0 | 1 | | | | 1 |
2 | 0 | 0 | 1 | 0 | | | 1 | |
3 | 0 | 0 | 1 | 1 | | | 0 | 0 |
4 | 0 | 1 | 0 | 0 | | 1 | | |
5 | 0 | 1 | 0 | 1 | | 0 | | 0 |
6 | 0 | 1 | 1 | 0 | | | | |
7 | 0 | 1 | 1 | 1 | | 0 | 0 | 0 |
8 | 1 | 0 | 0 | 0 | 1 | | | |
9 | 1 | 0 | 0 | 1 | 1 | | | 1 |
10 | 1 | 0 | 1 | 0 | | | | |
11 | 1 | 0 | 1 | 1 | | | 0 | 0 |
12 | 1 | 1 | 0 | 0 | | | | |
13 | 1 | 1 | 0 | 1 | | 0 | | 0 |
14 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
15 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |[/code]
Note: In case 3, for example, you could choose to turn on ONE of the motors.
Then I fill out the empty cells to make sure the state of each motor matches the state of the corresponding input switch:
[code] | S1 | S2 | S3 | S4 | M1 | M2 | M3 | M4 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
2 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
3 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
4 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
5 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
6 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
7 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
8 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
9 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
10 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
11 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |
12 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
13 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 |
14 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
15 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |[/code]
Next I convert the truth table for each motor to a Karnaugh map. This is for M1:
[code]M1 S1 S2
| 00 | 01 | 11 | 10 |
| 00 | 0 | 0 | 1 | 1 |
S3 S4 | 01 | 0 | 0 | 1 | 1 |
| 11 | 0 | 0 | 0 | 1 |
| 10 | 0 | 0 | 1 | 1 |[/code]
The map has 3 groups in it:
[code]M1 = S1 S2' + S1 S3' + S1 S3 S4'[/code]
' <-- means NOT = inverted.
+ means OR-gate.
S1 S2' means that the two factors should be multiplied (* <-- not shown). Multiplication = * = AND-gate.
(Repeat for M2, M3 and M4).
2. Circuit diagram: (from TKGate 1.8.7 on Ubuntu 11.04)
[img]http://diagramtips.com/images/2011/m1_logic_circuit.jpg[/img]
(Repeat for M2, M3 and M4).
3. ?
4. Problems: I can't install kmm (karnaugh map minimizer) on Ubuntu 11.04

:
[code]./kmm: error while loading shared libraries: libwx_gtk2_xrc-2.6.so.0: cannot open shared object file: No such file or directory[/code]