## AND GATE

Gates are the fundamental building blocks of digital logic circuitry. These devices function by “opening” or “closing” to admit or reject the passage of a logical signal. From only a handful of basic gate types (AND, OR, XOR, and NOT), a vast array of gating functions can be created.
The AND Gate A basic AND gate consists of two inputs and an output. If the two inputs are A and B, the output (often called Q) is “on” only if both A and B are also “on.” In digital electronics, the on state is often represented by a 1 and the off state by a 0. The relationship between the input signals and the output signals is often summarized in a truth table, which is a tabulation of all possible inputs and the resulting outputs. For the AND gate, there are four possible combinations of input states: A=0, B=0; A=0, B=1; A=1, B=0; and A=1, B=1. In the following truth table, these are listed in the left and middle columns.

In LabVIEW, you can specify a digital logic input by toggling a Boolean switch; a Boolean LED indicator can indicate an output. Because the AND gate is provided as a basic built-in LabVIEW function, you can easily wire two switches to the gate inputs and an indicator LED to the output to produce a simple VI that demonstrates the AND gate.

## The OR and XOR Gates

The OR gate is also a two-input, single-output gate. Unlike the AND gate, the output is 1 when one input, or the other, or both are 1. The OR gate output is 0 only when both inputs are 0.

A related gate is the XOR, or eXclusive OR gate, in which the output is 1 when one, and only one, of the inputs is 1. In other words, the XOR output is 1 if the inputs are different.