[go: up one dir, main page]

0% found this document useful (0 votes)
18 views37 pages

DLD Chapter 3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 37

Chapter 3

Basic and Derived Logic Gates

1
OR OPERATION
 Let A and B represents two independent logic variables.
 When A and B are combined using the OR operation the result Y can be
expressed as
Y = A+B
 In this expressionthe + sign does not stand for ordinary addition; it
stands for the OR operation, whose rules are given in the truth table
shown below
A B Y= A+B

0 0 0

0 1 1

1 0 1

1 1 1

2
 It should be apparent from the truth table that except for the
case where A=B=1, the OR operation is the same as ordinary
operation.

 However, for A=B=1 the OR sum is 1 (not 2 as in ordinary


addition).

 This is easy to remember if we recall that only 0 and 1 are


possible values in Boolean algebra, so that the largest value we
can get is 1.

3
 This same result is true if we have Y= A+B+C, for the case
where A=B=C=1 that is

Y= 1+1+1 = 1

 We can therefore say that the OR operation result will be 1


if any one or more variables is a 1

 The expression Y= A+B is read as

‘’Y equals A OR B’’

4
OR Gate
 A gate is logic circuit with one output and one or more inputs; an output signal
occurs only for certain combinations of input signals.

 In digital circuitry an OR gate is a circuit that has two or more inputs and whose
output is equal to the OR sum of the inputs.

 This is the logic symbol for a two-input OR gate

 The OR gate operates in such way that its output is HIGH (Logic 1) if either input A
or B or both are at a logic 1 level.

 The OR gate output will be Low (Logic 0) only if all its inputs are at logic 0.This same
idea can be extended to more than two inputs.

 Figure below shows two inputs OR gate and its truth table.

A Logic symbol of
Y=A+B
B Two-input OR gate

5
Summary of the OR Operation

 The OR operation produces a result of 1 when any of the input


variables is 1

 The OR operation produces a result of 0 only when all the input


variables are 0.

 With the OR operation, 1+1 =1, 1+1+1 = 1, and so on.


Logic symbol of A B C Y= A+B+C
three-input OR gate 0 0 0 0
0 0 1 1
A 0 1 0 1
B Y = A + B+C 0 1 1 1
C
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

6
Discrete OR Gate
D1
+5 V
A Y
A B Y
B 0 0 0
D2
R 0 1 1
Y
1 0 1
Two-input R
1 1 1
diode OR Gate
A T1 T2 T3

B Truth Table

Two-input 7
Transistor OR gate
AND OPERATION
 If two logic variables A and B are combined using the AND operation, the
result, Y, can be expressed as

Y= A·B

 In this expression the ∙ sign stands for the Boolean AND operation whose
rules are given in the truth table shown in figure below.

 It should be apparent from the table that the AND operation is exactly the
same as ordinary multiplication.

 Whenever A or B is 0, their product is zero, when both A and B are 1,


their product is 1. We can therefore say that in the AND operation the
result will be 1 only if all the inputs are 1: for all other cases the result is
0.
8
 The expression Y= A.B is read ‘’Y equals A AND B’’

 The multiplication sign is generally omitted as in ordinary


algebra, so that the expression becomes Y=AB
A B Y= A.B

0 0 0

0 1 0

1 0 0

1 1 1

9
AND Gate
 The logic symbol for a two- input AND gate is shown in fig. Below
A
Y = AB
B

Logic symbol of AND gate


 The AND gate output is equal to the AND product of the logic inputs i.e. Y=
AB.

 In other words, the AND gate is a circuit that operates in such a way that its
output is HIGH only when all its inputs are HIGH.

 For all other cases the AND gate output is LOW.

 This same operation is Characteristic of AND gates with more than two
inputs.

 A three-input AND gate and its accompanying truth table are shown in fig.
Below. A
B Y = ABC
C
Logic symbol of 10
three-input AND gate
Summary of the AND operation

 The AND operation is performed exactly like ordinary


multiplication 1s and 0s

 The output equal to 1 occurs only for the single case where all
inputs are 1

 The output is 0 for any case where one or more inputs are 0.
A B C Y=ABC

0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

11
Discrete AND Gate
+5 V +5 V

A B X
0 0 0
A T1 Y
A Y 0 1 0
1 0 0
B B T2 T3
1 1 1

Two-input
diode AND Gate Two-input Truth Table
Transistor AND gate 12
NOT OPERATION
 The NOT operation is unlike the OR and AND
operation in that it can be performed on a
single input variable.
 Example: If the variable A is subjected to the A Y= Ā
NOT operation, the result Y can be expressed
as
Y= Ā 0 1
 Where the over bar represents the not
