Solution (source code)

= Solution

Address a <read-only memory> with the two state <bits> and two input <bits>. Each word stores the two next-state bits and `INC`, so a direct replacement for all the combinational logic is \b[$16\times3$ bits, or 48 bits]. Program its 16 words from the state table, duplicating a state's output over all four input addresses. The two <D flip-flops> and clock remain outside the ROM.

If `INC` retains its separate two-state-bit decoder, only the next-state logic needs a \b[$16\times2$-bit ROM], plus that output gate. Storing output in a separate state-only ROM would use $4\times1$ further bits. These factored options have a different boundary from replacing all the combinational logic with one ROM.