Chapter Two: Logic Gates: August 2020

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/343361651

Chapter Two: Logic Gates

Chapter · August 2020

CITATION READS

1 23,368

1 author:

Qasim Mohammed Hussein


Tikrit University
94 PUBLICATIONS   116 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Ranking View project

An Open Forum for Expert Opinions and Discussion View project

All content following this page was uploaded by Qasim Mohammed Hussein on 01 August 2020.

The user has requested enhancement of the downloaded file.


Chapter Two: Gates

2.1 Introduction
The individual memory cells used in computers are
bistable in operation (pendulous between 1 and 0) and
capable of storing a single binary bit. Therefore, it is
most practical to use the binary number system that
uses only two basic symbols 0 and 1 to represent
numbers.
Binary logic is used to describe, in mathematical way,
the manipulation and processing of binary information.
Binary logic consists of binary variables and logic
operations. The binary variables are letters of the
alphabet such as X, A, D . . . etc. Each variable has
two possible values, 0 or 1. The basic logic operations
are the three operations OR, AND, and NOT.
2.2 Gates
A gate is simply an electronic circuit which operates
on one or more input signals to perform the logic
operation and produce an output signal. There are
many types of gates such as: OR, AND, NOT, NOR,
NAND gates. Each gate has its block diagram symbol.

Prof Dr. Qasim Mohammed Hussein Page 52


Chapter Two: Gates

The lines connected to each symbol are the inputs on


the left and the output on the right of it.
2.3 Truth table
A truth table is a two-dimensional array where there
is one column for each input and one column for each
output (a circuit may have more than one output).
Since we are dealing with binary values, each input
can be either 0 or 1.The number of truth table
possibilities are 2n, where n is the number of input
variable. For example, if n=3 the number of
possibilities are 23=8.
The values in the output column are determined from
applying the corresponding input values to the
functional operator. For example, in the following
truth table:
Input Output
X Y F
0 0 0
0 1 1
1 0 0
1 1 1

Prof Dr. Qasim Mohammed Hussein Page 53


Chapter Two: Gates

There are 2 input variables, X and Y, and one output


variable, F. So there are 22=4 combinations.
The output F = 1 when either X and Y are both 1 or
X=0 and Y =1, while the value of F is 0 for the other
possibilities. Using truth tables is one method to
formally describe the operation of a circuit or function.

2.4 Pulse waveform


Pulses are very important in digital circuits and
systems because voltage level are normally changing
back and front between High (logic 1) and Low (logic
0) states.

Pulses can be classified as either periodic or non


periodic, as shown in fig (2-1).

(a)Periodic waveform
Prof Dr. Qasim Mohammed Hussein Page 54
Chapter Two: Gates

(b) Non- periodic waveform


Fig (2-1)
A timing diagram is a graphical method of showing
the exact output behavior of a logic circuit for every
possible of input condition. It is used to describe the
operation of digital devices because its visual
characteristics are much easier to understand than
explanation using words.

Prof Dr. Qasim Mohammed Hussein Page 55


Chapter Two: Gates

AND, OR, and NOT gates


Object
To study the logical functions AND, OR and NOT
gates, and to be familiar with its applications.
Basic gates
AND gate: The AND-gate is a device whose output is
logic (1) if both of the inputs are logic (1). It performs
logical multiplication. It composed of two or more
inputs and single output. The logical AND function of
two variables is represented either by writing dot
between the two variables or by writing the adjacent
letters without dot. For example, X . Y = Z or XY = Z
is read "X AND Y is equal to Z". This AND gate
symbol and its truth table are shown in figure (2-2-a)
and (2-2-b) respectively, with two inputs marked A
and B and one output marked X.

Prof Dr. Qasim Mohammed Hussein Page 56


Chapter Two: Gates

A B X
0 0 0
0 1 0
1 0 0
1 1 1

X=A.B Truth table


(a) (b)
Fig (2-2) AND gate

2.5 OR gate :
It is one of the simplest and most common used. It is a
device whose output is logic ‘1’ if either or both of its
inputs are ‘1’. The OR gate composed of two or more
inputs and single output. It performs logical addition.
The OR operation is represented by a plus sign, +. For
example, X + Y = Z is read " X OR Y is equal to Z".
The standard logic symbol for the OR gate is shown in
fig (2-3-a) and the truth table of combinations for the
inputs and outputs for it's is shown in fig (2-3-b).

Prof Dr. Qasim Mohammed Hussein Page 57


Chapter Two: Gates

