Digital logic Gates are electronic switches which are used in a wide variety of model train applications. These devices have two states of operation and therefore are called binary gates. A gate may have one or more inputs but only a single output. Binary means two and digit means a number. A binary digit has two states, 0 and 1, and is called a bit. A voltage level of 2.0 to 5.0 volts is generally described as a “1” bit while a level of 0 to 0.8 volts is a “0” bit. Gates are named for the operation they perform and usually are contained in multiple configurations in integrated circuit (I.C.) chips. The easiest way to understand the operation of a digital logic gate is to use switches as an illustration. The following example describes the operation of AND and OR gates to light a lamp: The AND gate shown will produce a 1 at its output only when both A and B inputs are 1’s. If either A or B switch is open, current will not flow and the lamp will fail to light. The OR gate shown however will light the lamp if either A or B switches, or both, are closed.
Solid state devices are used instead of switches to implement the functions of gate circuits. In the early days of computers these were diodes but are nowadays done with transistor circuits which are known as TTL (transistor-transistor logic) components.
The simplest logic device is a NOT gate which is a single input, single output circuit that does nothing more than provide signal inversion. If the input is 0, the output will be 1 and a 1 input will provide a 0 output.
The circle on output C indicates signal inversion.
A NAND gate is an AND gate with inverted output.
A NOR gate is an OR gate with inverted output.
An EXCLUSIVE OR (XOR) gate has an output of 1 if one and only one of the inputs is 1. If both inputs are 0 or 1 the output is 0.
An EXCLUSIVE OR (XOR) gate with inverted output is an EXCLUSIVE NOR (XNOR) gate.