operation. 1 0
 This expression is read as
 ‘’Y equals NOT A’’ or
 ‘’Y equals the inverse of A ‘’ or
 ‘’Y equals the complement of A’’.
 All indicate that the logic value of Y= Ā is A
opposite to the logic value of A. Y=A
 The truth table below clarifies this for the two Presence of small circle
cases
always denotes inversion

13
NOT Circuit (INVERTER)
Fig below, shows the symbol for a not circuit, which is more
commonly called an INVERTER.
This circuit always has only a single input and its output logic
level is always opposite to the logic level of this input.

Discrete NOT Gate


+5 V

R
A Y

Y
0 1

A
1 0
T

Truth Table

Transistor as Inverter 14
Summary of Boolean operation
The rules for the OR, AND, and NOT
operation may be summarized as follows:

OR AND NOT
0+0 = 0 0·0 = 0
0 1
0+1 = 1 0·1 = 0
1 0
1+0 = 1 1·0 = 0

1+1 = 1 1·1 = 1

15
Derived Logic Gates
NOR GATES & NAND GATES

 Two other types of logic gates, NOR gates and NAND gates,
are used extensively in digital circuitry.

 These gates are derived from combination of the basic AND,


OR and NOT gates, which make it relatively easy to describe
them using the Boolean algebra operations learned
previously.

16
NOR Gate
 The NOR gate is actually a NOT OR gate. In other words, the output of an OR
gate is inverted to form a NOR gate.

 Note that the NOR symbol is an OR symbol with a small invert bubble (small
circle) on the right side

 The NOR function is being performed by an OR gate and an INVERTER in fig


(a) Y = A+B
 The Boolean expression for the final NOR function is .

 The truth table in fig below shows that the NOR gate output is the exact inverse
of the OR gate output for all possible input conditions.

 The OR gate output goes HIGH when any input is HIGH, while the NOR gate
output goes LOW when any input is HIGH.

17
A
Y = A+B
B
Denotes
inversion
INPUTS OUTPUTS
Fig (a)
A B OR NOR
A
0 0 0 1
B 1 0 1 0
Y = A+B 0 1 1 0
1 1 1 0
Truth table for
OR and NOR gates
Fig (c)
Fig (b)

18
Discrete NOR Gate
+5 V

A B Y
Y
0 0 1
A T1 T2 0 1 0
B
1 0 0
1 1 0

Discrete two-input NOR gate Truth Table


19
NAND Gate
 The NAND gate is a NOT AND, or an inverted AND function.
 The Standard logic symbol for the NAND gate is diagramed in
fig (a).
 The little invert bubble (small circle) on the right end of the
symbol means to invert the AND.
 Fig (b) shows a separate AND gate and inverter being used to
produce the NAND logic function.
 The truth table in fig. (c) shows that the NAND gate output is
the exact inverse of the AND gate for all possible input
conditions
 The AND output goes HIGH only when all inputs are HIGH,
while the NAND output goes LOW only when all input are
HIGH.

20
A
Y=A B A
B

B
Fig (a) Y = AB

Fig (b)

INPUTS OUTPUTS

A B AND NAND

0 0 0 1
1 0 0 1
0 1 0 1
1 1 1 0

Fig (c)

21
Discrete NAND Gate
+5 V
A B Y
0 0 1
R

0 1 1
A Y
1 0 1

B
1 1 0
T

Truth Table

Discrete two-input NAND gate


22
Universality of NAND Gates and NOR gates

 All Boolean expressions consist of various combinations of


the basic operations of OR, AND, and INVERTER.

 Therefore, any expression can be implemented using


combinations of OR gates, AND gates and INVERTERS.

 It is possible, however to implement any logic expression


using only NAND gates and no other type of gate.

 This is because NAND gates, in the proper combination, can


be used to perform each of the Boolean operations OR, AND,
and INVERTER.
23
 This is demonstrated in fig below.
Universality of NAND Gates

A Y = A.A = A
 INVERTER


A AB
Y = AB
B

AND

A
A


Y=A B

B
B OR
24
Universality of NOR Gates
 Similarly, it can be shown that NOR gates can be arranged to implement
any of the Boolean operations. See fig. below

A Y = A+A= A
 INVERTER


A AB
Y = A+B
B

OR

A
A


Y = A+B

B
B AND
25
XOR and XNOR Logic Circuits
 Two special logic circuits that occur quite often in digital systems are the
exclusive-OR and exclusive NOR circuits.

Exclusive OR
 Consider the logic circuit of fig (a) .
Y = AB + A B
 The output expression of this circuit is

 The accompanying truth table shows that x= 1 for two cases:

A= 0, B= 1 (theAB term) and