A B X
0 0 0
0 1 1
1 0 1
1 1 1

Block diagram (X=A+B) Truth table


(a) (b)
Fig (2-3): OR gate

2.6 NOT gate (inverter)


The NOT gate (called inverter) perform a basic logic
function called inversion or complementation. It has a
single input and one output. The purpose of the NOT
gate is to change one logic level to the opposite level.
In term of bits, it change ‘1’ at its input to logic ‘0’ at
the output , and a ‘0’ to a logic ‘1’. The NOT operation
is represented by a prime or bar. The standard logic
symbol for the NOT and its truth table are shown in fig
(2-4-a) and fig (2-4-b) respectively.

Prof Dr. Qasim Mohammed Hussein Page 58


Chapter Two: Gates

A X= A

0 1

1 0

Block diagram X=A Truth table


(a) (b)
Fig (2-4): NOT gate
From the three basic logic gates (AND, OR, and NOT
gates), the most powerful computer circuit can be
made. Furthermore, these basic gates are built using
transistors, the fundamental building blocks for all
digital logic circuits. Transistors are just electronic
binary switches that can be turned on or off. The on
and off states of transistors are used to represent the
two binary values 1 and 0.
Example: Find the truth table for the following?

Solution
The number of inputs variables is 3, so the number of
combinations are . The sequence of perform the
operation as follow

Prof Dr. Qasim Mohammed Hussein Page 59


Chapter Two: Gates

The truth table is as following, the NOT is replaced with


dash in this table.

One can see the last column is equal the value of first
column. The block diagram of the circuit that represent
the expression is, figure 2-5:

Fig (2-5)

Prof Dr. Qasim Mohammed Hussein Page 60


Chapter Two: Gates

Experiment No. (1)


Procedure:
1. Connect the circuit as shown in fig (2-2 -a), using
different states of input?
2. Using different states of the input variables of this
circuit, and find the truth table of it?
3. Connect the circuit shown in fig (2-3-a) and repeat
step (2)?
4. Connect the circuit shown in fig (2-6) and find the
truth table?

Fig (2-6)
Discussion
1. If only 2 input OR gates are available, what is
the minimum gates level possible to implement an
8 input OR gate? Construct the circuit?

Prof Dr. Qasim Mohammed Hussein Page 61


Chapter Two: Gates

2. Construct the two level two input OR gate which


implement the function F(A,B,C) = ((A+B).C) or
A+B.C?
3. What are the differences between binary arithmetic
addition and logical addition?
4. Convert each of the following binary number to
decimal number?
(a) 11011.11 (b) 101010.01
(c) 1000001.111 (d) 11111000.101
(e) 1011100.10101 (f) 1110001.0
(g) 1011010.1010 (h) 1111111.11111

Prof Dr. Qasim Mohammed Hussein Page 62


Chapter Two: Gates

NAND, NOR, X-OR and XNOR gates


Object
To study the logical functions and to be familiar
with NAND, NOR, X-OR and XNOR gates.
2.7 Theory
NAND gate: The NAND gate is an inverse (negative)
of AND functions. Its output is logic (0) if both inputs
are logic (1). It is called NOT-AND gate but is
abbreviated NAND gate. Symbolically the NAND gate
is represented by the AND symbol followed by a small
circle indicating an inversion of the output, as shown
in fig (2-7). Fig (2-8) shows the equivalent of NAND
gate diagram using AND gate and NOT gate.

A B X
0 0 1
0 1 1
1 0 1
1 1 0

X = (A.B) Truth table


Fig (2-7) NAND gate

Prof Dr. Qasim Mohammed Hussein Page 63


Chapter Two: Gates

A B X
0 0 1
0 1 1
1 0 1
1 1 0

X =(A.B) Truth table


(a) (b)
Fig (2-8): Equivalent of NAND gate

2.8 NOR gate:


The NOR gate (NOT–OR) is equivalent of an inverted
OR function and will yield a low output (0) if either or
both inputs are high (1). Symbolically the NOR gate is
represented by the OR gate symbol followed by a
bubble to represent the complemented output signal.
The NOR gate is a universal building block of a
digital logic because it may be used to implement any
logic function.
The NOR gate can be represented by the symbol
shown in fig (2-9-a). Its truth table is shown in fig (2-

Prof Dr. Qasim Mohammed Hussein Page 64


Chapter Two: Gates

9-b). Fig (2-10) shows the equivalent of NOR gate


diagram using OR gate and NOT gate.

A B X
0 0 1
0 1 0
1 0 0
1 1 0

