View
22
Download
2
Category
Preview:
Citation preview
Digital Logic Design
Lecture 2: Logic functions and Boolean algebra
Napat Triroj 1
A binary switch
Napat Triroj 2
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
L = 1 if x = 1
L = 0 if x = 0
Example: a light controlled by a switch
The logic function describes the output as a function of the input.
input variable
AND and OR operations
Napat Triroj 3
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Example: a system using two switches to control the state of the light
“AND” operator or logical “product”
“OR” operator or logical “sum”
AND and OR operations
Napat Triroj 4
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The logic function:
Complement or NOT operation
Napat Triroj 5
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Example: The light will be turned on when the switch is opened.
L(x) is a complement of x.
NOT operator
Equivalent NOT operators:
Truth tables
Napat Triroj 6
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Two-input variables
For n input variables, the truth table contains 2n rows.
These rows refer to possible combinations of logic values.
Three-input variables
Analysis of a logic network
Napat Triroj 7
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
0
0
0
1 0
1 1
1
The timing diagrams depict the functional behavior of a logic circuit in a form that can be observed when the circuit is tested using instruments such as logic analyzers and oscilloscopes.
Functionally equivalent networks
Napat Triroj 8
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The equivalence:
g(x1, x2)
1101
toggle switchVDD
GND
Example: the equivalence of a logic network
Napat Triroj 9
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The required behavior: The light (L) should be ON only if one, but not both, of the toggle switches is in the top position.
exclusive-OR
Example: an adder circuit
Napat Triroj 10
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The addition of two one-digit binary numbers:
Binary number
Binary Decimal
0112
Boolean algebra: Axioms
Napat Triroj 11
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The Boolean algebra can be used for designing and analyzing logic circuits.
Boolean algebra is based on a set of rules that are derived from asmall number of basic assumptions called axioms.
Axioms:The principle of duality:
Given a logic expression, its dual is obtained by replacing all + operators with · operators, and vice versa, and by replacing all 0s with 1s, and vice versa.
Boolean algebra: Single-variable theorems
Napat Triroj 12
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The theorem can be proved by substituting the values x = 0 and x = 1 into the expressions and using the axioms.
Boolean algebra: Two- and three-variable properties
Napat Triroj 13
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
In the absence of parentheses, operations in a logic expression must be performed in the order: NOT, AND, and then OR.
The Venn diagram
Napat Triroj 14
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
The Venn diagram has traditionally been used in mathematics to provide a graphical illustration of various operations and relations in the algebra of sets.
In Boolean algebra there are only two values (elements) in the universe, B = {0, 1}.
The shading area is where the value of the logic expression equal to 1.
unionintersection
Example: verification of the distributive property
Napat Triroj 15
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Synthesis of logic circuits using AND, OR, and NOT gates
Napat Triroj 16
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Example: designing a logic circuit that implements the following truth table
Steps:
1. Create a product term that has a value of 1 for each valuation for which the output function f has to be 1.
2. Take a logical sum of these product terms to realize f .
sum-of-products
algebraic manipulation
Sum-of-products and product-of-sums forms
Napat Triroj 17
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Consider the rows for which f = 1:
SOP
Consider the rows for which f = 0:
POS
complements of minterms
Logic symbol interpretation
Napat Triroj 18
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
“bubble”
NAND and NOR logic networks
Napat Triroj 19
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Alternate logic symbols
Napat Triroj 20
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
Using NAND gates to implement a sum-of-products
Napat Triroj 21
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Using NOR gates to implement a product-of-sums
Napat Triroj 22
Stephen Brown and Zvonko Vranesic. Fundamentals of Digital Logic with Verilog Design, 3rd ed. The McGraw-Hill Companies, Inc. 2014.
Selection of gate representation
Napat Triroj 23
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
Output Z will go HIGH whenever either A = B = 1 or C = D = 1(or both).
Output Z will go LOW only when A or B is LOW and C or D is LOW.
Selection of gate representation
Napat Triroj 24
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
Example: When the output of the logic circuit in the figure below goes LOW, it activates another logic circuit. Modify the circuit diagram to represent the circuitoperation more effectively.
Tip for bubble placement: Whenever possible, choose gate symbols so that bubble outputs are connected to bubble inputs, and nonbubble outputs to nonbubble inputs.
Output Z will go LOW only when A and B are LOW and C or D is LOW and E is HIGH.
Universality of NAND gates
Napat Triroj 25
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
NAND gates can be used to implement any Boolean function.
Universality of NOR gates
Napat Triroj 26
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
NOR gates can be used to implement any Boolean function.
Exclusive OR (XOR) circuits
Napat Triroj 27
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.http://www.electrical4u.com/exclusive-or-gate/
When odd number of inputs in the gate are 1, the output is 1, and when none or even number of inputs are 1, the output is logical 0.
“Odd function”
Exclusive NOR (XNOR) circuits
Napat Triroj 28
Neal S. Widmer, Gregory L. Moss, and Ronald J. Tocci. Digital Systems: Principles and Applications, 12th ed. Pearson Education, Inc. 2017.
When there are odd numbers of inputs are in high or logical 1 condition, the output will be 0, in otherwise the output will be 1.
http://www.electrical4u.com/exclusive-or-gate/
“Even function”
Recommended