Digital - Logic Basics
Digital - Logic Basics
Chapter 1
S. Dandamudi
Outline
• Basic concepts • Deriving logical expressions
∗ Simple gates ∗ Sum-of-products form
∗ Completeness ∗ Product-of-sums form
• Logic functions • Simplifying logical
∗ Expressing logic functions expressions
∗ Equivalence ∗ Algebraic manipulation
• Boolean algebra ∗ Karnaugh map method
∗ Boolean identities ∗ Quine-McCluskey method
∗ Logical equivalence • Generalized gates
• Logic Circuit Design • Multiple outputs
Process • Implementation using other
gates (NAND and XOR)
1999 S. Dandamudi Digital Logic Basics: Page 2
1
Introduction
• Hardware consists of few simple building blocks
∗ These are called logic gates
» AND, OR, NOT
• Logic gates are built using transistors
» NOT gate can be implemented by using 1 transistor
» AND gate requires 3 transistors
• Transistors are the fundamental devices
» Pentium (1993) consists of 3 million transistors
» Compaq Alpha consists of 9 million transistors
» Current (in 1999), we can build chips with 100 million
transistors
Basic Concepts
A B F
• Simple gates
0 0 0
∗ AND A 0 1 0
F
∗ OR B 1 0 0
• Functionality can be A B F
2
Basic Concepts (cont’d)
A B F
• Additional useful gates 0 0 1
∗ NAND A
F 0 1 1
B
∗ NOR
1 0 1
NAND gate 1 1 0
∗ XOR
A B F
• NAND is AND+NOT 0 0 1
A
0 1 0
• NOR is OR + NOT B
F
1 0 0
exclusive-OR function A B F
0 0 0
• NAND and NOR gates A 0 1 1
F
require only 2 transistors B 1 0 1
3
Basic Concepts (cont’d)
• Complete sets
∗ A set of gates is complete
» if we can implement any logical function using only the type of
gates in the set
– You can uses as many gates as you want
∗ Some example complete sets
» {AND, OR, NOT} Not a minimal complete set
» {AND, NOT}
» {OR, NOT}
» {NAND}
» {NOR}
∗ Minimal complete set
– A complete set with no redundant elements.
1999 S. Dandamudi Digital Logic Basics: Page 7
A
F
B
AND gate
A
A F B
4
Basic Concepts (cont’d)
• Proving NOR gate is universal
A
F
B
OR gate
A
A F B
Logic Chips
• Low voltage level: < 0.4V
• High voltage level: > 2.4V
• Positive logic:
volts
∗ Low voltage represents 0
5
∗ High voltage represents 1
4
High level
• Negative logic: 3
∗ High voltage represents 0 2 Undefined range
∗ Low voltage represents 1 1 (forbidden)
Low level
• Propagation delay
∗ Delay from input to output
∗ Typical value: 5-10 ns
5
Logic Chips (cont’d)
1 14 Vcc 1 14 Vcc 1 14 Vcc
2 13 2 13 2 13
3 12 3 12 3 12
4 11 4 11 4 11
5 10 5 10 5 10
6 9 6 9 6 9
2 13 2 13 2 13
3 12 3 12 3 12
4 11 4 11 4 11
5 10 5 10 5 10
6 9 6 9 6 9
1 14 Vcc 1 14 Vcc
2 13 2 13
3 12 3 12
4 11 4 11
5 10 5 10
6 9 6 9
GND 7 8 GND 7 8
7420 7430
6
Logic Functions
• Logical functions can be expressed in several
ways:
∗ Truth table
∗ Logical expressions
∗ Graphical form
• Example:
∗ Majority function
» Output is one whenever majority of inputs are 1
» We use 3-input majority function
0 0 0 0 A B C
0 0 1 0
0 1 0 0
0 1 1 1
F
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
1999 S. Dandamudi Digital Logic Basics: Page 14
7
Logical Equivalence
• All three circuits implement F= A B function
A
A F2
F1 B
B
(a) (b)
A
B
F3
(c)
1999 S. Dandamudi Digital Logic Basics: Page 15
8
Logical Equivalence (cont’d)
• Derivation of logical expression from a circuit
∗ Trace from the input to output
» Write down intermediate logical expressions along the path
A A+B
B (A + B) (A + B)
B
A+B F3
A (A + B) (A + B) (A + B)
A+B
A B F1 = A B F3 = (A + B) (A + B) (A + B)
0 0 0 0
0 1 0 0
1 0 0 0
1 1 1 1
9
Boolean Algebra
• Boolean identities
Name AND version OR version
Identity x.1 = x x+0=x
Complement x. x = 0 x+x=1
Commutative x.y = y. x x+y=y+x
Distribution x. (y+z) = xy+xz x + (y. z) =
(x+y) (x+z)
Idempotent x.x = x x+x=x
Null x.0 = 0 x+1=1
1999 S. Dandamudi Digital Logic Basics: Page 19
10
Boolean Algebra (cont’d)
• Proving logical equivalence: Boolean algebra
method
∗ To prove that two logical functions F1 and F2 are
equivalent
» Start with one function and apply Boolean laws to derive the
other function
» Needs intuition as to which laws should be applied and when
– Practice helps
» Sometimes it may be convenient to reduce both functions to
the same expression
∗ Example: We show that F1= A B and F3 are equivalent
11
Deriving Logical Expressions
• Derivation of logical expressions from truth tables
∗ sum-of-products (SOP) form
∗ product-of-sums (POS) form
• SOP form
∗ Write an AND term for each input combination that
produces a 1 output
» Write the variable if its value is 1; complement otherwise
∗ OR the AND terms to get the final expression
• POS form
∗ Dual of the SOP form
12
Deriving Logical Expressions (cont’d)
• 3-input majority function • POS logical expression
A B C F • Four sum terms
∗ Because there are 4 rows
0 0 0 0 with a 0 output
0 0 1 0
0 1 0 0
F = (A + B + C) (A + B + C)
0 1 1 1
(A + B + C) (A + B + C)
1 0 0 0
1 0 1 1
• Pi notation
1 1 0 1
Π (0, 1, 2, 4 )
1 1 1 1
1999 S. Dandamudi Digital Logic Basics: Page 25
1 0 1 0
1 1 0 0
1 1 1 1
1999 S. Dandamudi Digital Logic Basics: Page 26
13
Brute Force Method of Implementation
3-input even-parity function • POS implementation
A B C A B C
A B C F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1 F
1 0 1 0
1 1 0 0
1 1 1 1
1999 S. Dandamudi Digital Logic Basics: Page 27
14