Block diagram X=(A+B) Truth table


(a) (b)
Fig (2-9): NOR gate
A B X
0 0 1
0 1 0
1 0 0
1 1 0

Block diagram X= (A+B) Truth table


(a) (b)
Fig (2-10): Equivalent of NOR gate

Prof Dr. Qasim Mohammed Hussein Page 65


Chapter Two: Gates

2.9 Exclusive- OR gate: The Exclusive- OR gate is


called the XOR gate. It gives logic (1) at the output
when both inputs are different and logic (0) when both
inputs are the same. The XOR of two variables is
written by . The XOR gate symbol and its truth table
are shown in fig (2-11).

A B X
0 0 0
0 1 1
1 0 1
1 1 0

X=AB Truth table


(a) (b)
Fig (2-11): XOR gate

2.10 Exclusive NOR gate: Exclusive NOR gate, is


called XNOR, is just the inverse of the XOR gate. The
XNOR uses the symbol , and it performs the
following logic operation :
X Y = X Y + X Y = (X ⊕ Y)

Prof Dr. Qasim Mohammed Hussein Page 66


Chapter Two: Gates

The graphic symbols and truth table of XOR is shown


in Fig (2-12). The result is 1 when either both X or Y
are 0’s or when both are 1’s.

A B X
0 0 1
0 1 0
1 0 0
1 1 1

X=A B Truth table


(a) (b)
Fig (2-12): XNOR gate

The truth tables clearly show that the exclusive-NOR


operation is the complement of the Exclusive-OR.
This can also be shown by algebraic manipulation as
follows:
(X ⊕ Y) = (X Y + X Y)
= (X Y) (X Y) = (X + Y) (X + Y)
= (X Y + X Y)
=X Y

Prof Dr. Qasim Mohammed Hussein Page 67


Chapter Two: Gates

Example: Show using Boolean algebra that XOR =


XNOR for three inputs (A  B C= A B C)?
Solution
A  B  C = (AB + AB)  C
= (AB + AB) C + (A B + AB) C
= (A B) · (A B) C + A B C + A B C
= ((A + B) · (A + B)) C + A B C + A B C
= AAC + ABC + ABC + BBC + ABC + ABC
= (AB + AB) C + (AB + AB) C
= (AB + AB) C + (AB + AB) C
= (A B) C + (A B) C = A B C

2.11 Multiple input gates


Gates are not limited to two input values. There are
many variations in the number and types of inputs and
outputs allowed for various gates. For example, one
can represent the expression X + Y + Z using one OR
gate with three inputs. Fig (2-13) illustrate the
implementation of this expression using OR gates with
two input and its equivalent by using three input OR
gate.
Prof Dr. Qasim Mohammed Hussein Page 68
Chapter Two: Gates

Fig (2-13): Three inputs gates


Multiple inputs of AND gates and multiple input of OR
gates in one circuit are illustrates in fig (2-14).

Fig (2-14)

Prof Dr. Qasim Mohammed Hussein Page 69


Chapter Two: Gates

Experiment No. (2)


Procedure:
1. Connect and find truth table 2-input NAND gates
and 2-input NOR gates?
2. Connect and find truth table XOR gates and XNOR
gates?
3. Connect the circuit shown in fig (2-15) and using
different states of input find the truth table?
4. Connect the circuit in fig (2-16) and find the values
of L1, L2, and L3 for all states of input?
5. Draw and implement the logic circuit for X = A B +
AB using X-OR gate, and then find its truth table?
6. Prove by using XOR and XNOR gates that
(A B) (C D) = ABCD?

Fig (2-15)

Prof Dr. Qasim Mohammed Hussein Page 70


Chapter Two: Gates

Discussion:
1. Give two level two-input AND gate with A, B and
C which are 1 (high), 0 (low) and high what will be
the output?
2. Prove, using truth table, that the circuit in fig (2-16)
is equivalent to that in fig (2-17)?
3. Draw and implement the logic circuit for X=AB 
(CD) and find its truth table?
4. Show using truth table that X ⊕ Y ⊕ Z = 1, IFF (if
and only if) the number of 1’s in the input
combination is odd.
5. Find the value of L1, L2, and L3in fig (2-18) for all
inputs combination?

Fig (2-16): X = (A.B.C)

Prof Dr. Qasim Mohammed Hussein Page 71


Chapter Two: Gates

Fig (2-17): X= (A.B.C)

Fig (2-18)

Prof Dr. Qasim Mohammed Hussein Page 72

View publication stats

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy