The main contents of the chapter consist of the following: Basic logic functions can be made from AND, OR, and NOT (invert) functions; the behavior of digital circuits can be represented with waveforms, truth tables, or symbols; primitive gates can be combined to form larger circuits; boolean algebra defines how binary variables can be combined;…
Trang 1Lecture 4
Boolean Algebra
Trang 2• Today is Monday AND it is raining
• Today is Sunday OR it is NOT raining
• Today is Monday AND today is NOT Monday
- (This is a contradiction)
° The expression as a whole is either true or false.
Trang 3Things can get a little tricky…
° Are these two statements equivalent?
• It is not nighttime and it is Monday OR it is raining and it is
Monday
• It is not nighttime or it is raining and Monday AND it is Monday
Trang 4Boolean Algebra
° Formal logic: In formal logic, a statement
(proposition) is a declarative sentence that is either
Trang 5Venn Diagrams
5
A A B
B A
B A
B A
B A
B A
A
A A
Trang 6Boolean Algebra
° Boolean Algebra is a mathematical technique that
provides the ability to algebraically simplify logic
expressions These simplified expressions will
result in a logic circuit that is equivalent to the
original circuit, yet requires fewer gates.
A
B
C
B+A C
A
B
Trang 7Boolean Algebra, Logic and Gates
° Logical operators operate on binary values and binary
variables.
° Basic logical operators are the logic functions AND, OR and
NOT.
° Logic gates implement logic functions.
° Boolean Algebra: a useful mathematical system for
specifying and transforming logic functions.
° We study Boolean algebra as a foundation for designing
and analyzing digital systems!
° A literal is a Boolean variable or its complement A minterm
of the Boolean variables x 1 , x 2 , …, x n is a Boolean product
y 1 y 2 …y n , where y i = x i or y i = -x i
° Hence, a minterm is a product of n literals, with one literal
for each variable.
Trang 8Boolean Switching
° Boolean (switching) variable x {0,1}∈
• 0, 1 are abstract symbols
They may correspond to {false, true} in logic, {off, on} of a switch, {low voltage, high voltage} of a CMOS circuit, or other meanings
Trang 9° Logic functions with 1’s and 0’s
• Building digital circuitry
Trang 10° We use 1 and 0 to denote the two values.
° Variable identifier examples:
• A, B, y, z, or X 1 for now
• RESET, START_IT, or ADD1 later
Trang 11° NOT is denoted by an overbar ( ¯ ), a single quote
mark (') after, or (~) before the variable.
Trang 12° Examples:
• is read “Y is equal to A AND B.”
• is read “z is equal to x OR y.”
• is read “X is equal to NOT A.”
Notation Examples
Note: The statement:
1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).
B A
Y
y x
z
A X
Trang 13Operator Definitions
values "0" and "1" for each
Trang 140 1
1 0
X
NOT
X Z
Truth Tables
° Truth table a tabular listing of the values of a function
for all possible combinations of values on its arguments
° Example: Truth tables for the basic logic operations:
1 1 1
0 0 1
0 1 0
0 0 0
Z = X·Y Y
Trang 15° Using Switches
• Inputs:
- logic 1 is switch closed
- logic 0 is switch open
• Outputs:
- logic 1 is light on
- logic 0 is light off.
• NOT input:
- logic 1 is switch open
- logic 0 is switch closed
Trang 16° Example: Logic Using Switches
° Light is on (L = 1) for
L(A, B, C, D) = and off (L = 0), otherwise.
° Useful model for relay and CMOS gate
circuits, the foundation of current digital logic circuits
Logic Function Implementation – cont’d
BA
D
C
A (B C + D) = A B C + A D
Trang 17Digital Systems
° Analysis problem:
• Determine binary outputs for each combination of inputs
° Design problem: given a task, develop a circuit
that accomplishes the task
• Many possible implementation
• Try to develop “best” circuit based on some criterion
(size, power, performance, etc.)
Logic Circuit
Trang 18Toll Booth
Controller
° Consider the design of a toll booth controller
° Inputs: quarter, car sensor
° Outputs: gate lift signal, gate close signal
° If driver pitches in quarter, raise gate.
° When car has cleared gate, close gate.
Logic Circuit
$.25
Car?
Raise gate Close gate
Trang 19Describing Circuit Functionality: Inverter
° Basic logic functions have symbols.
° The same functionality can be represented with truth
tables.
• Truth table completely specifies outputs for all input combinations.
° The above circuit is an inverter
Trang 20° This is an AND gate
° So, if the two inputs signals
are asserted (high) the
output will also be asserted.
Otherwise, the output will
Trang 21° So, if either of the two
input signals are
Trang 22Describing Circuit Functionality: Waveforms
° Waveforms provide another approach for representing
functionality.
° Values are either high (logic 1) or low (logic 0).
° Can you create a truth table from the waveforms?
Trang 23Consider three-input gates
3 Input OR Gate
Trang 24Ordering Boolean Functions
Trang 25Boolean Algebra
° A Boolean algebra is defined as a closed algebraic
system containing a set K or two or more elements and the two operators, and +.
° Useful for identifying and minimizing circuit
functionality
° Identity elements
• a + 0 = a
• a 1 = a
° 0 is the identity element for the + operation.
° 1 is the identity element for the operation.
Trang 26Commutatively and Associativity of the Operators
Trang 27Distributivity of the Operators and
° The Existence of the Complement:
For every a in K there exists a unique element
called a’ (complement of a) such that,
• a + a’ = 1
• a a’ = 0
° To simplify notation, the operator is frequently
omitted When two elements are written next to each other, the AND (.) operator is implied…
• a + b c = ( a + b ) ( a + c )
• a + bc = ( a + b )( a + c )
Trang 28lity
° The principle of duality is an important concept
This says that if an expression is valid in Boolean algebra, the dual of that expression is also valid.
° To form the dual of an expression, replace all +
operators with operators, all operators with + operators, all ones with zeros, and all zeros with ones.
° Form the dual of the expression
a + (bc) = (a + b)(a + c)
° Following the replacement rules…
a(b + c) = ab + ac
° Take care not to alter the location of the
parentheses if they are present.
Trang 29n
° This theorem states:
a’’ = a
° Remember that aa’ = 0 and a+a’=1
• Therefore, a’ is the complement of a and a is also the
complement of a’
• As the complement of a’ is unique, it follows that a’’=a.
° Taking the double inverse of a value will give the
initial value.
Trang 31DeMorgan’s
Theorem
° A key theorem in simplifying Boolean algebra
expression is DeMorgan’s Theorem It states:
° Complement the expression
a(b + z(x + a’)) and simplify.
Trang 32Y X Y X 14A)
Y X Y X X 13D)
Y X Y X X 13C)
Y X XY X
13B)
Y X Y X X 13A)
YZ YW
XZ XW
Z W Y X 12B)
XZ XY
Z Y X 12A)
Z Y X Z
Y X 11B)
Z XY YZ
X 11A)
X
Y
Y X 10B)
X
Y
Y X 10A)
Commutative Law
Associative Law
Distributiv
e Law
Consensus Theorem
Boolean & DeMorgan’s Theorems
DeMorgan’s
Trang 33A For Theorem #14B, break the line, and
change the OR function to an AND function.
Be sure to keep the lines over the variables.
Trang 34° Basic logic functions can be made from AND, OR,
and NOT (invert) functions
° The behavior of digital circuits can be represented
with waveforms, truth tables, or symbols
° Primitive gates can be combined to form larger
circuits
° Boolean algebra defines how binary variables can
be combined
° Rules for associativity, commutativity, and
distribution are similar to algebra
° DeMorgan’s rules are important
• Will allow us to reduce circuit sizes.