Boolean Circuits · NAND Game: Processor (Optional)
Lesson 4
A program is a sequence of instructions, where each instruction consists of a set of bit flags that determine the following:
- the ALU operation to be performed,
- the registers to be used as inputs, and
- the register or registers in which the result is to be stored.
The control unit chooses between data instructions and ALU instructions. The gate \(\texttt{BUNDLE16}\), inverse to \(\texttt{SPLIT16}\), takes 16 bits from most to least significant and writes one 16-bit value.
Problem. Synthesize a circuit of size \(6\) over \(\{\operatorname{NAND}_{2},\allowbreak \operatorname{OR}_{2},\allowbreak \operatorname{CONTROLSELECTOR},\allowbreak \operatorname{ALUINSTR},\allowbreak \operatorname{SPLIT},\allowbreak \operatorname{BUNDLE},\allowbreak \operatorname{SELECT}\}\) computing the control-unit function: \[\operatorname{CONTROLUNIT}(I,A,D,\texttt{*A})=(R,a,d,\texttt{*a},j).\]
There are no explicit inputs, so omit the input-label line; the 16-bit labels \(\texttt{I}\), \(\texttt{A}\), \(\texttt{D}\), and \(\texttt{*A}\) are predefined. If \(\texttt{I}[15]=1\), output the ALU-instruction bus from the previous task; otherwise output \((\texttt{R},\texttt{a},\texttt{d},\texttt{*a},\texttt{j})=(\texttt{I},1,0,0,0)\). List the five outputs in that order. The functions \(\operatorname{CONTROLSELECTOR}\) and \(\operatorname{ALUINSTR}\) each write the same five-output bus.