0% found this document useful (0 votes)
2 views

chap2

The document covers Chapter 2 of ELEC 335, focusing on Combinational Logic in Digital Logic Design. It discusses Boolean constants and variables, various logic operations (AND, OR, NAND, NOR, XOR, XNOR), truth tables, and the application of Boolean algebra for circuit simplification. The chapter also highlights the importance of Boolean laws and theorems in designing efficient digital circuits.

Uploaded by

Ali Abdulhadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

chap2

The document covers Chapter 2 of ELEC 335, focusing on Combinational Logic in Digital Logic Design. It discusses Boolean constants and variables, various logic operations (AND, OR, NAND, NOR, XOR, XNOR), truth tables, and the application of Boolean algebra for circuit simplification. The chapter also highlights the importance of Boolean laws and theorems in designing efficient digital circuits.

Uploaded by

Ali Abdulhadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

ELEC 335

Digital Logic Design


by

Dr. Abdul-Halim Jallad

ELEC 335, Digital Logic Design, UAE University


Chapter 2

Combinational Logic

ELEC 335, Digital Logic Design, UAE University


Outline
• Boolean constants and variables
• AND Operations
• OR Operations
• Boolean Algebra
• Boolean Laws & Theorems
• Implementing Boolean Circuits
• NAND / NOR Operations

ELEC 335, Digital Logic Design, UAE University


CLOs Covered
1. Manipulate number system, binary codes, and computer
arithmetic. [PLO-1]
2. Apply Boolean algebra and Karnaugh map minimization
techniques to simplify Boolean expressions. [PLO-1]
3. Design binary adders, decoders, encoders, multiplexers, and de-
multiplexers to implement combinational logic circuits. [PLO-1,
2]
4. Design with flip-flops, synchronous and asynchronous sequential
circuits, state diagrams, and state tables. [PLO-1, 2]
5. Design registers (serial, parallel, and shift) ripple counters, and
synchronous counters. [PLO-1, 2]
6. Design digital circuits with memory devices of ROMs, PLAs, &
PALs. [PLO-2, 4]

ELEC 335, Digital Logic Design, UAE University


Introduction
• Digital circuits operate in the binary mode where each
input and output voltage is either in the 0-level or 1-
level
• The 0-level and 1-level designations represent
predefined voltage ranges
• This characteristic of logic circuits allows us to use
Boolean algebra as a tool for the analysis and design
of digital circuits
• Boolean algebra allows us to describe the relationship
between logic circuit’s output (s) and its inputs as an
algebraic equation (a Boolean expression)

ELEC 335, Digital Logic Design, UAE University


Boolean constants and variables
• Boolean constants and variables are allowed to have only
two possible values, 0 or 1

• Boolean variables are often used to represent the voltage


level present on a wire or at the input/output terminals of a
circuit

• For example, in a certain digital system the Boolean values


of 0 might be assigned to any voltage in the range 0 to 0.8
volts while the Boolean value of 1 might be assigned to any
voltage in the rage 2 to 5 volts

ELEC 335, Digital Logic Design, UAE University


Boolean constants and variables
• Boolean 0 and 1 do not present actual numbers but instead
represent the state of a voltage variable, or what is called its logic
level

• A voltage in a digital circuit is said to be at the logic 0 level or the


logic 1 level, depending on its actual numerical value

• In digital logic, several other terms are used synonymously with 0


and 1

ELEC 335, Digital Logic Design, UAE University


Boolean constants and variables

Logic 0 Logic 1
False True
Off On
Low High
No Yes
Open switch Closed switch

ELEC 335, Digital Logic Design, UAE University


Truth tables
• A truth table is a means inputs output
for describing how a logic
circuit’s output depends
on its inputs

A B X
A 0 0 1
? X
B 0 1 0
1 0 1
1 1 0
ELEC 335, Digital Logic Design, UAE University
The Inverter
A X
The Inverter

The inverter performs the Boolean NOT operation. When the


input is LOW, the output is HIGH; when the input is HIGH,
the output is LOW.

Input Output
A X
LOW (0) HIGH (1)
HIGH (1) LOW(0)

The NOT operation (complement) is shown with an overbar.


Thus, the Boolean expression for an inverter is X = A.

ELEC 335, Digital Logic Design, UAE University


The Inverter
A X

Example waveforms:
A
X
A group of inverters can be used to form the 1’s complement
of a binary number: Binary number
1 0 0 0 1 1 0 1

