Write a program to simulate the behavior of an m * n array of two-input NAND gates. This circuit, contained on a chip, has j input pins and k output pins. The values of j, k, m, and n are compile-time parameters of the simulation. The program should start off by reading in a ‘‘wiring list,'' each wire of which specifies an input and an output. An input is either one of the j input pins or the output of some NAND gate. An output is ei- ther one of the k output pins or an input to some NAND gate. Unused inputs are logical
1. After reading in the wiring list, the program should print the output for each of the 2 j possible inputs. Gate array chips like this one are widely used for putting custom circuits on a chip because most of the work (depositing the gate array on the chip) is independent of the circuit to be implemented. Only the wiring is specific to each de- sign.