You are on page 1of 11

DUHOK POLYTECHNIC UNIVERSITY

Refrigeration & AC

Department Of
Refrigeration & Air conditioning Engineering

logic gate

Experiment NO: - 7

Date of Experiment: - 31 – 10 -2017


Therd class / 2017-2018
Name: Balen Karim Mr.Essam
Introduction
A logic gate is an elementary building block of a digital circuit. 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. The logic state of
a terminal can, and generally does, change often, as the circuit
processes data. In most logic gates, the low state is approximately
zero volts (0 V), while the high state is approximately five volts
positive (+5 V)

There are seven basic logic gates: AND, OR, XOR, NOT, NAND,
NOR, and XNOR.

The AND gate is so 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 following illustration and table show the circuit
symbol and logic combinations for an AND gate. (In the symbol,
the input terminals are at left and the output terminal is at
right.) The output is "true" when both inputs are "true."
Otherwise, the output is "false
Objective: To familiarize students with essential logic gates and
digital circuits.
Apparatus:
1. A laptop computer
2. Circuit Maker software
Theory: A basic logic gate is defined as a digital function that
follows some logical relationship between its inputs and output.
They are primarily implemented electronically but can also be
constructed using electromagnetic relays, pneumatics, optical or
even mechanical elements. It may have one or more inputs, but
only one output. The output responds to the possible alternative
states of inputs, which can be expressed in a tabular format
called truth table. The state of each element in the truth table is
either true or false which easily can be presented electrically by
a simple analogy of an ON/OFF switch, electronically by two
voltage levels of 5V/0V or High/Low respectively. However, to
make the mater easier, it was agreed upon using binary digits 1
and 0 to represent all the above cases.
The essential logic gates are AND, OR and NOT. With these
three gates, any logical equation can be implemented. The
symbol and truth table of each gate is shown below:-
Logic Gates and Boolean Algebra
AND gate:
A B A·
B
0 0 0
0 1 0
Y=A.B and also AB 1 0 0
1 1 1
OR gate:
A B A+B
0 0 0
0 1 1
1 0 1
Y=A+B 1 1 1
NOT gate:
A A
0 1
Y=A and easier way is A’ 1 0

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

Y=A+B or this way (A+B)’

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:-

It will be explained thoroughly in the lab.

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:-

2- K-map for three variables:-

3- K-map for four variables:-

It will be explained thoroughly in the lab.


Procedure:
1- Start the circuit maker software.
2- Go to simulation at the menu bar and select Digital Mode.
3- Construct Circuit-1 in Fig.1 below.
4- Browse and click on Digital Basics.
5- Go to Gates and then choose the 2-inputs AND gate.
6- Place it and repeat step 5 for the OR gate.
7- Go to search and type inverter, select 4049.
8- Go to search and type switch, select Logic Switch down
there.
9- Double click the switches to change the 2nd field in
Device Properties box to A for the 1st switch and B for the
2nd switch.
10- Go to search and type display, select Logic Display.
11- Wire them all and run, then verify their truth tables
by clicking on the switches to get all possibilities (i.e. 00,
01, 10, 11 ).
12-Repeat steps 4 to 10 for Circuit-2 and 3.

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’

3- What is the function of each output in Circuit-5?

Y=B+A

4- Which rule has been used in Circuit-5?


1- A+A=A 2- A.A=A
5- What is the function of each output in Circuit-6?

Y=(A+0)+(B.1)
Y=A+B

6- Which rule has been used in Circuit-6?

1- A.0=0 2- A.1=A 3- A+0=A 4- A+1=1

You might also like