Boolean Circuits · NAND Game: Arithmetic and Switching
Lesson 10
Problem. Construct a selector component. A selector has three inputs: \(s\), \(d_{1}\), and \(d_{0}\), and one output. If \(s=0\), the output must be equal to \(d_{0}\). If \(s=1\), the output must be equal to \(d_{1}\).
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_1 & d_0 & \operatorname{SEL}(s,d_1,d_0) \\ \hline 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 1\end{array}\]
The authors' solution uses \(4\) gates.