0 1 1 1 0 0 1 0
1’s complement
And operation with AND gates
• The truth table and circuit symbol for a 2-input AND
logic circuit is show below:

A B X=A·B
0 0 0
X=A·B
0 1 0 A
B
1 0 0
1 1 1

ELEC 335, Digital Logic Design, UAE University


A A
X X
The AND Gate B
&
B
Example waveforms:
A
B

X
The AND operation is used in computer programming as a
selective mask. If you want to retain certain bits of a binary
number but reset the other bits to 0, you could set a mask with
1’s in the position of the retained bits.
If the binary number 10100011 is ANDed with
the mask 00001111, what is the result? 00000011
ELEC 335, Digital Logic Design, UAE University
Or operation with OR gates

• The truth table and circuit symbol for a 2-input OR


logic circuit is show below:

A B X=A+B
0 0 0 A X=A+B
0 1 1 B
1 0 1
1 1 1

ELEC 335, Digital Logic Design, UAE University


The OR Gate

A X A ≥1 X
B B
Example waveforms:
A
B

X
The OR operation can be used in computer programming to set certain
bits of a binary number to 1.
ASCII letters have a 1 in the bit 5 position for lower case letters
and a 0 in this position for capitals. (Bit positions are numbered
from right to left starting with 0.) What will be the result if you
OR an ASCII letter with the 8-bit mask 00100000?
The resulting letter will be lower case.
ELEC 335, Digital Logic Design, UAE University
The NAND Gate

A X A & X
B B
The NAND gate produces a LOW output when all inputs
are HIGH; otherwise, the output is HIGH. For a 2-input
gate, the truth table is Inputs Output
A B X
0 0 1
0 1 1
1 0 1
1 1 0

The NAND operation is shown with a dot between the


variables and an overbar covering them. Thus, the NAND
operation is written as X = A .B (Alternatively, X = AB.)

ELEC 335, Digital Logic Design, UAE University


The NAND Gate

A X A & X
B B
Example waveforms:
A
B
X
The NAND gate is particularly useful because it is a
“universal” gate – all other basic gates can be constructed
from NAND gates.
How would you connect a 2-input NAND gate
to form a basic inverter?

ELEC 335, Digital Logic Design, UAE University


The NOR Gate

A X A ≥1 X
B B
The NOR gate produces a LOW output if any input is
HIGH; if all inputs are HIGH, the output is LOW. For a
2-input gate, the truth table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 0
The NOR operation is shown with a plus sign (+) between
the variables and an overbar covering them. Thus, the NOR
operation is written as X = A + B.
ELEC 335, Digital Logic Design, UAE University
The NOR Gate

A X A ≥1 X
B B
Example waveforms:
A
B
X
The NOR operation will produce a LOW if any input is HIGH.
+5.0 V
When is the LED is ON for the circuit shown? 330 Ω

A
The LED will be on when any of B X
C
the four inputs are HIGH. D

ELEC 335, Digital Logic Design, UAE University


The XOR Gate

A X A =1 X
B B
The XOR gate produces a HIGH output only when both
inputs are at opposite logic levels. The truth table is
Inputs Output
A B X
0 0 0
0 1 1
1 0 1
1 1 0

The XOR operation is written as X = AB + AB.


Alternatively, it can be written with a circled plus sign
between the variables as X = A + B.

ELEC 335, Digital Logic Design, UAE University


The XNOR Gate

A X A =1 X
B B
The XNOR gate produces a HIGH output only when both
inputs are at the same logic level. The truth table is
Inputs Output
A B X
0 0 1
0 1 0
1 0 0
1 1 1
The XNOR operation shown as X = AB + AB. Alternatively,
the XNOR operation can be shown with a circled dot
between the variables. Thus, it can be shown as X = A . B.

ELEC 335, Digital Logic Design, UAE University


The XNOR Gate

A X A =1 X
B B
Example waveforms:
A
B

X
Notice that the XNOR gate will produce a HIGH when both inputs are the
same. This makes it useful for comparison functions.
If the A waveform is inverted but B remains the same, how is
the output affected?

The output will be inverted.

ELEC 335, Digital Logic Design, UAE University


Why study Boolean Algebra?

• It is highly desirable to find the simplest circuit implementation


(logic) with the smallest number of gates or wires

• We can use Boolean minimization process to reduce a Boolean


function (expression) to its simplest form: The result is an
expression with the fewest literals and thus less wires in the
final gate implementation

ELEC 335, Digital Logic Design, UAE University


