Tom...
First of all, the problem was described very poorly. From the description, as it is, I get the following impressions...
There is a Green Light and a Red Light at each station.
Green indicates "Running", while Red indicates "Inhibited".
When no stations are running...
- ALL lights, at all stations, are OFF! No Green... No Red!
When any station is started...
- The Green Light, at that station, is illuminated.
When any three stations are running...
- The Red Light at the fourth station, whichever one that is, is illuminated.
- That station is thusly prevented from starting!
What that means is... whenever a switch is turned ON at a station, doing so is essentially a "request to run" that station. If three other stations are already running, and the Red Light at this station is illuminated, then that station is not allowed to start.
What this means is... whether, or not, a station can be started depends on whether, or not, it is "Inhibited"! If not "Inhibited", it can start, and the Green Light will be turned on at that station. If that station happens to be the third station running, then the Red Light at the remaining station is illuminated.
So... whether, or not, a particular station can be started depends on the status of the Red Light associated with that particular station. If the Red Light is ON, it is "Inhibited", and it
can not be started... if the Red Light is OFF, then it
can be started. Once started, the light goes Green. And then, if that station happens to be the third running station, then the light at the last station, whichever that one is, goes Red.
So, what this boils down to is... the switch is a "request to run", and then, depending on the status of the Red Light associated with the particular station... the station might, or might not, be allowed to run. Then... if allowed to run, the Green Light associated with that station goes ON!
Do you get the picture? The running-status of the station depends on the status of the Red Light at that station, and then, depending on that status, the subsequent action controls the status of the Green Light at that station.
Are ya dizzy yet? I sure am. The point is, the scheme can NOT be as simple as jimcav described.
At the very least, I would replace the switches with push-buttons. If a switch is used, then, if the switch at the fourth station was ON when any of the other three stations goes OFF... then the fourth station would start... maybe unexpectedly!
HOWEVER... since jimcav described the problem as he did, here is the complete K-Map solution to the problem... as he described it.
NOTE:
To some, the following might look like a lot of effort for very little result. Some people will say that they can come to the same conclusion without going through all of this cra-p.
Well, it's my contention that they
do go through all that... no matter what... whether they do it on paper, or they do it in their heads! More experienced programmers
will certainly do this kind of stuff in their heads. All I'm doing is showing the novices the logic behind how the conclusions are derived... that is, what the more experienced players are doing... in-their-heads.
As far as I'm concerned, the following is only part of the total solution. And again, the following applies only to the problem as described by jimcav.
"A" = Run Station-1
"B" = Run Station-2
"C" = Run Station-3
"D" = Run Station-4
In the following map...
Alpha = GREEN Example: A,C = "A Green" and "C Green"
(Alpha) = RED Example: (D) = "D Red"
The box with the ??? represents the "Not Allowed" condition.
That is, it is not allowed to have all stations on at the same time.
Let's map all station light conditions...
C D
0 0 0 1 1 1 1 0
A B +-----+-----+-----+-----+
| | | | |
0 0 | ALL | D | C,D | C |
| OFF | | | |
+-----+-----+-----+-----+
| | | | |
0 1 | B | B,D |B,C,D| B,C |
| | | (A) | |
+-----+-----+-----+-----+
| | | | |
1 1 | A,B |A,B,D| ??? |A,B,C|
| | (C) | | (D) |
+-----+-----+-----+-----+
| | | | |
1 0 | A | A,D |A,C,D| A,C |
| | | (B) | |
+-----+-----+-----+-----+
Now, let's map the conditions for "A" (Station-1) to be Green or Red...
"A" C D
0 0 0 1 1 1 1 0
A B +-----+-----+-----+-----+ A B C D
| | | | | 0 1 1 1 = "A-Red"
0 0 | | | | |
| | | | |
+-----+-----+-----+-----+ A B C D
| | | | | 1 0 X X
0 1 | | | (A) | | -or-
| | | | | 1 X 0 X
+-----+-----+-----+-----+ -or-
| | | | | 1 X X 0 = "A-Green"
1 1 | A | A | ??? | A |
| | | | | (A !B) + (A !C) + (A !D)
+-----+-----+-----+-----+
| | | | | A ( !B + !C + !D) = "A-Green"
1 0 | A | A | A | A |
| | | | | Note: !B means "Not B"
+-----+-----+-----+-----+
Now, let's map the conditions for "B" (Station-2) to be Green or Red...
"B" C D
0 0 0 1 1 1 1 0
A B +-----+-----+-----+-----+ A B C D
| | | | | 1 0 1 1 = "B-Red"
0 0 | | | | |
| | | | |
+-----+-----+-----+-----+ A B C D
| | | | | 0 1 X X
0 1 | B | B | B | B | -or-
| | | | | X 1 0 X
+-----+-----+-----+-----+ -or-
| | | | | X 1 X 0 = "B-Green"
1 1 | B | B | ??? | B |
| | | | | (!A B) + (B !C) + (B !D)
+-----+-----+-----+-----+
| | | | | B (!A + !C + !D) = B-Green
1 0 | | | (B) | |
| | | | |
+-----+-----+-----+-----+
Now, let's map the conditions for "C" (Station-3) to be Green or Red...
"C" C D
0 0 0 1 1 1 1 0
A B +-----+-----+-----+-----+ A B C D
| | | | | 1 1 0 1 = "C-Red"
0 0 | | | C | C |
| | | | |
+-----+-----+-----+-----+ A B C D
| | | | | X X 1 0
0 1 | | | C | C | -or-
| | | | | 0 X 1 X
+-----+-----+-----+-----+ -or-
| | | | | X 0 1 X = "C-Green"
1 1 | | (C) | ??? | C |
| | | | | (C !D) + (!A C) + (!B C)
+-----+-----+-----+-----+
| | | | | C (!A + !B + !D) = "C-Green"
1 0 | | | C | C |
| | | | |
+-----+-----+-----+-----+
Now, let's map the conditions for "D" (Station-4) to be Green or Red...
"D" C D
0 0 0 1 1 1 1 0
A B +-----+-----+-----+-----+ A B C D
| | | | | 1 1 1 0 = "D-Red"
0 0 | | D | D | |
| | | | |
+-----+-----+-----+-----+ A B C D
| | | | | X X 0 1
0 1 | | D | D | | -or-
| | | | | 0 X X 1
+-----+-----+-----+-----+ -or-
| | | | | X 0 X 1 = "D-Green"
1 1 | | D | ??? | (D) |
| | | | | (!C D) + (!A D) + (!B D)
+-----+-----+-----+-----+
| | | | | D (!A + !B + !C) = "D-Green"
1 0 | | D | D | |
| | | | |
+-----+-----+-----+-----+
So, the Ladder looks like this...
B A
---|/|---+---| |---( "A-Green" )
|
C |
---|/|---+
|
D |
---|/|---+
A B
---|/|---+---| |---( "B-Green" )
|
C |
---|/|---+
|
D |
---|/|---+
A C
---|/|---+---| |---( "C-Green" )
|
B |
---|/|---+
|
D |
---|/|---+
A D
---|/|---+---| |---( "D-Green" )
|
B |
---|/|---+
|
C |
---|/|---+
A B C D
---|/|---| |---| |---| |---( "A-Red" )
A B C D
---| |---|/|---| |---| |---( "B-Red" )
A B C D
---| |---| |---|/|---| |---( "C-Red" )
A B C D
---| |---| |---| |---|/|---( "D-Red" )
.
.
Essentially, I look at the Green conditions as nothing more than status,
while the Red condition is both a status and an "Inhibit" signal.
The Green conditions are used to develop the Red condition.
It's really tough dealing with poorly defined problems.