The truth table for system of four NAND gates as shown in the figure is
ABY000011101110
Outputs of the gates are marked as y, y1 and y2:
A NAND gate gives low output when both the inputs are high, otherwise, it gives a high output. Now, the truth table is