Wikipedia Link

Logic gates are really useful but if the circuit is at all complicated, the number of chips needed starts to get out of hand. Wouldn't it be nice if there were such a thing as a programmable gate that could replace many other gates.

FPGAs can contain thousands of gates. They are interconected in a particular way. The array is programmed by disabling selected connections leaving the required circuit behind.

FPGAs are based on NAND or NOR gates because every other kind of gate can be built from a combination of NAND or NOR gates.

Here are some NAND gate examples.

Task:

 

Q = A = A . A

Here are some NOR gate examples.

XOR from NOR