Boolean Circuits · NAND Game: Memory (Optional)

Lesson 7

Nikolai Chukhin · Alexander S. Kulikov

You are now able to store a \(16\)-bit word in a register. Additional memory capacity can be obtained simply by stacking such registers. However, since a processor operates on one word at a time, it is necessary to provide a mechanism for selecting and modifying individual words within a larger memory bank. This objective is achieved through the use of memory addresses. Each word in memory is assigned a numerical address, thereby enabling the retrieval or overwriting of a word by specifying its corresponding number. In this task, you are required to employ two registers and to address them using a single-bit address signal.

Problem. Synthesize a circuit of size \(4\) over \(\{\operatorname{NAND}_{2}, \operatorname{INV}_{1}, \operatorname{AND}_{2}, \operatorname{REGISTER}, \operatorname{SWITCH}, \operatorname{SELECT}\}\) computing the two-cell 16-bit memory function \(\operatorname{RAM}(st,x,ad,cl)\): The input-label line is \(\texttt{ad st cl}\); the 16-bit label \(\texttt{x}\) is predefined; the circuit has one 16-bit output. Both cells start at \(0\). The address bit \(\texttt{ad}\) selects the cell to read; if \(\texttt{st}\)=1, \(\texttt{x}\) is also written to that cell using the same clock protocol as a register. Assume the inputs do not change while \(\texttt{cl}\)=1. The function \(\operatorname{SWITCH}\) writes two bits, while \(\operatorname{REGISTER}\) and \(\operatorname{SELECT}\) carry 16-bit values.