Silicon to Scripting 10
Selector
This problem also gets easier if we rephrase the problem.
The “selecting” aspect can really be though of a few and
conditions.
If
d0
ands
are on, output a1
. Ifd1
ands
are on, output a1
. Otherwise, output a0
.
We can use an and
to fulfill the second part.
The other and
has to take in an inverted s
.
Now we have two outlets and out output.
Since s
can either be on or off (duh), only one and
can be on at a time (try to understand why), so we can or
them together.
Switch
The switch is almost the same as the selector, except we don’t or
the outlets at the end.