Boolean Algebra
• George Boole (1815-1864), a mathematician introduced a
systematic treatment of logic
• He developed a consistent set of postulates that were sufficient to
define a new type of algebra: Boolean Algebra (similar to Linear
Algebra)
• Many of the rules are the same as the ones in Linear Algebra

ELEC 335, Digital Logic Design, UAE University


Laws of Boolean Algebra
• Boolean theorems (rules) and Laws help us to simplify logic
expressions and logic circuits

• In each theorem, x is a logic variable that can be either 1 or 0

• There are 6 fundamental laws, or axioms, used to formulate various


algebraic structures:
Closure Commutative laws Associative laws
Distributive laws Identity laws Complement

ELEC 335, Digital Logic Design, UAE University


Laws of Boolean Algebra
• Closure x+y
x⋅y

• Commutative laws x+y=y+x


x⋅y=y⋅x

• Associative laws
x + (y + z) = (x + y) + z = x + y + z
x(yz) = (xy)z = xyz
ELEC 335, Digital Logic Design, UAE University
Laws of Boolean Algebra
• Distributive laws
x(y + z) = xy + xz
x + (yz) = (x + y)(x + z)
(w+x)(y+z) = wy +xy +wz + xz
• Identity laws
x
x⋅0=0 0 0

x
x⋅1=x 1 x

ELEC 335, Digital Logic Design, UAE University


Laws of Boolean Algebra
• Identity laws
x x
x+0=x 0
x
x+1=1 1 1

• Complement
x
x ⋅ x’ = 0 0
x
x + x’ = 1 1

(x’)’ = x x x

ELEC 335, Digital Logic Design, UAE University


Other Boolean Theorems
x
• x.x=x x
x x
• x+x=x

• x+ xy = x
• x + x’ y = x + y
• x+ x’ y’ = x + y’
• (x . y)’ = x’ + y’ DeMorgan’s theorem
• (x + y)’ = x’ . y’ DeMorgan’s theorem
ELEC 335, Digital Logic Design, UAE University
Summary of Rules of Boolean Algebra

1. A + 0 = A 7. A . A = A
2. A + 1 = 1 8. A . A = 0
=
3. A . 0 = 0 9. A = A
4. A . 1 = A 10. A + AB = A
5. A + A = A 11. A + AB = A + B
6. A + A = 1 12. (A + B)(A + C) = A + BC

ELEC 335, Digital Logic Design, UAE University


DeMorgan’s Theorem

DeMorgan’s 1st Theorem


The complement of a product of variables is
equal to the sum of the complemented variables.
AB = A + B
Applying DeMorgan’s first theorem to gates:
A A
AB A+B Inputs Output
B B
A B AB A + B
NAND Negative-OR 0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0

ELEC 335, Digital Logic Design, UAE University


DeMorgan’s Theorem

DeMorgan’s 2nd Theorem


The complement of a sum of variables is equal to
the product of the complemented variables.
A+B=A.B
Applying DeMorgan’s second theorem to gates:
A A Inputs Output
A+B AB
B B
A B A + B AB
NOR Negative-AND 0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0

ELEC 335, Digital Logic Design, UAE University


DeMorgan’s Theorem

Apply DeMorgan’s theorem to remove the


overbar covering both terms from the
expression X = C + D.

To apply DeMorgan’s theorem to the expression,


you can break the overbar covering both terms and
change the sign between the terms. This results in
=
X = C . D. Deleting the double bar gives X = C . D.

ELEC 335, Digital Logic Design, UAE University


Examples of Theorems Proves
x + x = x
x + x = x(1 + 1) x . x = x
= x(1) x . x = x . x + x . x’
= x =x(x + x’)
= x(1) = x

