0% found this document useful (0 votes)
13 views49 pages

EEEG 320 Chapter 1

Uploaded by

PUSPA JOSHI
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)
13 views49 pages

EEEG 320 Chapter 1

Uploaded by

PUSPA JOSHI
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/ 49

Lecture #1

EEEG 320
Digital Circuit and System Design

Unit 1: Review of Digital Logic and Electronics


Engineering

Course Instructor: Associate Prof. Dr. Ram Kaji Budhathoki

EEEG 320 Digital Circuit and System Design 1


Outline
Basic Logic Gates
Boolean Algebra
Simplification of Boolean Algebra
Combinational Logic
Sequential Logic

EEEG 320 Digital Circuit and System Design 2


Objectives
• To provide an understanding of modern techniques used in the design
and analysis of very large scale digital circuits.
• Understand the relationships between Boolean logic and digital
circuits.
• Learn how to design simple logic circuits.
• Understand how digital circuits work together to form complex
computer systems.

EEEG 320 Digital Circuit and System Design 3


NOT Gate  Inverter
NOT Truth Table
Y = ~X (Verilog)
X Y X Y Y = !X (ABEL)
0 1 Y = not X (VHDL)
1 0 Y = X’
Y=X
Y = ~X Y = 𝑋ത (textbook)
not(Y,X) (Verilog)
The NOT operation is
most often designated by X ഥ
𝑿 ന
𝑿
an overbar. It is sometimes X 𝑋ത ധ X
𝑋= 0 1 0
indicated by a prime mark
1 0 1
(‘) or an “elbow” ̅

EEEG 320 Digital Circuit and System Design 4


AND Gate
Truth Table
AND Gate
X Y Z  X&Y ( Verilog and ABEL)
 X and Y (VHDL)
X  X ˄Y
0 0 0
Z  X ∩Y
 X*Y
0 1 0
Y  XY (textbook)
 and(Z,X,Y) (Verilog)
1 0 0
Z = X AND Y
1 1 1

EEEG 320 Digital Circuit and System Design 5


OR Gate
Truth Table

A B Q  A|B ( Verilog)
OR Gate  A#B (ABEL)
 A or B (VHDL)
0 0 0
 A +B (Textbook)
 AvB
0 1 1
 AᴜB
 OR (Q,A,B) (Verilog)
1 0 1
Q = A OR B
1 1 1

EEEG 320 Digital Circuit and System Design 6


NAND Gate
Truth Table

A B Y
NAND Gate NOT-AND
0 0 1

0 1 1
W Z
1 0 1
Y = 𝐴. 𝐵 W= A & B
1 1 0 Z = ~W = ~(X & Y)
Y = not (A.B)

EEEG 320 Digital Circuit and System Design 7


NOR Gate
Truth Table NOT-OR
NOR Gate
A B Z X W
Z
X 0 0 1 Y
Z X Y W Z
Y 0 1 0
0 0 0 1
W=X|Y 0 1 1 0
1 0 0 Z = ~W = ~(X | Y)
Z = X nor Y 1 0 1 0
1 1 0 1 1 1 0
Z = ~ (X | Y)
Z= nor (Z,X,Y)

EEEG 320 Digital Circuit and System Design 8


Exclusive-OR Gate
Truth Table

X Y Z
XOR
0 0 0
X Boolean Expression
Z
Y 0 1 1 Z = 𝑋 ഥ𝑌 +𝑋ത 𝑌

1 0 1

1 1 0 Note the special symbol  for


Z= xor (Z,X,Y) the XOR operation.

The output of the XOR operation is true only when the values of the inputs differ.

EEEG 320 Digital Circuit and System Design 9


Exclusive-NOR Gate
Truth Table

XNOR X Y Z

X 0 0 1
Z Boolean Expression
Y
0 1 0 Z = X.Y + 𝑋ത 𝑌ത
Z= xnor (Z,X,Y)
1 0 0
Z= X ʘ Y
1 1 1

EEEG 320 Digital Circuit and System Design 10


