Field-programmable gate array

A Field-programmable gate array (often shortened to FPGA) is an integrated circuit which can be "programmed" before it is used by a customer. Each FPGA has a certain capacity of logic blocks; each block can be programmed to hold a certain number of logic gates. The logic gates will be connected with each other to provide the desired functionality. Programming is done using a programming language developed for the purpose, called a Hardware Description Language (HDL). The logic blocks can also be assigned the function to act as computer memory, which allows to store certain values. Some FPGAs do not only offer logic gates such as XOR or Flip-flops, but also higher-level components such as the logic for an Ethernet controller.
Because of their design, a logic circuit done as an FPGA will be slower than if it is done on a dedicated integrated circuit (called ASIC). Nevertheless, FPGAs are often used, especially for tasks where only a limited number of units can be sold.
FPGAs are generally built upon programmable logic elements and programmable interconnects. One building block of logic elements is a programmable Lookup Table (LUT). A LUT can be programmed to output any value given input values. In this way, a LUT can be programmed to be any type of logic with the same number of inputs and outputs. For example, a 2-input, 1-output LUT can be programmed to emulate the logic of a 2-input AND, OR, NAND, NOR, XOR, etc. The output of this LUT can be either saved using a register (see CPU), or connected to the input of other LUTs. Using a programmable mux, the FPGA can be programmed to choose the registered or non-registered output. This combination of a LUT, a register, and a mux is the general structure of a logic element.
To connect these logic elements together, pass transistors are used. The transistor can be programmed to either connect a signal or not, thereby giving the FPGA the ability to very specifically connect logic elements together. For example, if the output of one logic elements will feed the input of another, the pass transistor can be programmed to connect these two wires together and match the specified logic. Between the logic elements and the pass transistors, a compiler can take a hardware description from an HDL, create the logic for the logic elements, and connect them together using the pass transistors.