x + xy = x
x + 1 = 1 x + xy = x(1 + y)
x + 1 = x + (x + x’) = x(1) = x
= x + x + x’
= x(1 + 1) + x’
= x + x’= 1

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra
Example: simplify the expression: z = (A’+ C)⋅(B + D’) to
one having only single variables inverted
Sol:
z = ( A’+ C ) + ( B + D’ )
z = A ⋅ C’ + B’ ⋅ D
z = AC’ + B’D
Example: x = (A+B+C).D
x = (A + B + C) + D’
x = A’ B’ C’ + D’

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra
• Simplify AB + A.(B+C) + B.(B+C)
= AB + AB + AC + BB + BC
= AB + AC + B + BC
= A(B+C) + B + BC = A(B+C) + B(1+C)
= A(B+C) + B = AB + AC + B = AB + B + AC
= B + AC

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra
• Simplify AB + A(B+C) + B (B+C)
= A(B + B+C) + B (B+C)
= A(B’ + B’. C’) + B(B’. C’)
= AB’ + 0
= AB’
• Simplify [AB’(C+BD)+A’B’]C
= [AB’C+AB’BD +A’B’]C
= (AB’C + A’B’)C
= AB’C + A’B’C
= B’C (A + A’) = B’C
ELEC 335, Digital Logic Design, UAE University
Examples of Boolean Algebra
• Ex: simplify z = AC(ABD) + ABCD + ABC
= AC (A + B + D) + ABCD + ABC
= ACA + ACB + ACD + ABCD + ABC
= ABC + ACD + ABCD + ABC
= BC(A + A) + AD(C + BC)
= BC + AD(B + C)

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra

• Simplify x = (A + B) (A + B + D)D
= AAD + ABD + ADD + ABD + BBD + BDD
= ABD + ABD + BD
= BD(A + A + 1)
= BD

ELEC 335, Digital Logic Design, UAE University


Boolean Analysis of Logic Circuits

Combinational logic circuits can be analyzed by writing


the expression for each gate and combining the
expressions according to the rules for Boolean algebra.
Apply Boolean algebra to derive the expression for X.

Write the expression for each gate:


A (A + B )
C (A + B )
B
C X = C (A + B )+ D
D

Applying DeMorgan’s theorem and the distribution law:


X = C (A B) + D = A B C + D
ELEC 335, Digital Logic Design, UAE University
Examples of Boolean Algebra with Logic Circuits

F = (a.b)+(b.c)

a
b
F

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra with Logic Circuits

Example 1: F1 = x + y ' z

x F1

y
z

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra with Logic Circuits

Example 2: F1 = x' y ' z + x' yz + xy '

z F1

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra with Logic Circuits
Another implementation of expression using a simplified F2:

F2 = x' y ' z + x' yz + xy '


= x' z ( y '+ y ) + xy '
= x' z (1) + xy '
= x' z + xy '
x
y
F2

ELEC 335, Digital Logic Design, UAE University


Examples of Boolean Algebra with Logic Circuits

F3 = xy + x' z + yz
= xy + x' z + yz ( x + x' )
= xy + x' z + xyz + x' yz
= xy (1 + z ) + x' z (1 + y )
= xy + x' z

x
y
F3

ELEC 335, Digital Logic Design, UAE University


Standard forms of Boolean expressions

• Sum of product (SOP) form is an OR of product


terms
• Ex: AB + ABC
• Ex: ABC + CDE + BCD
• Ex: convert to SOP
1. A(B+CD) = AB + ACD
2. (A+B)(B+C+D) = AB + AC +AD + B +BC + BD
3. (A+B) + C = (A+B)C = (A+B) C = AC +BC

ELEC 335, Digital Logic Design, UAE University


Standard forms of Boolean expressions

• Standard SOP: each literal appears in every


product term (sum of minterms)
• Ex: convert to Standard SOP
AB’C + A’B’ + ABC’D
= AB’C(D + D’) + A’B’(C + C’) +ABC’D
= AB’CD + AB’CD’ + A’B’C + A’B’C’ + ABC’D
= AB’CD + AB’CD’ + A’B’CD + A’B’C’D’ + A’B’C’D
+ A’B’C’D’ + ABC’D

ELEC 335, Digital Logic Design, UAE University


Standard SOP
• SOP can be obtained from truth table
• Ex:
xyz F
000 1
001 0
010 1
011 0
100 0 F = x y z+ x y z + x y z
101 1
110 0
111 0

ELEC 335, Digital Logic Design, UAE University


Implications of DeMorgan’s theorem

x x
y x+y x ⋅ y = x+y
y

x x ⋅ y = x+y
y

ELEC 335, Digital Logic Design, UAE University


Implications of DeMorgan’s theorem

x x
x⋅y y x + y = x⋅y
y

x
y x + y = x⋅y

ELEC 335, Digital Logic Design, UAE University


Universality of NAND and NOR gates
• All Boolean expressions consist of various combinations
of the basic operations of OR, AND, and INVERT
• Any expression can be implemented using combinations
of OR gates, AND gates, and INVERTERs
• It is possible to implement any logic expression using
only NAND gates and no other type of gate
• It is possible to implement any logic expression using
only NOR gates and no other type of gate

