Boolean Circuits · NAND Game: Arithmetic and Switching
Lesson 11
Problem. Construct a switch component. A switch has two inputs: \(s\) and \(d\), and two outputs: \(c_{1}\) and \(c_{0}\). If \(s=0\), the data bit \(d\) must be sent to \(c_{0}\), and \(c_{1}\) must be \(0\). If \(s=1\), the data bit \(d\) must be sent to \(c_{1}\), and \(c_{0}\) must be \(0\). In the output line of your circuit, list \(c_{1}\) first and \(c_{0}\) second.
You may use only the following functions: \[\begin{aligned}\operatorname{NAND}(a,b) &= \neg(a \land b), & \operatorname{INV}(a) &= \neg a, \\ \operatorname{AND}(a,b) &= a \land b, & \operatorname{OR}(a,b) &= a \lor b, \\ \operatorname{XOR}(a,b) &= a \oplus b. &\end{aligned}\]
Truth table: \[\begin{array}{c c | c c} s & d & c_1 & c_0 \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0\end{array}\]
The authors' solution uses \(3\) gates.