0% found this document useful (0 votes)
23 views40 pages

Chapter 04 and 5 Boolean Algebra and Digital Logic

Uploaded by

wanie
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)
23 views40 pages

Chapter 04 and 5 Boolean Algebra and Digital Logic

Uploaded by

wanie
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/ 40

Chapter 4 & 5

Boolean Algebra and Digital Logic


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.”
• Common Boolean operators include AND, OR, and NOT.
• The complement represents the inverse of a variable
and is indicated with an overbar. Thus, the complement
of A is .

2
Boolean Algebra
• A Boolean operator can be
completely described using
a truth table.
• The AND operator -
Boolean product.
• The OR operator - Boolean
sum.
• The NOT operation is most
often designated by an
overbar
3
Boolean Algebra
• The truth table for the
Boolean function:

is shown at the right.


• The NOT operator has
highest priority, followed
by AND and then OR.

4
Laws of Boolean Algebra – Commutative
Laws
• The commutative laws are applied to addition and
multiplication. For addition, the commutative law
states - In terms of the result, the order in which
variables are ORed makes no difference.
A+B=B+A
• For multiplication, the commutative law states - In
terms of the result, the order in which variables
are ANDed makes no difference.
AB = BA
Laws of Boolean Algebra – Associative
Laws
• For addition, the associative law states - When
ORing more than two variables, the result is the
same regardless of the grouping of the variables
A + (B +C) = (A + B) + C

• For multiplication, the associative law states -


When ANDing more than two variables, the result
is the same regardless of the grouping of the
variables.
A(BC) = (AB)C
Laws of Boolean Algebra – Distributive
Laws
• The distributive law is the factoring law. A common
variable can be factored from an expression just as
in ordinary algebra. That is
AB + AC = A(B+ C)
• The distributive law can be illustrated with
equivalent circuits:
A
AB
B B
B+ C
C X
X A
A AC
C
A(B+ C) AB + AC
Rules of Boolean Algebra
1. +0= 8. · =0
2. +1=1
9. =
3. ·0=0
10. + =
4. ·1=
11. + = +
5. + =
12. + + = +
6. + =1
7. · =
Boolean Identities – DeMorgan’s
Theorems
1. The complement of two or more ANDed variables
is equivalent to the OR of the complements of
the individual variables.
= +

2. The complement of two or more ORed variables


is equivalent to the AND of the complements of
the individual variables.
+ =
SOP and POS forms
• Boolean expressions can be written in the sum-of-
products form (SOP) or in the product-of-sums
form (POS).
• An expression is in SOP form when two or more
product terms are summed as in the following
examples:
+ + + +
• A SOP expression is formed based on the output
with the value of 1
SOP and POS forms
• An expression is in POS form when two or more
sum terms are multiplied as in the following
examples:
+ + + + +

• A POS expression is formed based on the output


with the value of 0.
Logic Simplification Using Boolean
Algebra
• A logic expression can be reduced to its simplest
form or changed to a more convenient form
• Example:
+ + + +
Distributive law + + + +
Rule 7 · = + + + +
Rule 5 + = + + +
Rule 10 + = + +
Rule 10 + = +
Karnaugh Map
• The Karnaugh map – uses an
array of cells to represent binary
values of the input variables
Z = A.B  22 = 4 cells
• The number of cells in a
Karnaugh map = the total
number of possible input B
variable combinations. A 0 1
• The number of cells – 0 0 0
determined by using the formula
2n where n is the number of 1 0 1
inputs or variables.
Karnaugh Map
• The process of simplification using the Karnaugh
map – minimization – resulting an expression that
contains the fewest possible terms with the fewest
possible variables
• After mapping the SOP expression into the
Karnaugh map, the next step to produce a
simplified SOP expression is grouping the 1s.
Karnaugh Map
• The rules of Karnaugh map simplification are:
• A group can contain either 1, 2, 4, 8 or 16 – based on the
powers of two.
• Each cell in a group must be adjacent to one or more
cells in that same group
• Must group the largest possible number of 1’s group first
and followed with the others groups of 1s if more group
identify.
• Make sure each 1 on the map must be included in at
least one group. The 1s that has already in a group can
be included in another group as long as the overlapping
groups include noncommon 1s
Karnaugh Map
+ + + +
Wrap-around
C adjency
C AB 0 1
AB 0 1
00 1 0 00 1 1
01 0 1 01 1 0
11 1 1 11 0 1
10 0 0 10 1 1
Logic Gates
• A gate is an electronic device that produces a result
based on two or more input values.
• In reality, gates consist of one to six transistors, but
digital designers think of them as a single unit.
• Integrated circuits contain collections of gates suited to a
particular purpose.

