Saturday, December 3, 2011

Logic Gates

Binary logic presupposes two distinguishing characteristics : two-valued variables, appropriate logical operations. Unlike the situation of ordinary numbers, the value of the variables in binary logic can be only two in number. In fact, they do not even need to be numbers. They should perhaps more properly be called states. One pair of terms that can be used to identify the two states that binary variables can assume is : open and closed. Another suitable pair is : high and low. Others pair are hot and cold, true and false, on and off, plus and minus, yes and no, up and down, excited and unexcited etc. In each case the binary variable can take on at any given time only one of the two values. However on the basis of logic, these two variable should be mutually exclusive. For binary mathematical manipulations of switching and logic functions binary variables 0 and 1 are best suited.
There are three logical operations associated with binary logic viz AND , OR and NOT. The two binary variables A and B, each of which can assume the value of 0 and 1, are introduced as to facilitate the description of three logical operations.

Logic Circuits : A circuit which performs the arithmetic and logical functions, is a combination of different logic circuits. Various types of Gates are used in logic circuits. A gate is the digital circuit with one or more input voltages but with one output voltage. The most common logic gates are NOT gate, OR gate and AND gate.
Logic Gates are of two types viz combinational and sequential. In combinational gates, the output at any instant depends upon the input at that instant while in case of sequential gates, the output depends on the order or sequence in which the inputs are applied i.e. the sequential gates have memory function. AND, OR, NOT, NAND, NOR fall in category of combinational gates whereas flip-flops, registers and counters from the sequential gates.



1) OR Gate : The OR gate performs logical addition, more commonly known as the OR function. An OR gate has two or more input signals with only one output signal. In OR gate, the output voltage is high, if any or all of the input voltages are high. Diodes may be used to build an OR gate.


The symbols used for OR gates with two inputs are shown in figure. The inputs A, B are logic voltage levels and the output (A+B) is a logic voltage level whose value is the result of the OR operation on A,B. In other words, the OR gate operates in such a way that its output is high (logic 1) if and only if one or more inputs are high. The OR gate output will be low (logic 0) only if all inputs are low or at logic 0.



Its logical equation is given as :
OUTPUT = A OR B OR ...OR N 
                = A + B +...+ C
This equation is known as Boolean equation or the logical equation of the OR gate.

2) AND Gate : The AND gate performs logical multiplication, more commonly known as AND function. The AND gate has two or more inputs and a single output. The AND gate provides high output only when all inputs are high. 



This figure shows one way to build a two input AND gate. The input voltages are labelled A and B, while the output voltage AB.  The input A, B are logic voltage levels and output AB is a logic voltage level whose value is the result of the AND operation on A, B.



The operation of the AND gate is such that the output is high or 1 if and only if all the inputs are high or 1. Mathematically, it is written as :
Output = A AND B AND ......AND C
           = A.B...C = ABC...N
Where A, B,C are the inputs variables.

3) NOT Gate or Inverter : The NOT gate performs a basic logic function called inversion or complementation. The purpose of the inverter is to change one logic level to the opposite level. In terms of bits, it changes a 1 to 0 and vice versa.



This gate has only one input and one output. NOT gate is called the inverter because output state is always opposite to the input state, so when the input signal is low signal, output signal is high and vice-versa. It is called NOT gate because the output state is always opposite to that of input state. A transistor may be used as an inverter.


The placement of the bubble on the input or output of a logic element is determined by the active state of the input signal (pulse or level). The active state is the state (1 or 0) when the signal is considered to be present on the output. When the active state of the input is a 0, the bubble is placed on the input. When the active output state is a 0, the bubble is placed on the output.
The logic equation of the NOT gate is written as :
Output = NOT A 
NOT A equals complement of A.

4) NAND Gate : The term NAND is a contraction of NOT-AND and implies and AND function with complimented (inverted) output. In this gate output is low only when all the inputs are high. A standard logic symbol for a 2-input NAND Gate and the equivalent NOT gate followed by an inverter is shown in figure :


The standard symbol for the NAND gate is the same as the AND gate symbol except for small circle on its output. Once this small circle shows the inverse operation. Thus the NAND gate operates like an AND gate followed by an inverter.
The operation of this gate can be described as given below :
Output = Complement of A.B.C...N


NAND gate output is the exact inverse of the AND gate for all possible input conditions. The NAND gate output goes low only when all inputs are high while the AND gate output goes high only when all the inputs are high.