Boolean Circuits · NAND Game: Memory (Optional)
Lesson 2
Problem. Synthesize a circuit of size \(2\) over \(\{\operatorname{NAND}_{2}, \operatorname{AND}_{2}, \operatorname{OR}_{2}, \operatorname{INV}_{1}, \operatorname{XOR}_{2}\}\) computing an SR latch: \[\operatorname{SRLATCH}(\texttt{rbar},\texttt{sbar})=q.\] The first argument is responsible reset and the second for set. \[\begin{array}{c c | l} \texttt{rbar} & \texttt{sbar} & q \\ \hline 1 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 1 & \text{previous output} \\ 0 & 0 & \text{undefined}\end{array}\] The state is undefined initially and after any input \(\texttt{0 0}\), until the next set or reset. In this task, cycles in the circuit are allowed: a gate may use a label defined on a later gate line.
String task, Advanced problem