ELEC 335, Digital Logic Design, UAE University


Universality of NAND Gates
INVERTER
A A
x = A⋅A = A

A⋅B AND
A A
1 2 x = A ⋅B
B B

A A OR
x = A⋅B = A + B
A
B
B
B

ELEC 335, Digital Logic Design, UAE University


Universality of NOR Gates
INVERTER
A x=A+A=A A

OR
A+B A+B
A A
B B

A A AND
A
B
B
B
ELEC 335, Digital Logic Design, UAE University
Conversion to all NAND gates
• Ex: convert to all NAND
A A
B B
C C
D D
E E

A
B
C
D
E
ELEC 335, Digital Logic Design, UAE University
Conversion to all NOR gates
• Ex: convert to all NOR
A A
B B
C C
D D

A
B

C
D

ELEC 335, Digital Logic Design, UAE University


Active HIGH and active LOW
• A logic signal is usually either active HIGH or active
LOW
• When a logic signal is in its active state, it can be said
to be asserted
• When a logic signal is not in its active state, it can be
said to be unasserted
• The terms “asserted” and “unasserted” are synonymous
with “active” and “inactive” respectively
asserted = active
unasserted = inactive

ELEC 335, Digital Logic Design, UAE University


Labeling Conventions
• It is common practice to use an overbar to label active-LOW
signals
• The overbar serves as another indication that the signal is
active-LOW
• The absence of an overbar means that the signal is active-
HIGH
• Sometimes an active-LOW signal is indicated by a bubble and
no overbar. In this case, the absence of a bubble means that the
signal is active-HIGH
• Very often, an output signal will have two active states; it will
have one important function in the HIGH state and another in
the LOW state. It is customary to label such signals so that both
active states are apparent. For example, a signal is labeled
RD / WRITE
ELEC 335, Digital Logic Design, UAE University
IEEE/ANSI Standard Logic Symbols
• The logic symbols we have been using so far are the
traditional standard symbols used in the digital industry
for many years
• A newer standard for logic symbols was developed in
1984; it is called the IEEE/ANSI Standard 91-1984 for
logic symbols
• The IEEE/ANSI standard uses rectangular symbols to
represent all logic gates and circuits. A special
dependency notation inside the rectangular symbol
indicates how the device outputs depend on the device
inputs
ELEC 335, Digital Logic Design, UAE University
IEEE/ANSI Standard Logic Symbols

A x NOT A 1 x

A A
x AND B & x
B

A x OR A
B B ≥1 x

A A
x NAND & x
B B

A A
x NOR ≥1 x
B B
ELEC 335, Digital Logic Design, UAE University
Selected Key Terms

Inverter A logic circuit that inverts or complements its


inputs.
Truth table A table showing the inputs and corresponding
output(s) of a logic circuit.
Timing A diagram of waveforms showing the proper time
diagram relationship of all of the waveforms.

Boolean The mathematics of logic circuits.


algebra
AND gate A logic gate that produces a HIGH output only
when all of its inputs are HIGH.
1. The truth table for a 2-input AND gate is
Inputs Output Inputs Output
A B X A B X

a. 0 0 0 b. 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 0

Inputs Output Inputs Output


A B X A B X
0 0 0 0 0 0
c. 0 1 0 d. 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
© 2008 Pearson Education
2. The truth table for a 2-input NOR gate is
Inputs Output Inputs Output
A B X A B X

a. 0 0 0 b. 0 0 1
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 0

Inputs Output Inputs Output


A B X A B X
0 0 0 0 0 0
c. 0 1 0 d. 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
© 2008 Pearson Education
A X
5. The symbol B is for a(n)

a. OR gate
b. AND gate
c. NOR gate
d. XOR gate

© 2008 Pearson Education


6. A logic gate that produces a HIGH output only when
all of its inputs are HIGH is a(n)
a. OR gate
b. AND gate
c. NOR gate
d. NAND gate

© 2008 Pearson Education


7. The expression X = A + B means
a. A OR B
b. A AND B
c. A XOR B
d. A XNOR B

© 2008 Pearson Education


8. A 2-input gate produces the output shown. (X represents
the output.) This is a(n)
a. OR gate
b. AND gate
c. NOR gate
d. NAND gate
A
B

X
© 2008 Pearson Education
9. A 2-input gate produces a HIGH output only when the
inputs agree. This type of gate is a(n)
a. OR gate
b. AND gate
c. NOR gate
d. XNOR gate

© 2008 Pearson Education

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