Saturday 13 October 2012

Digital Logic-Logic Gates, by Tan Sin Yee


LOGIC GATES

What is Logic Gates?
·        A logic gate is an elementary building block of a digital circuit which produce signals of binary 1 or 0 when input logic requirements are satisfied.
·        Most logic gates have two inputs and one output.
·        At any given moment, every terminal is in one of the two binary conditions low (0) or high (1), represented by different voltage levels.
·        In most logic gates, the low state is approximately zero volts (0 V), while the high state is approximately five volts positive (+5 V).
·        Each logic gate has a unique truth table and a symbol can be associated.
·        The fundamental logic gates are OR & AND gates and the other logics include inverter(NOT gates), NAND gates, or, XNOR gates.

Universal logic gates
There are 2 universal logic gates:
       i.            NAND
·        Its logical operation is sometimes called Sheffer stroke.
     ii.            NOR
·        Its logical NOR is sometimes called Peirce's arrow.
*They are defined as universal logic gates because all the other logic Gates can be constructed by using both these logic gates.

SERIES OF SYMBOLS
There are two series of symbols for logic gates:
i. Traditional symbols
·        distinctive shapes making them easy to recognise.             
·        widely used in industry and education.
ii. IEC (International Electrotechnical Commission symbols
·        rectangles with a symbol inside to show the gates’ functions.
·        rarely used despite their official status, but sometimes it will “appear”  on an examination.
  Inputs and outputs
·        Most gates have two or more inputs, except a NOT gate which has only one input.
·        All gates have only one output.
·        Usually the letters A, B, C and so on are used to label inputs, and Q is used to label the output.
·        The inputs are shown on the left side and the output on the right side.


The inverting circle (o)
Some gate symbols have a circle on their output which means that their function includes inverting of the output. It is equivalent to feeding the output through a NOT gate. For example the NAND (Not AND) gate symbol shown on the right is the same as an AND gate symbol but with the addition of an inverting circle on the output.


TYPES OF LOGIC GATES
There are seven types of logic gates.
1. NOT gate 
It is also called an inverter.
Has only one input.
The output Q is true when the input A is NOT true, the output is the inverse of the input: Q = NOT A.

2. AND gate
The AND gate is  named because, if 0 is called "false" and 1 is called "true," the gate acts in the same way as the logical "and" operator.The output is "true" when both inputs are "true." Otherwise, the output is "false."
The output Q is true if input A AND input B are both true: Q = A AND B
An AND gate can have two or more inputs, its output is true if all inputs are true.

      3.   NAND gate (NAND = Not AND)
This is an AND gate with the output inverted, as shown by the 'o' on the output. 
The output is true if input A AND input B are NOT both true: Q = NOT (A AND B) 
A NAND gate can have two or more inputs, its output is true if NOT all inputs are true.
The NAND gate operates as an AND gate followed by a NOT gate. It acts in the manner of the logical operation "and" followed by negation. The output is "false" if both inputs are "true." Otherwise, the output is "true."
       4.   OR gate
The OR gate gets its name from the fact that it behaves after the fashion of the logical inclusive "or." The output is "true" if either or both of the inputs are "true." If both inputs are "false," then the output is "false.
The output Q is true if input A OR input B is true (or both of them are true): Q = A OR B 
An OR gate can have two or more inputs, its output is true if at least one input is true.
An OR gate with the output inverted, as shown by the 'o' on the output. 

       5.  NOR gate (NOR = Not OR)
The output Q is true if NOT inputs A OR B are true: Q = NOT (A OR B) 
A NOR gate can have two or more inputs, its output is true if no inputs are true.
The NOR gate is a combination OR gate followed by an inverter. Its output is "true" if both inputs are "false." Otherwise, the output is "false."

       6.     XOR (EXclusive-OR) gate
The output Q is true if either input A is true OR input B is true, but not when both of them are true: Q = (A AND NOT B) OR (B AND NOT A) 
This is like an OR gate but excluding both inputs being true. The output is true if inputs A and B are DIFFERENT. 
XOR gates can only have 2 inputs.
The XOR ( exclusive-OR ) gate acts in the same way as the logical "either/or." The output is "true" if either, but not both, of the inputs are "true." The output is "false" if both inputs are "false" or if both inputs are "true."
The output is 1 if the Inputs are different, but 0 if the inputs are the same.

7.   XNOR (EXclusive-NOR) gate
This is an XOR gate with the output inverted, as shown by the 'o' on the output. 
The output Q is true if inputs A and B are the SAME (both true or both false): Q = (A AND B) OR (NOT A AND NOT B) 
XNOR gates can only have 2 inputs.
The XNOR (exclusive-NOR) gate is a combination XOR gate followed by an inverter. Its output is "true" if the inputs are the same,  and"false" if the inputs are different.

Table below show the types of gates, traditional symbols, IEC symbols and Boolean Expression.                            

Truth table in Digital Logic

·        It is a mathematical table used in logic which specifically in connection with Boolean algebra, Boolean functions, and propositional calculus to compute the functional values of logical expression each of their functional arguments.

·        It is also used to specify the functionality of hardware look-up tables (LUTs) in digital logic circuitry. For an n-input LUT, the truth table will have 2^n values (or rows in the above tabular format), completely specifying a boolean function for the LUT. By representing each boolean value as a bit in a binary number, truth table values can be efficiently encoded as integer values in electronic design automation (EDA) software. For example, a 32-bit integer can encode the truth table for a LUT with up to 5 inputs.

·        When using an integer representation of a truth table, the output value of the LUT can be obtained by calculating a bit index k based on the input values of the LUT, in which case the LUT's output value is the kth bit of the integer. For example, to evaluate the output value of a LUT given an array of n boolean input values, the bit index of the truth table's output value can be computed as follows: if the ith input is true, let Vi = 1, else let Vi = 0. Then the kth bit of the binary representation of the truth table is the LUT's output value, where k = V0*2^0 + V1*2^1 + V2*2^2 + ... + Vn*2^n.

·        Truth tables are a simple and straightforward way to encode boolean functions, however given the exponential growth in size as the number of inputs increase, they are not suitable for functions with a large number of inputs. Other representations which are more memory efficient are text equations and binary decision diagrams.

 Logic Gates with Their Truth Table


REFERENCES


Written by,
Tan Sin Yee
B031210297



1 comment:

  1. it is a perfect explanation for the beginners to learn about the logic gates concepts.

    ReplyDelete