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 and s are on, output a 1. If d1 and s are on, output a 1. Otherwise, output a 0.

We can use an and to fulfill the second part.

selector 1

The other and has to take in an inverted s.

selector 2

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.

selector 3

Switch

The switch is almost the same as the selector, except we don’t or the outlets at the end.

switch

part 11