Chapter 04 and 5 Boolean Algebra and Digital Logic
Chapter 04 and 5 Boolean Algebra and Digital Logic
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:
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
17
Logic Gates
• The three simplest gates are the AND, OR, and NOT
gates.
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:
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