A= 1, B= 0 (theA B term).

 In other words, this circuit produces a HIGH output whenever the two inputs are at
opposite levels.

 This is the exclusive OR circuit, which will hereafter be abbreviated XOR.

 This particular combination of logic gates occurs quite often and is very useful in
26
certain applications.
A AB

AB
B Y = A B+ A B

Fig. (a)

A B Y

0 0 0
0 1 1
1 0 1
1 1 0

27
 In fact, the XOR circuit has been given a symbol of its own as shown in fig below

 This XOR circuit is commonly referred to as an XOR gate, and we consider it as another type
of logic gate.

 An XOR gate has only two inputs; there are no three-input or four- input XOR gates.

 A short hand way that is sometimes used to indicate the XOR output expression is Y= AB.

 Where, the symbol  represents the XOR gate operation.

 The characteristics of an XOR gate are summarized as follows:

1. It has only two inputs and its output is

2. Its output is HIGH only when the two inputs are at different levels

Y = A B + A B = A ⊕B A
B

Y = A ⊕B = AB + A B

28
Exclusive –NOR
 The exclusive-NOR circuit (Abbreviated XNOR) operates completely
opposite to the XOR circuit.
 The fig (a) drawn below, shows an X-NOR circuit and its accompanying
truth table.
 The output expression is Y = A B + A B
 Which indicates along with the truth table that Y will be 1 for two cases:
 A=B=1 (the AB term) and
 A=B=0 (theA  B term).
 In other words, this circuit produces a HIHG output whenever the two
inputs are at the same level.
 In should be apparent that the output of the XNOR circuit is the exact
inverse of the output of the XOR circuit.

29
AB
A

B Y = A B+A B

AB

Fig.(a)
A B Y
0 0 1
0 1 0
1 0 0
1 1 1

30
 The traditional symbol for an XNOR
gate is obtained by simply adding a A
small circle at the out put of the XOR B
symbol.
 A shorthand way to indicate the Y = A ⊕B = A B + AB
output expression of the XNOR is
Y = A ⊕B
 This is simply the inverse of the XOR
operation.
 The XNOR gate is summarized as
follows:
1. It has only two inputs and its output
is
Y = A B + A B = A ⊕B
2. Its output is HIGH only when the
two input are the same level. 31
DESCRIBING LOGIC CIRCUITS ALGEBRAICALLY
 Any logic circuit, no matter how complex, may be completely described
using the Boolean operations previously defined, because the OR gate,
AND gate, and NOT circuit are the basic building blocks of digital
systems.
 For example, consider the circuit in Figure (a)
 This circuit has three inputs, A, B, and C and a single output, Y.
 Utilizing the Boolean expression for each gate, we can easily determine
the expression for the output.
 Occasionally, there may be confusion as which operation to be
performed first. The expression Y=AB+C can be interpreted in two
different ways:
 A. B is ORed with C
 A is ANDed with the term B+C
 To avoid this confusion, it will be understood that if an expression
contains both AND and OR operations the AND operations are
performed first, unless there are parentheses in the expression, in which
case the operation inside the parentheses is to be performed first.
 Try to write the expression to Figure (b)

32
A.B Y=A.B+C
A
B

(a) Logic circuit which does


not require parenthesis

A+B Y=(A+B).C
A
B

(b) Logic circuit requires


parenthesis

33
EVALUATING LOGIC–CIRCUIT OUTPUTS
A
 Once the Boolean expression for a ABC
 
A
B 1 Y  ABC A  D
circuit output has been obtained, the C

output logic level can be determined A  D AD


2

for any set of input levels


D
 For example: suppose that we want to
know the logic level of the output Y (a)
for the circuit in Figure (a) for the
case where A=0, B=1, C=1, and D=1.
 As in ordinary algebra, the value of Y
can be found by ‘plugging’ the values 
Y  ABC A  D 
of the variables into the expression = 0.1.1.(0 + 1)
In general, the following rules must = 1.1.1.(1)
always be followed when evaluated a
=0
Boolean expression 0 = 1 or1 = 0

34
1. First ,perform all inversions of single terms; that is

2. Then perform all operations within parentheses.

3. Perform an AND operation before an OR operation unless


parentheses indicate otherwise

4. If an expression has a bar over it, perform the operations


of the expression first and then invert the result.

35
Determining output level from a Diagram

The output logic level for given input levels can also be
determined directly from the circuit diagram without using the
Boolean expression.
Technicians often use this technique during the
troubleshooting or testing of logic system since it also tells them
what each gate output is supposed to be as well as the final
1
output.
1
A=0
B=1 1
C=1 Y=0
0 2
1 0

1
D=1

36
THANK YOU!!!

ANY Question???
37

You might also like