Logic Gates
• NAND and NOR are known as
universal gates because they are
inexpensive to manufacture and
any Boolean function can be
constructed using only NAND or
only NOR gates.

EEEG 320 Digital Circuit and System Design 11


Multiple Input Gate
• Gates can have multiple inputs and
more than one output. Z1 Z2
• A second output can be provided AND Gate
OR Gate
for the complement of the
operation.
• We’ll see more of this later. Z3 Z4

NOR Gate
NAND Gate

EEEG 320 Digital Circuit and System Design 12


Boolean Algebra
• Boolean algebra is a mathematical system for the manipulation of variables that can have
one of two values.
• In formal logic, these values are “true” and “false.”
• In digital systems, these values are “on” and “off,” 1 and 0, or “high” and “low.”
• Boolean expressions are created by performing operations on Boolean variables.
• Common Boolean operators include AND, OR, and NOT.
• The AND operator is also known as a Boolean product. The OR operator is the Boolean sum.
• A Boolean function has:
• At least one Boolean variable,
• At least one Boolean operator, and
• At least one input from the set {0,1}.
• It produces an output that is also a member of the set {0,1}.
Now you know why the binary numbering
system is so handy in digital systems.
EEEG 320 Digital Circuit and System Design 13
Boolean Algebra
• The truth table for the Boolean function:

is shown at the right.


• To make evaluation of the Boolean function easier, the truth
table contains extra (shaded) columns to hold evaluations of
subparts of the function.
• As with common arithmetic, Boolean operations have rules of
precedence.
• The NOT operator has highest priority, followed by AND and
then OR.
• This is how we chose the (shaded) function subparts in our
table.

EEEG 320 Digital Circuit and System Design 14


Boolean Algebra
• Digital computers contain circuits that implement Boolean functions.
• The simpler that we can make a Boolean function, the smaller the circuit
that will result.
• Simpler circuits are cheaper to build, consume less power, and run faster than
complex circuits.
• With this in mind, we always want to reduce our Boolean functions to their
simplest form.
• There are a number of Boolean identities that help us to do this.

EEEG 320 Digital Circuit and System Design 15


