You have 8 binary input signals to a controller, each one for each of the digits 1 - 8. The output is four binary signals, that make up the same number as the input. If the first input signal is 1
, then the four output signals should be 0 0 0 1
, if the seventh input signal is 1
, then the output should be 0 1 1 1
. The table below shows the system (just binary representation of decimal numbers).
d 4 3 2 1
- - - - -
- 0 0 0 0
1 - 0 0 0 1
2 - 0 0 1 0
3 - 0 0 1 1
4 - 0 1 0 0
5 - 0 1 0 1
6 - 0 1 1 0
7 - 0 1 1 1
8 - 1 0 0 0
If the first input signal is 1
, the output from the controller should be a binary output 0 0 0 1
(1
in binary). If the sixth input signal is 1
the output from the controller should be 0 1 1 0
(6
in binary). If no input signal is given, the output should just be blank.
If two or more input signals are 1
, then the output signal should switch back and forth. E.g. if the first and sixth signal are 1
, then the output from the controller should go back and forth between 0 0 0 1
and 0 1 1 0
.
The controller has the following functions blocks:
- Logical gates
AND, OR, XOR, NOT, NAND, NOR, XNOR.
The gates can take up to 2 signals, and unlimited outputs. (NOT
can only take one input). - A pulse generator
1 0 1 0 1 0 1 ...
(both0
and1
have the same duration). Pulse generators have the same frequencies but you may choose the phase.
Challenge:
What's the smallest number of function blocks needed to achieve the desired behavior, and how will the controller be made up?
Examples:
1 2 3 4 5 6 7 8
- - - - - - - -
0 0 0 0 0 0 0 0 <- Input signals
0 0 0 0 <- Output
0 0 1 0 0 0 0 <- Input signals
0 0 1 1 <- Output
0 1 0 0 1 0 0 0 <- Input signals
0 0 1 0 <- Output sequence
0 1 0 1 <-
0 0 1 0 <-
0 1 0 1 <-
0 0 1 0
0 1 0 1
0 0 1 1 1 1 1 0 <- Input signals
0 0 1 1 <- Output sequence
0 1 0 0 <-
0 1 0 1 <-
0 1 1 0 <-
0 1 1 1
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1