You are on page 1of 12

LOGIC GATES

A logic gate is an electronic circuit that makes logical decisions. It has one output and one or more inputs. The output signal appears only for certain combinations of input signals. Logic gates are the basic building blocks of all digital circuits. They implement the hardware logic functions based on the logical algebra developed by George Boole.

Truth table: It is a table that shows all input and output possibilities for
a logic gate. It is also called a table of combinations. Boolean expression: In Boolean algebra the variables used can assume only one of the two variables i.e. either ! or ". The true value is denoted by " and the false value by !. It was first applied to switching circuits as a switch is a binary device #on or off$.

Binary Numbers
The Binary number system has only two bits ! and ". That is the base of the binary numbers system is %. 1. Conversion of de imal number system to binary number system To convert a decimal number to a binary number we keep on dividing the given number by % until the &uotient is !. The remainders obtained in successive divisions taken in the reverse order would represent a binary number. Binary representation of decimal number %' is shown below:

Binary representation of decimal number 25

The remainders in reverse order are " " ! ! ". Therefore binary representation of %' is #""!!"$%.

2. Conversion of binary number system to de imal number system (ince the base in binary number system is %. Therefore to convert a binary number to a decimal number we multiply least significant bit #L(B$ by %! the ne)t bit by %" ne)t bit by %% and so on till the most significant bit #*(B$ is attained and then add all these products of multiplication. +or e)ample to convert a binary number ""!!" to decimal number we would follow following process:

Decimal representation of binary number

In Boolean algebra addition symbol #,$ is referred to as O!" The Boolean e)pression y - A , B implies y e&uals A ./ B. The multiplication sign #either or dot #"$ $ is referred to as AN#. The Boolean e)pression y - A .B implies y e&uals A A01 B. The bar symbol #2$ is referred to as NOT. The Boolean e)pression y - implies y e&uals 0.T A. The not operation is also called negation or inversion.

O! GATE
It has two or more inputs and one output. The electronic symbol for a two3input ./ gate is shown in the figure below.

OR gate The two inputs have been marked A and B and the output as y. The ./ gate has an output of " when either A or B or both are ". In other words it is an any$or$all %ate because an output occurs when any or all the inputs are present. The output would be ! if and only if both its inputs are !. The ./ gate represents the Boolean e&uation A , B - y. The meaning of this e&uation is that y is true when either A is true or B is true or both are true. Alternatively it means that y is " when either A or B or both are ". The above logic operation of the ./ gate can be summari4ed with the help of the truth table shown below. A ! ! " " B ! " ! " y & A ' B ! " " "

In practice an ./ gate can be reali4ed by an electronic circuit making use of two ideal 5unction diodes 1" and 1% as shown in the figure below.

OR gate using diodes i. The input voltage that can be applied at A or B is either ! or ' 6. The operation of an ./ gate may be discussed in terms of the

ii.

iii.

iv.

following possible cases: A - ! and B - !. 7hen both A and B are connected to earth #! 6$ both the diodes do not conduct. 8ence no voltage develops across the resistor and accordingly the output y is !. A - ! and B - ". 7hen A is connected to earth #! 6$ and B is connected to positive terminal of battery #' 6$ 5unction diode 1" does not conduct while diode 1% conducts due to forward biasing. If diode is an ideal one output y will also be ' 6 #or "$. #In binary system two levels of voltages are to be represented as ! or "$. A - " and B - !. In this case reverse of the above will occur. The diode 1" will conduct due to forward biasing and 1% will not conduct. Thus output will be ' 6 #or "$. A - " and B - ". 7hen both A and B are connected to positive terminal of the battery #' 6$ both the diodes will conduct. Because both the outputs of the two diodes obtained across resistor / are in parallel the net output y will also be ' 6 #or "$.

AN# GATE
It has two or more inputs and one output. The A01 gate gives its output only when all its inputs are present. The A01 gate has an output " when both A and B are ". 8ence the gate is an all$or$nothin% gate whose output occurs only when all its inputs are present. The electronic symbol for a two3input A01 gate is shown in figure below.

AND gate Its logical operations can be summari4ed with the help of the truth table.

A ! ! " "

B ! " ! "

y & A " B ! ! ! "

The A01 gate can be reali4ed by an electronic circuit making use of two ideal 5unction diodes 1" and 1% as shown in the figure below.

AND gate using diode

The resistor / is connected to positive terminal of a ' 6 battery. The operation of A01 gate can be discussed in terms of the following four cases: i. A - ! and B - !. Both the diodes 1" and 1% get forward biased and hence conduct. The output will be the voltage drop across 1" or 1%. (ince the diodes are ideal no voltage drop can occur. 8ence the output y is !. A - ! and B - ". The diode 1" will conduct while 1% will not conduct. 0ow output y is voltage across 1% which is !. A - " and B - !. The diode 1% will conduct and 1" will remain idle. 0ow output y is voltage across 1" and hence it is !. A - " and B - ". Both the diodes will not conduct. The output y will be e&ual to battery voltage ' 6 and hence is e&ual to ".

ii. iii. iv.

0.T GAT9
It has only one input and only one output. It is a complementary operation and its symbol is an over bar. As stated earlier means taking negation or complement of ! that is ". The symbol of 0.T gate is shown below.

NOT gate

Its logical operations can be summari4ed with the help of the truth table.

! "

" !

The 0.T gate is also called inverter. It cannot be reali4ed by making use of 5unction diode but is achieved by employing a transistor.

NOT gate using transistor

The base B of transistor is connected to A through a resistor

while

the emitter is earthed. The collector is earthed through a resistor and a ' 6 battery. The operation of 0.T gate can be discussed in terms of the following two cases:

i.

ii.

A - !. The base of the transistor gets earthed. Therefore base3 emitter 5unction is not forward biased. (ince base current is 4ero collector current is also 4ero. The transistor is said to be in cut3 off mode. The output y will be e&ual to the voltage of battery connected to collector i.e. ' 6 or ". A - ". The base emitter 5unction gets forward biased and it leads to a large collector current. The transistor is said to be in saturation. The voltage drop across the resistor ' 6 and the output y is almost 4ero. is 5ust e&ual to

:ombination of gates
6arious combinations of the three basic gates ; ./ A01 and 0.T give rise to complicated digital circuits. 7e now discuss two of them ; 0./ gate and 0A01 gate.

(I) NO! %ate


It is in fact a 0.T3./ gate. It can be made out of an ./ gate by connecting an inverter in its output as shown in the figure below.

NOR gate

The output e&uation is given by

A 0./ function is 5ust the reverse of the ./ function. A 0./ gate will have an output of " only when all its inputs are !. .bviously if any input is " the output will be !. 0./ gate is often referred to as a universal %ate as it can be used to reali4e the basic logic functions ./ A01 and 0.T.

#esi%n of NOT %ate usin% NO! %ates* The two inputs have been connected together as shown in the figure below.

NOT gate using NOR gate

The output is which can be proved to be e&ual to of 1e *organ<s theorem.

with the help

#esi%n of O! %ate usin% NO! %ates* As can be seen from the figure below the output from 0./ gate is A , B.

OR gate using NOR gate

By using another inverter in the output the final output is inverted and is given by y - A , B which is the logic function for a normal ./ gate.

#esi%n of AN# %ate usin% NO! %ates* 8ere two inverters have been used one for each input as shown in the figure below.

AND using NOR gate The inputs have thus been inverted before they are applied to the 0./ gate. The output is e&ual to A. B which is same as that of A01 gate.

(II) NAN# %ate


It is in fact a 0.T3A01 gate. It can be obtained by connecting a 0.T gate in the output of an A01 gate as shown in the figure below.

NAND gate

Its output can be given by the Boolean e&uation This gate gives an output of " if both inputs are not ". In other words it gives an output " if either A or B or both are !. A ! ! " " B ! " ! " + " " " !

The truth table for a %3input 0A01 gate is 5ust opposite of the truth table for A01 gate. It is so because 0A01 gate performs a function that is reverse of an A01 gate. 0A01 gate is also called the universal %ate because it can perform all the three logic functions of an ./ gate A01 gate and inverter #0.T gate$ as shown below.

#esi%n of a NOT %ate usin% NAN# %ate* A 0.T gate can be made out of a 0A01 gate by connecting its two inputs together as shown in the figure below.

NOT gate using NAND gate

#esi%n of an AN# %ate usin% NAN# %ates* The use of two 0A01 gates to produce an A01 gate is shown in the figure below.

AND gate using NAND gate

#esi%n of an O! %ate usin% NAN# %ate* (imilarly the figure below shows how ./ gate can be obtained out of three 0A01 gates. As seen from the figure if the inputs A and B after being inverted by using two 0.T gates #obtained from the 0A01 gates$ are then fed to the 0A01 gate the arrangement functions as the ./ gate.

OR gate using NAND gate

,oints to remember
i. Truth table is a table that shows all input and output possibilities for a logic gate. It is also called a table of combinations. A logic gate is an electronic circuit that makes logical decisions. It allows a signal either to pass or stops through it. O! %ate is known as any$or$all %ate because an output occurs when any or all the inputs are present. AN# %ate is an all$or$nothin% gate as output occurs only when all its inputs are present. NAN# and NO! %ate are known as digital building block

ii. iii. iv.

v.

#=niversal gates$ as all gates i.e. ./ A01 0.T gate can be designed from them.

You might also like