Basic Gates

Combinational circuitry is conceptually constructed from basic logic gates: AND gates, OR gates, XOR gates, and inverters. Inverters are most often displayed as small circles on inputs or outputs of logic elements.

AND Gates

An AND gate can conceptually have any number of inputs. Its output is true when all of its inputs are true. A 2-input AND gate is shown to the left.

AND Control

An AND gate is frequently used to control a signal — turn it on or off depending on the value of control signals. The AND gate to the left is set up to control the X signal using two control signals S1 and S0.

The small circle on the S1 input means the S1 signal is inverted before it goes into the AND gate.

The control use of AND gates is at the heart of implementing the routing circuits: multiplexers and demultiplexers.

OR Gates

An OR gate can conceptually have any number of inputs. Its output is true when any one of its inputs is true. A 2-input OR gate is shown to the left.

XOR Gates

An XOR (eXclusive OR) gate has two inputs. Its output is true when one of its inputs, but not both, are true. An XOR gate is shown to the left.

XOR Control

An XOR gate is sometimes used to control a signal — invert it or not depending on the value of a control signal. The XOR gate to the left is set up to control the X signal using the control signal Inv.

The most important use of an XOR gate as a control occurs in the implementation of an adder/subtracter, where XOR gates are used to control complementing one of the numbers. Complementing a binary number is part of a 2's complement operation, which has the effect of negating the number.