Useful Laws and Theorems
Identity Name OR Form AND Form
Identity X+0=X X•1=X
Null X+1=1 X•0=0
Idempotent X+X=X X•X=X
Involution/Double complement law (X')' = X
Complementarity/ Inverse X + X' = 1 X • X' = 0
Commutative X+Y=Y+X X•Y=Y•X
Associative (X+Y)+Z=X+(Y+Z) (X•Y)•Z=X•(Y•Z)
Distributive X•(Y+Z)=(X•Y)+(X•Z) X+(Y•Z)=(X+Y)•(X+Z)
Uniting X•Y+X•Y'=X (X+Y)•(X+Y')=X
Absorption X+X•Y=X X•(X+Y)=X
Absorption (#2) (X+Y')•Y=X•Y (X•Y')+Y=X+Y
De Morgan's (X+Y+...)'=X'•Y'•... (X•Y•...)'=X'+Y'+...
Duality (X+Y+...)D=X•Y•... ( X•Y•...)D=X+Y+…
Multiplying & factoring (X+Y)•(X'+Z)=X•Z+X'•Y X•Y+X'•Z=(X+Z)•(X'+Y)
Consensus (X•Y)+(Y•Z)+(X'•Z)= X•Y+X'•Z (X+Y)•(Y+Z)•(X'+Z)=(X+Y)•(X'+Z)

EEEG 320 Digital Circuit and System Design 16


Proving Theorems
• Example 1: Prove the uniting theorem  X•Y+X•Y'=X
Distributive X•Y+X•Y' = X•(Y+Y')
Complementarity  = X•(1)
Identity  =X
• Example 2: Prove the absorption theorem X+X•Y=X
Identity  X+X•Y = (X•1)+(X•Y)
Distributive = X•(1+Y)
Null = X•(1)
Identity =X
• Example 3: Prove the consensus theorem (XY)+(YZ)+(X'Z)= XY+X'Z
Complementarity XY+YZ+X'Z = XY+(X+X')YZ + X'Z
Distributive = XYZ+XY+X'YZ+X'Z
Use absorption {AB+A=A} with A=XY and B=Z

= XY+X'YZ+X'Z
Rearrange terms = XY+X'ZY+X'Z
• Use absorption {AB+A=A} with A=X'Z and B=Y
 XY+YZ+X'Z = XY+X'Z
EEEG 320 Digital Circuit and System Design 17
Example

• We can use Boolean identities to simplify the function:

as follows:

EEEG 320 Digital Circuit and System Design 18


De Morgan’s Theorem
• Two most important theorems of Boolean Algebra were contributed by
De Morgan.
• Extremely useful in simplifying expression in which product or sum of
variables is inverted.
• The two theorems are:
• 𝑋 + 𝑌 =𝑋.ത 𝑌ത
• 𝑋. 𝑌 =𝑋ത + 𝑌ത

EEEG 320 Digital Circuit and System Design 19


De Morgan’s Theorem Conversion
• Step1: Change all OR’s to ANDs and all ANDs to OR's
• Step2: Complement each individual variable (short overbar)
• Step3: Complement the entire function (long overbars)
• Step4 :Eliminate all groups of double overbars

ത 𝑌ത
• Example: 𝑋.
=𝑋ത + 𝑌ത
=𝑋ധ + 𝑌ധ
=𝑋ധ + 𝑌ധ
=𝑋+𝑌

EEEG 320 Digital Circuit and System Design 20


Examples De Morgan’s
• Sometimes it is more economical to build a circuit using the complement of a function (and
complementing its result) than it is to implement the function directly.
• De Morgan’s law provides an easy way of finding the complement of a Boolean function.
• Recall De Morgan’s law states:

• De Morgan’s law can be extended to any number of variables.


• Replace each variable by its complement and change all ANDs to ORs and all ORs to ANDs.
• Thus, we find the complement of:

EEEG 320 Digital Circuit and System Design 21


De Morgan’s Theorem
• Use De Morgan’s Theorem to find complements
• Example: F=(A+B)•(A’+C), so F’=(A’•B’)+(A•C’)
A B C F A B C F’
0 0 0 0 0 0 0 1
0 0 1 0 0 0 1 1
0 1 0 1 0 1 0 0
0 1 1 1 0 1 1 0
1 0 0 0 1 0 0 1
1 0 1 1 1 0 1 0
1 1 0 0 1 1 0 1
1 1 1 1 1 1 1 0

EEEG 320 Digital Circuit and System Design 22


One more example of logic simplification
• Example:
Z = A'BC + AB'C' + AB'C + ABC' + ABC
= A'BC + AB'(C’ + C) + AB(C' + C) distributive
= A'BC + AB’ + AB complementary
= A'BC + A(B' + B) distributive
= A'BC + A complementary
= BC + A absorption #2
Duality(X •Y')+Y=X+Y with X=BC and Y=A

EEEG 320 Digital Circuit and System Design 23


Boolean Algebra
• Through our exercises in simplifying Boolean expressions, we see that there are numerous
ways of stating the same Boolean expression.
• These “synonymous” forms are logically equivalent.
• Logically equivalent expressions have identical truth tables.
• In order to eliminate as much confusion as possible, designers express, Boolean functions
in standardized or canonical form.
• There are two canonical forms for Boolean expressions: sum-of-products and product-of-
sums.
• Recall the Boolean product is the AND operation and the Boolean sum is the OR operation.
• In the sum-of-products form, ANDed variables are ORed together.
• For example:

• In the product-of-sums form, ORed variables are ANDed together:


• For example:

EEEG 320 Digital Circuit and System Design 24


Boolean Algebra
• It is easy to convert a function to sum-of-products form using its truth table.
• We are interested in the values of the variables that make the function true (=1).
• Using the truth table, we list the values of the variables that result in a true
function value.
• Each group of variables is then ORed together.
• It is easy to convert a function to sum-of-products form using its truth table.
• We are interested in the values of the variables that make the function true (=1).
• Using the truth table, we list the values of the variables that result in a true
function value.
• Each group of variables is then ORed together.
• The sum-of-products form for our function is: We note that this function is not
in simplest terms. Our aim is
only to rewrite our function in
canonical sum-of-products form.

EEEG 320 Digital Circuit and System Design 25


SOP Standard Form
• In SOP standard form, every variable in the domain must appear in each
term. This form is useful for constructing truth tables or for implementing
logic in PLDs.
• You can expand a nonstandard term to standard form by multiplying the
term by a term consisting of the sum of the missing variable and its
complement.
• Example: Convert X = 𝐴ҧ𝐵ത + ABC to standard form.
ҧ
• The first term does not include the variable C. therefore, multiply it by the (C + 𝐶),
which is 1.
X = 𝐴ҧ𝐵(𝐶ത + 𝐶)ҧ + ABC
= 𝐴ҧ𝐵𝐶
ത + 𝐴ҧ𝐵ത 𝐶ҧ +ABC

EEEG 320 Digital Circuit and System Design 26


POS Standard Form

• In POS standard form, every variable in the domain must appear in


each sum term of the expression.
• You can expand a non-standard POS expression to standard form by
adding the product of the missing variable and its complement, which
states that (A + B)(A + C) = A + BC.
• EXAMPLE: Convert X = (𝐴ҧ + 𝐵) ത (A + B + C) to standard POS form.
• The first sum term does not include the variable C. therefore, add C𝐶ҧ
and expand the result.
X = (𝐴ҧ + 𝐵+
ത C𝐶)ҧ (A + B + C)
= (𝐴ҧ + 𝐵ത + 𝐶) (𝐴ҧ + 𝐵ത + 𝐶)ҧ (A + B + C)

EEEG 320 Digital Circuit and System Design 27


Combinational Circuits
• We have designed a circuit that implements the Boolean function:

• This circuit is an example of a combinational logic circuit.


• Combinational logic circuits produce a specified output (almost) at
the instant when input values are applied.
• In a later section, we will explore circuits where this is not the case.
• Combinational logic circuits give us many useful devices.
• One of the simplest is the half adder, which finds the sum of
two bits.
• We can gain some insight as to the construction of a half adder
by looking at its truth table, shown at the right.

EEEG 320 Digital Circuit and System Design 28


Combinational Circuits
• As we see, the sum can be found using the XOR operation and the
carry using the AND operation.

EEEG 320 Digital Circuit and System Design 29


Combinational Circuits
• We can change our half adder into to a full adder by including
gates for processing the carry bit.
• The truth table for a full adder is shown at the right.
• How can we change the half adder shown below to make it a full
adder?
• Here’s our completed full adder.

EEEG 320 Digital Circuit and System Design 30


Combinational Circuits
• Just as we combined half adders to make a full adder, full adders can
connected in series.
• The carry bit “ripples” from one adder to the next; hence, this
configuration is called a ripple-carry adder.

Today’s systems employ more efficient adders.

EEEG 320 Digital Circuit and System Design 31


Combinational Circuits
• Decoders are another important type of
combinational circuit.
• Among other things, they are useful in
This is a block diagram for a decoder.
selecting a memory location according a
binary value placed on the address lines of a
memory bus.
• Address decoders with n inputs can select
any of 2n locations.
• This is what a 2-to-4 decoder looks like on
the inside as shown in right side.
If x = 0 and y = 1, which output line is enabled?

EEEG 320 Digital Circuit and System Design 32


Combinational Circuits
• This is what a 4-to-1 multiplexer looks This shifter moves the bits of a nibble one
like on the inside.. position to the left or right on the basis of S

If S0 = 1 and S1 = 0,
If S = 0, in which
which input is
direction do the
transferred to the
input bits shift?
output?
EEEG 320 Digital Circuit and System Design 33
Simplification
Boolean
Truth
• Simplification from Boolean function Function
Table
- Finding an equivalent expression that is least
expensive to implement Unique Many different expressions exist
- For a simple function, it is possible to obtain
a simple expression for low cost implementation
- But, with complex functions, it is a very difficult
task
Truth
• Karnaugh Map (K-map) is a simple procedure for Table
simplifying Boolean expressions. Simplified
Karnaugh Boolean
Map Function
Boolean
function

EEEG 320 Digital Circuit and System Design 34


KARNAUGH MAP
• Karnaugh Map for an n-input digital
logic circuit (n-variable sum-of-
products form of Boolean Function, or Karnaugh Map
Truth Table) is x
• Rectangle divided into 2n cells x Identification value

• Each cell is associated with a Minterm


x F
0 0 of the cell 0 0 of F
0 1
1 1 1
• An output(function) value for each input value 1 0 1
associated with a minterm is written in the cell F(x) =  (1)
representing the minterm
x0 1 1-cell
• → 1-cell, 0-cell x y F x
y
• Each Minterm is identified by a 0 0 0 0 0 1 y 0 1
0 1 1 0 0 1
decimal number whose binary 1 2 3
1
1
0
1
1
1
1 1 0
representation is identical to the binary F(x,y) =  (1,2)
interpretation of the input values of the
minterm.
EEEG 320 Digital Circuit and System Design 35
Karnaugh Map
x y z F
0 0 0 0 yz yz
0 0 1 1 x 00 01 11 10 x 00 01 11 10
0 1 0 1 0 0 1 3 2 0 0 1 0 1
0 1 1 0
1 4 5 7 6 1 1 0 0 0
1 0 0 1
1 0 1 0 F(x, y, z) =  (1,2,4)
1 1 0 0
1 1 1 0
u v w x F
wx wx
uv 00 01 11 10
0 0 0 0 0
0 0 0 1 1 00 01 11 10
uv 00 0 1 1 0
0
0
0
0
1
1
0
1
0
1 00 0 1 3 2
0 1 0 0 0 01 4 5 7 6 01 0 0 0 1
0 1 0 1 0
0 1 1 0 1 11 12 13 15 14 11 0 0 0 1
0
1
1
0
1
0
1
0
0
1
10 8 9 11 10 10 1 1 1 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 1 F(u, v, w, x) =  (1,3,6,8,9,11,14)
1 1 0 0 0
1 1 0 1 0
1 1 1 0 1
1 1 1 1 0

EEEG 320 Digital Circuit and System Design 36


Sequential Circuit
• Combinational logic circuits are perfect for situations when we require the immediate
application of a Boolean function to a set of inputs.
• There are other times, however, when we need a circuit to change its value with
consideration to its current state as well as its inputs.
• These circuits have to “remember” their current state.
• Sequential logic circuits provide this functionality for us.
• As the name implies, sequential logic circuits require a means by which events can be
sequenced.
• State changes are controlled by clocks.
• A “clock” is a special circuit that sends electrical pulses through a circuit.
• Clocks produce electrical waveforms such as the one shown below.

EEEG 320 Digital Circuit and System Design 37


Sequential Circuit
• State changes occur in sequential circuits only when the clock ticks.
• Circuits can change state on the rising edge, falling edge, or when the clock pulse
reaches its highest voltage.
• Circuits that change state on the rising edge, or falling edge of the clock pulse are
called edge-triggered.
• Level-triggered circuits change state when the clock voltage reaches its highest or
lowest level.

EEEG 320 Digital Circuit and System Design 38


Sequential Circuits
• To retain their state values, sequential circuits rely on feedback.
• Feedback in digital circuits occurs when an output is looped back to
the input.
• A simple example of this concept is shown below.
• If Q is 0 it will always be 0, if it is 1, it will always be 1. Why?

EEEG 320 Digital Circuit and System Design 39


Sequential Circuits
• You can see how feedback works by examining the most basic
sequential logic components, the SR flip-flop.
• The “SR” stands for set/reset.
• The internals of an SR flip-flop are shown right side, along with its
block diagram.
• The behavior of an SR flip-flop is described by a characteristic table.
• Q(t) means the value of the output at time t. Q(t+1) is the value of Q
after the next clock pulse.
• The SR flip-flop actually has three inputs: S, R, and its current
output, Q.
• Thus, we can construct a truth table for this circuit, as shown at the
right.
• Notice the two undefined values. When both S and R are 1, the SR
flip-flop is unstable.

EEEG 320 Digital Circuit and System Design 40


Sequential Circuits
• If we can be sure that the inputs to an SR flip-flop
will never both be 1, we will never have an
unstable circuit. This may not always be the case.
• The SR flip-flop can be modified to provide a
stable state when both inputs are 1.
• This modified flip-flop is called a JK flip-flop,
shown at the right.
• The “JK” is in honor of Jack Kilby.
• At the right, we see how an SR flip-flop can be
modified to create a JK flip-flop.
• The characteristic table indicates that the flip-flop
is stable for all inputs.

EEEG 320 Digital Circuit and System Design 41


Sequential Circuits
• Another modification of the SR flip-flop is the D flip-flop,
shown right side with its characteristic table.
• You will notice that the output of the flip-flop remains the
same during subsequent clock pulses. The output changes
only when the value of D changes.
• The D flip-flop is the fundamental circuit of computer
memory.
• D flip-flops are usually illustrated using the block diagram shown
below.
• The characteristic table for the D flip-flop is shown at the
right.

EEEG 320 Digital Circuit and System Design 42


Sequential Circuits
• The behavior of sequential circuits can be expressed
using characteristic tables or finite state machines
(FSMs).
• FSMs consist of a set of nodes that hold the states of the
machine and a set of arcs that connect the states.
• Moore and Mealy machines are two types of FSMs that
are equivalent. Moore Machine
• They differ only in how they express the outputs of the machine.
• Moore machines place outputs on each node, while
Mealy machines present their outputs on the transitions.
• The behavior of a JK flop-flop is depicted below by a
Moore machine (right up) and a Mealy machine (right
down).
Mealy Machine

EEEG 320 Digital Circuit and System Design 43


Sequential Circuits
• Although the behavior of Moore and Mealy
machines is identical, their
implementations differ. This is our
Mealy
machine.
This is our
Moore
machine.

EEEG 320 Digital Circuit and System Design 44


Sequential Circuits
• It is difficult to express the complexities of actual implementations using only Moore and
Mealy machines.
• For one thing, they do not address the intricacies of timing very well.
• Secondly, it is often the case that an interaction of numerous signals is required to advance a machine from
one state to the next.
• For these reasons, Christopher Clare invented the algorithmic state machine (ASM).
• Sequential circuits are used anytime that we have a “stateful” application.
• A stateful application is one where the next state of the machine depends on the current state of the
machine and the input.
• A stateful application requires both combinational and sequential logic.
• The following slides provide several examples of circuits that fall into this category.

EEEG 320 Digital Circuit and System Design 45


Sequential Circuits
• This illustration shows a 4-bit register consisting of D flip-flops. You will usually see its
block diagram (below) instead.

A larger memory configuration


is shown on the right side of
slide.

EEEG 320 Digital Circuit and System Design 46


Sequential Circuits
• A binary counter is another example of a
sequential circuit.
• The low-order bit is complemented at each
clock pulse.
• Whenever it changes from 0 to 1, the next
bit is complemented, and so on through the
other flip-flops.

EEEG 320 Digital Circuit and System Design 47


Designing Circuits
• We have seen digital circuits from two points of view: digital analysis and digital synthesis.
• Digital analysis explores the relationship between a circuits inputs and its outputs.
• Digital synthesis creates logic diagrams using the values specified in a truth table.
• Digital systems designers must also be mindful of the physical behaviors of circuits to
include minute propagation delays that occur between the time when a circuit’s inputs are
energized and when the output is accurate and stable.
• Digital designers rely on specialized software to create efficient circuits.
• Thus, software is an enabler for the construction of better hardware.
• Of course, software is in reality a collection of algorithms that could just as well be
implemented in hardware.

EEEG 320 Digital Circuit and System Design 48


THANK YOU

EEEG 320 Digital Circuit and System Design 49

You might also like