17
Logic Gates
• The three simplest gates are the AND, OR, and NOT
gates.

• They correspond directly to their respective


Boolean operations, as you can see by their truth
tables. 18
Logic Gates
• Another very useful gate is the exclusive OR (XOR)
gate.
• The output of the XOR operation is true only when
the values of the inputs differ.

Note the special symbol 


for the XOR operation.

19
Logic Gates
• NAND and NOR
are two very
important gates.
Their symbols
and truth tables
are shown at the
right.

20
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.
21
Logic Gates
• Gates can have multiple inputs and more than one
output.
• A second output can be provided for the complement of
the operation.
• We’ll see more of this later.

22
Digital Components
• The main thing to remember is that combinations
of gates implement Boolean functions.
• The circuit below implements the Boolean
function:

We simplify our Boolean expressions so


that we can create simpler circuits. 23
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.
24
Combinational Circuits
• One of the simplest example is the half adder,
which finds the sum of two bits.
• As we see, the sum can be found using the XOR
operation and the carry using the AND operation.

25
Combinational Circuits
• We can change our half adder into to a full adder
by including gates for processing the carry bit.

26
Combinational Circuits - Decoders
• Decoders are another important type of combinational
circuit.
• Among other things, they are useful in 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.
• Apply in CPU control (advance topic – will not covered in
this subject)

This is a block
diagram for a
decoder.
27
Combinational Circuits - Decoders
• This is what a 2-to-4 decoder looks like on the
inside.

If x = 0 and y = 1,
which output line
is enabled?

28
Combinational Circuits - Multiplexer
• A multiplexer does just the
opposite of a decoder.
• It selects a single output
from several inputs.
• The particular input chosen
for output is determined by
the value of the
multiplexer’s control lines.
• To be able to select among This is a block
n inputs, log2n control diagram for a
lines are needed. multiplexer.

29
Combinational Circuits - Multiplexer
• This is what a 4-to-1 multiplexer looks like on the
inside.

If S0 = 1 and S1 = 0,
which input is
transferred to the
output?
30
Sequential Circuits
• 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.

31
Sequential Circuits
• State changes occur in sequential circuits only
when the clock ticks.
• 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.

32
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?

33
Sequential Circuits
• To retain their state values, sequential circuits rely
on feedback.
• Feedback in digital circuits - an output is looped back to
the input.
• Example of feedback - the most basic sequential
logic components, the SR flip-flop.
• The “SR” stands for set/reset.

34
Sequential Circuits (video)
• 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.

35
Sequential Circuits (video)
• 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.

36
Sequential Circuits
• 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,

37
Sequential Circuits (video)
• Another modification of
the SR flip-flop - the D
flip-flop - 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.
38
Chapter 3 Conclusion
• Computers are implementations of Boolean logic.
• Boolean functions are completely described by
truth tables.
• Logic gates are small circuits that implement
Boolean operators.
• The basic gates are AND, OR, and NOT.
• The XOR gate is very useful in parity checkers and
adders.
• The “universal gates” are NOR, and NAND.

39
Chapter 3 Conclusion
• Computer circuits consist of combinational logic
circuits and sequential logic circuits.
• Combinational circuits produce outputs (almost)
immediately when their inputs change.
• Sequential circuits require clocks to control their
changes of state.
• The basic sequential circuit unit is the flip-flop: The
behaviors of the SR, JK, and D flip-flops are the
most important to know.

40

You might also like