Professional Documents
Culture Documents
Refrigeration & AC
Department Of
Refrigeration & Air conditioning Engineering
logic gate
Experiment NO: - 7
There are seven basic logic gates: AND, OR, XOR, NOT, NAND,
NOR, and XNOR.
Actually, there are two more very important gates that can be
produced by inverting the output of the first two gates using the
NOT gate, those are the NAND and the NOR gates. However,
the making of a NAND gate can be much simpler than inverting
an AND gate, since in electronics the NAND has the lowest
component count of any other gate when using modern
semiconductor techniques. As such, the NAND gate can
effectively replace AND, OR and NOT gates, making it the only
gate that is needed in a real system. Programmable logic arrays
would very often contain nothing but NAND gates to simplify
their entire design.
The Symbols and Truth Tables of the gates are as following:-
NAND gate:
A B A·
B
0 0 1
Y= A · B and also (A.B)’ or (AB)’ 0 1 1
1 0 1
1 1 0
A B A+B
0 0 1
0 1 0
1 0 0
NOR gate: 1 1 0
Finally, there are two more important gates, which are XOR
(Exclusive OR) and XNOR (Exclusive NOR). Although these
gates can be constructed using the above basic gates, but still
can be considered essential logic gates for their unique
functionality. The Symbols and Truth Tables of these two gates
are shown below.
XOR gate:
A B A
B
0 0 0
Y=A+B 0 1 1
1 0 1
1 1 0
XNOR gate:
A B A
B
0 0 1
Y=A+B and also (A+B)’ 0 1 0
1 0 0
1 1 1
There are certain rules that can be used to simplify any logical
expression, these rules are shown in the following table:-
Group Group Group Group 4 Group 5
1 2 3
(A’)’= A.A=A A.0=0 A.(B+C)=A.B+A.C A+A.B=A
A A.1=A *(A+B)’=A’.
A.A’=0 A+A= A+0= A+(B.C)=(A+B)(A+ B’
A+A’= A A C) *(A.B)’=A’+
1 A+1= B’
1 A+A’.B=A+B
*Those two rules called DeMorgan’s Theorems
In any truth table the output depends upon the function required
by the logical circuit, which corresponds to all possible cases of
its input variables. Consequently, the logical output expression
can be obtained by two ways, either by SOP (sum of input
variables products (called minterms) whenever the output is “1”)
or by POS (product of sums of inverted input variables (called
Maxterms) whenever the output is “0”). For example, in the OR
gate truth table above the output is “1” in three possible cases of
A and B while it is “0” once only. Therefore, choosing one
product when the output=“0” is definitely much easier as shown
below:-
Y=A’’+B’’= A+B ... using product of sums POS (i.e.
Maxterms)
It can also be solved by taking the sum of products SOP (i.e.
minterms) when the output=“1” just to show how long it will be,
which is as following:-
Y= A’B+AB’+AB= A’B + A (B’+B) = A’B+A since (B’+B) =1
--- using the 3rd rule of Group 1, then by inverting the result
twice:-
Y= ((A’B + A)’)’= ((A’B)’.A’)’= ((A+B’).A’)’--- using the 2nd
rule of Group 5.
Hence, Y= (AA’+A’B’)’ = (0 + A’B’)’ = (A’B’)’ --- which can
be further simplified by using the 3rd rule of Group 5 then:-
Y=A’’+B’’= A+B
Gray Code
Gray code is a sequence of binary numbers which has a change
in 1-bit position for consecutive numbers as shown below:-
K-map
In 1954 Maurice Karnaugh an American physicist and
mathematician was working at Bell Labs developed the
Karnaugh map in (1954) to simplify logical expressions without
using Boolean algebra.
It can be used to simplify expressions of 2, 3 & 4 logical input
variables that will be covered here, more than that gets
complicated at this stage.
1- K-map for two variables:-
Discussion:
1- Construct Circuit-4 in Fig.2 below then make its truth
table and compare the results with the truth table of Circuit
Circuit 1 – fig(1)
A B Output L1 Output L2 Output L3
0 0 0 0 1
1 0 0 1 0
0 1 0 1
1 1 1 1
Circuit 4- fig(2)
A B Output L1 Output L2
0 0 0 0
1 0 0 0
0 1 0 0
1 1 1 1
2- Which rule has been used to change Circuit-1 to 4?
1-*(A+B)’=A’.B’ 2-*(A.B)’=A’+B’
Y=B+A
Y=(A+0)+(B.1)
Y=A+B